-
Notifications
You must be signed in to change notification settings - Fork 0
/
paledit.p8
1162 lines (1081 loc) · 49.7 KB
/
paledit.p8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
pico-8 cartridge // http://www.pico-8.com
version 8
__lua__
function identity(x)
return x
end
function sort(t,key)
if (key==nil) key=identity
msort(t,1,#t,key)
end
function msort(t,a,b,key)
if (a==b) return
local sp=flr((a+b)/2)
if b-a>=2 then
msort(t,a,sp,key)
msort(t,sp+1,b,key)
end
local ai,bi=a,sp+1
local ex={}
function exa()
add(ex,t[ai])
ai+=1
end
function exb()
add(ex,t[bi])
bi+=1
end
while ai<=sp and bi<=b do
if key(t[ai])>key(t[bi]) then
exb()
else
exa()
end
end
while ai<=sp do exa() end
while bi<=b do exb() end
ai=1
for i=a,b do
t[i]=ex[ai]
ai+=1
end
end
--cornercode
-- 0x1 = topleft
-- 0x2 = topright
-- 0x4 = botleft
-- 0x8 = botright
--combine, e.g.
-- 0x3 = top
-- 0xd = l-shape
-- 0xf = all
--dividecode
-- same as cornercode, but no
-- high bit. e.g.
-- 0x1 = topleft
-- 0x2 = topright
-- 0x3 = top/bottom
-- 0x4 = botleft
-- 0x5 = left/right
-- 0x6 = crisscross (bad)
-- 0x7 = botright
big_divs=64
thin_divs=80
wall_divs=96
box_masks=112
zig_masks=128
plt_addr=0x5000 -- to 0x50ff
sha_addr=0x5100 -- to 0x51ff
sha2_addr=0x5200 -- to 0x520f
tex_stone=4
tex_grass=6
tex_tangle=8
tex_rock=10
tex_dirt=12
all_tex={4,6,8,10,12,14,20,22}
function rnd_tex()
return all_tex[rn(#all_tex)+1]
end
function ccode(tl,tr,bl,br)
-- corder code
return
(tl and 1 or 0) +
(tr and 2 or 0) +
(bl and 4 or 0) +
(br and 8 or 0)
end
function abcl(a,b,v)
-- a/b classify
if (v==a) return 1
if (v==b) return 2
return 0
end
function ccodemap4(a,b,mx,my)
-- read map to calculate corner code
local
tlc,trc,blc,brc
tlc=abcl(a,b,mget(mx,my))
trc=abcl(a,b,mget(mx+1,my))
blc=abcl(a,b,mget(mx,my+1))
brc=abcl(a,b,mget(mx+1,my+1))
return ccode(
tlc==0,trc==0,blc==0,brc==0),
max(max(max(tlc,trc),
blc),
brc)
end
function sprofs(s, y)
-- calculate address of sprite #s row y
y=y or 0
return
(s%16)*4 +
(flr(s/16)*512) +
y*64
end
function gfxofs(x, y)
-- calculate address of screen
-- x,y. when x is odd, round
-- down to the byte
return
0x6000 +
flr(x/2) +
y*64
end
function maskcpy(
src1,src2,mask,dest,bytes)
-- copy pixel bytes with a
-- mask, which should have
-- 0x0 nibbles for clear and
-- 0x7 nibbles for opaque
-- applies a palette
-- transform to src1 only
for i=1,bytes do
s1=peek(
bor(plt_addr,peek(src1)))
m=peek(mask)
s2=peek(src2)
v=band(s1,m)+band(s2,bnot(m))
poke(dest,v)
src1+=1
src2+=1
dest+=1
mask+=1
end
end
function nomaskcpy(
src1,src2,mask,dest,bytes)
for i=1,bytes do
s1=peek(
bor(plt_addr,peek(src1)))
poke(dest,s1)
src1+=1
dest+=1
end
end
function memspr(spr,go)
maskspr2(spr,nil,nil,go)
end
function maskspr2(
spr1,spr2,mask,go)
so1=sprofs(spr1)
local mcpy=maskcpy
local mo=0
if mask==nil then
mcpy = nomaskcpy
else
mo=mask
end
if spr2==nil then
so2 = go
else
so2 = sprofs(spr2)
end
--sprofs(mask)
for h=0,7 do
mcpy(
so1,so2,
mo,go,4)
so1+=64
so2+=64
mo+=64
go+=64
end
end
function build_plt(addr)
-- build lookup table for
-- palette to use in maskspr
local ca,cb
for a=0,15 do
ca=shl(
band(15,peek(0x5f00+a)),4)
for b=0,15 do
cb=band(15,peek(0x5f00+b))
poke(
addr+bor(shl(a,4),b),
bor(ca,cb))
end
end
end
function pal_switch(n)
setpal(n)
build_plt(plt_addr)
end
wall=2
floor=1
tex_wall=tex_rock
tex_floor=tex_tangle
function setpal(idx)
for i=0,3 do
pal(i,sget(idx,i+8))
end
end
function getunusedcol(pal1,pal2,pal3)
local c=15
repeat
local ok=true
for i=0,3 do
for p in all({pal1,pal2,pal3}) do
if sget(p,i+8)==c then
c-=1
ok=false
end
end
end
until ok
return c
end
function prerender(
tex_a, tex_b,
pal_a, pal_b,
ptr_dest)
pal_switch(pal_a)
for i=0,15 do
maskspr2(tex_a,nil,nil,
ptr_dest+i*4)
end
pal_switch(pal_b)
for i=0,15 do
maskspr2(
tex_b,nil,
sprofs(zig_masks+i),
ptr_dest+i*4)
end
end
function rn(n)
return flr(rnd(n))
end
function mkbiome(b)
b.w={t=b.walt,p=b.walp}
b.f={t=b.flot,p=b.flop}
b.b={t=b.bort,p=b.borp}
return b
end
function rndbiome()
return mkbiome {
walt=rnd_tex(),
flot=rnd_tex(),
bort=big_divs + 16*rn(3),
walp=rn(24),
flop=rn(24),
borp=rn(24),
wallstyle=rn(3)
}
end
biomes={}
function genbiomes(seed)
if (seed!=nil) srand(seed)
for i=0,63 do
biomes[i]=rndbiome()
end
end
ice_biome={
walt=tex_rock,
flot=tex_dirt,
bort=wall_divs,
walp=8,
flop=10,
borp=9
}
dark_biome={
walt=tex_dirt,
flot=tex_dirt,
bort=big_divs,
walp=11,
flop=0,
--borp=6
borp=rn(24)
}
forest_biome={
walt=tex_tangle,
flot=tex_grass,
bort=thin_divs,
walp=4,
flop=12,
borp=13
}
darker_biome={
walt=tex_rock,
flot=tex_dirt,
bort=thin_divs,
walp=0,
flop=1,
borp=14
}
main_bordert=15
ex1_bordert=15
ex2_bordert=15
function counter(c,d)
return function()
local r=c
c+=d
return r
end
end
function setup_room(
biome_main,
biome_ex1,
biome_ex2)
palt()
palt(0,false)
prerender(
biome_main.walt,
biome_ex1.walt,
biome_main.walp,
biome_ex1.walp,
0x1800)
prerender(
biome_main.walt,
biome_ex2.walt,
biome_main.walp,
biome_ex2.walp,
0x1a00)
prerender(
biome_main.flot,
biome_ex1.flot,
biome_main.flop,
biome_ex1.flop,
0x1c00)
prerender(
biome_main.flot,
biome_ex2.flot,
biome_main.flop,
biome_ex2.flop,
0x1e00)
--rectfill(0,0,127,7,0)
memset(0x1600,0,0x200)
ptr_spr=counter(sprofs(main_wavt),4)
function do_variant(pt)
pal_switch(pt.p)
memspr(pt.t+1,ptr_spr())
end
do_variant(biome_main.w)
do_variant(biome_main.f)
do_variant(biome_ex1.w)
do_variant(biome_ex1.f)
do_variant(biome_ex2.w)
do_variant(biome_ex2.f)
pal_switch(biome_main.borp)
main_bordert=
getunusedcol(
biome_main.borp,
biome_ex1.borp,
biome_ex2.borp)
pal(3,main_bordert)
build_plt(plt_addr)
ptr_spr=counter(sprofs(main_bort),4)
for i=0,7 do
memspr(biome_main.bort+i,ptr_spr())
end
ptr_spr=counter(sprofs(ex1_bort),4)
memset(0x1400,0,0x200)
setpal(biome_ex1.borp)
pal(3,main_bordert)
build_plt(plt_addr)
for i=0,7 do
memspr(biome_ex1.bort+i,ptr_spr())
end
setpal(biome_ex2.borp)
pal(3,main_bordert)
build_plt(plt_addr)
for i=0,7 do
memspr(biome_ex2.bort+i,ptr_spr())
end
--Uncomment to dump sprites
--back to screen
--memcpy(0x6000,0x1400,0xc00)
bake_map()
clear_borders()
bake_borders(1, main_bort)
bake_borders(2, ex1_bort)
bake_borders(3, ex2_bort)
end
-- We use sprites 0xb8..0xff
-- for pre-baking the map tiles
-- for room.
-- wavt: wall/variant/tex
-- flvt: floor/variant/tex
main_wavt=0xb8
main_flvt=0xb9
ex1_wavt=0xba
ex1_flvt=0xbb
ex2_wavt=0xbc
ex2_flvt=0xbd
main_bort=0xb0
ex1_bort=0xa0
ex2_bort=0xa8
wall_ex1=0xc0
wall_ex2=0xd0
floor_ex1=0xe0
floor_ex2=0xf0
variants={
[wall_ex1]=main_wavt,
[wall_ex2]=main_wavt,
[floor_ex1]=main_flvt,
[floor_ex2]=main_flvt,
[wall_ex1+0xf]=ex1_wavt,
[wall_ex2+0xf]=ex2_wavt,
[floor_ex1+0xf]=ex1_flvt,
[floor_ex2+0xf]=ex2_flvt
}
function vspr(idx, x, y)
local v=variants[idx] or idx
if (flr(shr(x,3))+flr(shr(y,3)))%2==0 then
idx=v
end
spr(idx,x,y)
end
function pickv(idx, x, y)
if (x+y)%2==0 then
return variants[idx] or idx
end
return idx
end
function clear_borders()
mrect(54,0,54+16,16,0)
end
function bake_borders(code, texbase)
local q
for x=0,15 do
for y=0,15 do
q=ccodemap4(2,3,x,y)
if band(q,8)==8 then
q=bxor(q,0xf)
end
ex=mget(x+19,y+1)
if ex==code and q>0 then
mset(54+x,y,texbase+q)
end
end
end
end
shadow_tiles={
[4]=4,
[6]=4,
[8]=7,
[9]=7,
[12]=3,
[13]=2,
[14]=1
}
function draw_shadows()
local q
pal()
palt(0,false)
for x=0,15 do
for y=0,15 do
q=ccodemap4(2,3,x,y)
if q>0 then
q=peek(sha2_addr+q)
if q>0 then
fast_shadow(72+q,x*8,y*8)
end
end
end
end
end
function slow_shadow(sidx,x,y)
-- Works anywhere
local sx=8*(sidx%16)
local sy=8*flr(sidx/16)
for yy=0,7 do
for xx=0,7 do
local c=sget(xx+sx,yy+sy)
local d=pget(x+xx,y+yy)
c=peek(sha_addr+bor(d,shl(c,4)))
pset(x+xx,y+yy,c)
end
end
end
function fast_shadow(sidx,x,y)
-- Does not range check - not
-- safe to use if it might
-- fall outside the screen.
-- Only for even x.
local saddr=sprofs(sidx)
local paddr=gfxofs(x,y)
-- The most outrageous hack of
-- all here is that we start
-- yy from 3 since none of our
-- shadow textures have content
-- in the top three rows.
for yy=3,7 do
local ofs=yy*64
for xx=0,3 do
local cs=peek(saddr+ofs)
local ds=peek(paddr+ofs)
local clo=shl(band(cs,0x3),4)
local dlo=band(ds,0xf)
dlo=peek(bor(clo,dlo)+sha_addr)
local chi=band(cs,0xf0)
local dhi=shr(band(ds,0xf0),4)
dhi=peek(bor(chi,dhi)+sha_addr)
cs=bor(dlo,shl(dhi,4))
poke(paddr+ofs,cs)
ofs+=1
end
end
end
function init_fast_shadow(addr)
-- build lookup table for
-- palette to use fast_shadow
for c=0,3 do
for d=0,15 do
local result=sget(c,d+16)
poke(sha_addr+d+c*16,result)
end
end
memset(sha2_addr,16,0)
for idx,v in pairs(shadow_tiles) do
poke(sha2_addr+idx,v)
end
end
function dice(lo,hi)
if (lo>=hi) return lo
return rn(hi-lo+1)+lo
end
function mrect(x1,y1,x2,y2,v)
for y=y1,y2 do
for x=x1,x2 do
mset(x,y,v)
end
end
end
seed_xlinks=77
seed_ylinks=78
seed_walls=79
clockwise={
{0,-1},
{1,-1},
{1,0},
{1,1},
{0,1},
{-1,1},
{-1,0},
{-1,-1}
}
cardinal={
{0,-1},
{1,0},
{0,1},
{-1,0}
}
function cavernify(x,y,p)
-- toggle map cell iff it
-- won't affect topology
-- assumes all map values
-- are 1 or 2
function getneib(dir)
return mget(
x+dir[1],
y+dir[2])
end
local acc=0
local prev=getneib(
clockwise[
#clockwise])
for dir in all(clockwise) do
local v=getneib(dir)
if v!=prev then
acc+=1
end
prev=v
end
if (acc!=2) return
acc=0
local cell=mget(x,y)
for dir in all(cardinal) do
if getneib(dir)!=cell then
acc+=1
end
end
if (acc==0) return
if (acc==1 and dice(1,p)>1) return
--printh('x'..x..' y'..y..' := '..(3-cell))
mset(x,y,3-cell)
end
function pickitempos()
local x,y
while true do
x=dice(2,14)
y=dice(2,14)
if mget(x,y)==1 then
x=mid(3,x,13)
y=mid(3,y,13)
mrect(x-1,y-1,x+1,y+1,1)
return {x,y}
end
end
end
ctrl=800
function random_walls(maze,gx,gy,walls)
local topx=flr(prng(9,seed_xlinks,gx,gy))+4
local topw=1
local botx=flr(prng(9,seed_xlinks,gx,gy+1))+4
local botw=1
local lefty=flr(prng(9,seed_ylinks,gx,gy))+4
local lefth=1
local righty=flr(prng(9,seed_ylinks,gx+1,gy))+4
local righth=1
local minx=min(topx-topw,botx-botw)
local maxx=max(topx+topw,botx+botw)
local miny=min(lefty-lefth,righty-righth)
local maxy=max(lefty+lefth,righty+righth)
minx=dice(2,minx)
maxx=dice(maxx,14)
miny=dice(2,miny)
maxy=dice(maxy,14)
local vert=((gx+gy)%2)==0
mrect(0,0,16,16,2)
mrect(18,0,18+17,17,1)
mrect(minx,miny,maxx,maxy,1)
prng(-1,seed_walls,gx,gy)
--for i=0,7 do
-- local x=flr(rnd(maxx-minx+1))+minx
-- local y=flr(rnd(maxy-miny+1))+miny
-- mset(x,y,2)
--end
if maze.has(gx,gy-1,1) then
mrect(topx-topw,0,topx+topw,miny,1)
if vert then
mrect(18+topx-topw-1,0,18+topx+topw+2,3,2)
mrect(18+topx-topw,4,18+topx+topw+1,4,2)
end
end
if maze.has(gx,gy,1) then
mrect(botx-botw,maxy,botx+botw,16,1)
if vert then
mrect(18+botx-botw-1,14,18+botx+botw+2,17,3)
mrect(18+botx-botw,13,18+botx+botw+1,13,3)
end
end
if maze.has(gx-1,gy,0) then
mrect(0,lefty-lefth,minx,lefty+lefth,1)
if not vert then
mrect(18,lefty-lefth-1,18+3,lefty+lefth+2,2)
mrect(18+4,lefty-lefth,18+4,lefty+lefth+1,2)
end
end
if maze.has(gx,gy,0) then
mrect(maxx,righty-righth,16,righty+righth,1)
if not vert then
mrect(18+14,righty-righth-1,18+17,righty+righth+2,3)
mrect(18+13,righty-righth,18+13,righty+righth+1,3)
end
end
if walls>0 then
for i=0,((walls==2) and 800 or 100) do
cavernify(dice(2,14),dice(2,14),(walls==2) and 32 or 1)
end
end
local itempos=pickitempos()
gix=itempos[1]
giy=itempos[2]
end
function bake_map()
local v,q,ex
for x=0,16 do
for y=0,16 do
v=mget(x,y)
if v==wall then
q,ex=ccodemap4(2,3,x+18,y)
q=bxor(0xf,q)
if ex==0 then
-- solid main wall
mset(x+36,y,pickv(wall_ex1,x,y))
else
mset(x+36,y,pickv(wall_ex1+q+16*(ex-1),x,y))
end
else
q,ex=ccodemap4(2,3,x+18,y)
q=bxor(0xf,q)
if ex==0 then
-- solid main floor
mset(x+36,y,pickv(floor_ex1,x,y))
else
mset(x+36,y,pickv(floor_ex1+q+16*(ex-1),x,y))
end
end
end
end
end
function draw_bg()
pal()
palt()
palt(0,false)
map(36,0,-4,-4,17,17)
draw_shadows()
end
function draw_fg()
pal()
palt()
palt(0,false)
palt(main_bordert,true)
map(54,0,0,0,16,16)
end
function _init()
mainpal=0
borderpal=0
selectedpal=0
selectedidx=0
oldclick=0
mousex=-8
mousey=-8
poke(0x5f2d,1)
end
function click(x,y)
if (x>=8 and x<40 and
y>=112 and y<128) then
selectedpal=flr((y-112)/8)
selectedidx=flr((x-8)/8)
elseif (x>=80 and x<112 and
y>=88 and y<120) then
local c=flr((x-80)/8)+
4*flr((y-88)/8)
local palidx
if selectedpal==0 then
palidx=mainpal
else
palidx=borderpal
end
sset(palidx,8+selectedidx,c)
end
end
function _update()
if (btnp(0,0) and mainpal>0) mainpal-=1
if (btnp(1,0) and mainpal<31) mainpal+=1
if (btnp(2,0) and borderpal>0) borderpal-=1
if (btnp(3,0) and borderpal<31) borderpal+=1
mousex=stat(32)
mousey=stat(33)
local newclick=stat(34)
if newclick==1 and oldclick==0 then
click(mousex,mousey)
end
oldclick=newclick
end
function _draw()
pal()
palt()
palt(0,false)
cls()
setpal(mainpal)
map(0,0)
setpal(borderpal)
palt(3,true)
map(16,0,-4,-4)
pal()
palt()
palt(0,false)
for i=0,3 do
rectfill(8+i*8,112,15+i*8,119,sget(mainpal,8+i))
rectfill(8+i*8,120,15+i*8,127,sget(borderpal,8+i))
end
print(mainpal,0,112,7,5)
print(borderpal,0,120,7,5)
rect(
7+selectedidx*8,
112+selectedpal*8,
16+selectedidx*8,
120+selectedpal*8,
7)
for i=0,15 do
local x,y=i%4,flr(i/4)
rectfill(80+8*x,88+8*y,87+8*x,95+8*y,i)
end
circ(mousex,mousey,3,7)
end
__gfx__
0000000088888880ccccccc0aaaaaaa0011110210111111100000000010000000000200100002001000201210002012111111111111100111111222200002222
00000000888ee880ccdddcc0a99999a0011110000222112200000010011000002001000102010010001201210012012100111111111100111111222200002222
0070070088eee880cddcddc0aaa99aa0011110110000000010000222222200000002000100100020011201120112011200111121111111111111222200002222
00077000888ee880ccccddc0aa9999a0022220220211201200010000000010100000102000020001012100120112101211111111101222211111222200002222
00077000888ee880cccddcc0aaaa99a0000000000000000001010000000011101200100020001000012100020121210211110011111222212222111122221111
00700700888ee880cdddddc0a9999aa0111101101101111001110100000222220100020001002000021102000121121012210011111222212222111122221111
0000000088888880ccccccc0aaaaaaa0222102202202122011110100010000000102010010000100021002100211110012211111111222212222111122221111
00000000000000000000000000000000000000000000000022222220222200001000100210201020020002110000001111111111111111112222111122221111
01001566d5d13144522fd85100000000111211111111111122222222222222220000000000000000000000000000000000000000000000000000000000000000
10112ddd6dc3b3999487ee8200000000112221111111111121111111111111210000000000000000000000000000000000000000000000000000000000000000
2105d6577c623bfad99fff4800000000122222111111111121222221222221210000000000000000000000000000000000000000000000000000000000000000
37777777777777777777777770000000222222211111211121211121211121210000000000000000000000000000000000000000000000000000000000000000
42244506770000000000000000000000111111111112221121222121212221210000000000000000000000000000000000000000000000000000000000000000
516514d56dd130000000000000000000111111111122222121111121211111210000000000000000000000000000000000000000000000000000000000000000
6579d706770000000000000000000000111111211222222222222221222222210000000000000000000000000000000000000000000000000000000000000000
7d7ab707770000000000000000000000111112221111111111111111111111110000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
3333333333322233333222233333333333333333332223333332223333333333333bd11111111111111db3331111111100000000111111113333333300000000
3333333333322233333222233333333333333333332223333332223333333333333bd11111111111111db3331111111100000000111111113333333300000000
3333333333000333333000333300333333333333333000333300033333333300333bd11111111111111db3331111111100000000111111113333333300000000
3333333322000333333000332200330022003333333000332200030033322200333bddddddddddddddddb3331111111100000000dddddddd3333333300000000
3333333322000333333322002200220022002233332233332202220033322200333bbbbbbbbbbbbbbbbbb3331111111100000000bbbbbbbb3333333300000000
33333333223333333333220022332200220022333322333322322200333222333333333333333333333333331111111100000000333333333333333300000000
33333333333333333333333333333333223300333300033333300333330003333333333333333333333333331111111100000000333333333333333300000000
33333333333333333333333333333333333300333300033333300333330003333333333333333333333333331111111100000000333333333333333300000000
3333333333022033330220333333333333333333330220333302203333333333333bd11111111111111db3331111111111111111333333333333333300000000
3333333333021103330110333303003033333333330110333301103033333333383bd18111111111111db3331111111111111111333333333333333300000000
3333333300012033330220000020210100030333333022030022200133303000338dd81111111111111db3331111111111111111333333333333333300000000
3333333321211033333011212121212121201033330111032121112133020121bbd88ddd111ddddd111db333111dddddddddd111bbbbb333333bbbbb00000000
3333333321201033330112212121002121211033333022032121112133022121ddd88dbb111dbbbb111db333111dbbbbbbbbd111ddddb333333bdddd00000000
3333333300030333333002000000330000012203330110330001110033012000118dd833111db333111db333111db333333bd111111db333333bd11100000000
3333333333333333333330333333333333022033330220333302203330221033181db383111db333111db333111db333333bd111111db333333bd11100000000
3333333333333333333333333333333333011033301110333011103333011033111db333111db333111db333111db333333bd111111db333333bd11100000000
3333333333211033332110333333333333333333332110333321103333333333333bd11111111111111db333111db333333bd111111db333333bd11100000000
3333333333110033331100333333333333333333331100333321103333333333333bd11111111111111db333111db333333bd111111db333333bd11100000000
3333333321211033332111122122221221222133332110332222212233222212333bd11111111111111db333111db333333bd111111db333333bd11100000000
3333333311111033332111111111111111111033332110331121101133211111bbbbd11111111111111dbbbbddddb333333bdddd111db333333bd11100000000
3333333310111033332111011011110110111033332110331121101133211101ddddd11111111111111dddddbbbbb333333bbbbb111db333333bd11100000000
33333333000000333310000000000000001110333321103300100000332110001111111111111111111111113333333333333333111db333333bd11100000000
33333333333333333333333333333333331100333311003333211033331100331111111111111111111111113333333333333333111db333333bd11100000000
33333333333333333333333333333333332110333321103333211033332110331111111111111111111111113333333333333333111db333333bd11100000000
00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff
00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff
00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff
00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff00000000ffff00000000ffffffffffff
00000000000000000000000000000000ffff0000ffff0000ffff0000ffff00000000ffff0000ffff0000ffff0000ffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000ffff0000ffff0000ffff0000ffff00000000ffff0000ffff0000ffff0000ffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000ffff0000ffff0000ffff0000ffff00000000ffff0000ffff0000ffff0000ffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000ffff0000ffff0000ffff0000ffff00000000ffff0000ffff0000ffff0000ffffffffffffffffffffffffffffffffffff
00000000ffff0000000fffffffffffff00000000ffff00000000ffffffffffff00000000ffff0000000fffffffffffff00000000ffff000000000fffffffffff
00000000fff000000000ffffffffffff00000000fff000000000ffffffffffff00000000ffff0000000fffffffffffff00000000ffff000000000fffffffffff
00000000ff00000000000fffffffffff00000000fff000000000ffffffffffff00000000ffff0000000fffffffffffff00000000ffff000000000fffffffffff
00000000f0000000000000fff000fffff0000000fff000000000fffffffff00000000000ffff00000000fffffffffffffff00000fffff0000000ffffffffffff
00000000000000000000000f00000fffff000000ffff0000ffff0000ffff00000000000f0000ffff00000fff000fffffffff000fffffffff000fffffffffffff
00000000000000000000000000000000fff00000fffff000ffff0000fff00000000000ff0000ffff00000fff0000ffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000ffff0000fffff000ffff0000fff0000000000fff0000ffff00000fff0000ffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000fffff000fffff000ffff0000fff000000000ffff0000ffff0000ffff0000ffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008888880
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008888880
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008888880
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008888880
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008888880
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008888880
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__gff__
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__map__
0504050706070908091415140000000000000055000045000065000045000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000