100 '"bg map editer2.2" 110 bged: 120 cls 3:screen 0,0,0,0 130 fs=size(4) 140 if d0flg=0 then 150 dim fn$(1000),lm$(4) 160 dim garea(80),bdata(1026),undo(1026) 170 d0flg=1 180 endif 190 priority"TGSB" 200 if size(0)>size(1) then sz=size(0):dr=1 else sz=size(1):dr=0 210 if sz>800 then wd=512:rd=1:font 32 else wd=256:rd=0.86:font 16 220 emx=0:emy=0:x2=0:y2=0 230 wx1=0:wy1=96: '"w1" 240 wx2=0:wy2=0: '"w2" 250 bx=0:by=0: 'bgbufview 260 px1=0:py1=0: '"pos1" 270 px2=0:py2=0:px3=0:py3=0: '"pos2" 280 ud0=0:ud1=0:ud2=0:ud3=0:ud4=0:ud5=0 290 ipx=0:ipy=0:bgfile$="":loopf=0:mv=0:syp=0:sfp=0 300 h64=((32+(sz-800)/16)\8)*8:h64=min(128,h64):h63=h64-1: 'S_Bar size 310 fn$(0)=" Single size":fn$(1)=" Double size" 320 fn$(2)=" Single size (32)":fn$(3)=" Double size (32)":fn$(4)="" 330 s=ui_select("fn$","Slelect size") 340 lm$(0)="Free draw":lm$(1)="X line":lm$(2)="Y line" 350 sz=s mod 2+1:x32=s\2+1 360 pt=0:rv=0:rv2=0:h=sz*2 370 bsx=3-sz:bsy=3-sz:bs=2-sz:cpf=0 380 if x32>1 then bsx=1:bsy=1 390 if dr=1 then wx2=wd+224:wy2=wy1 else wx2=0:wy2=wd+316:'view pos 400 scx=4:scy=4:bxm=0:bym=((size(1)-288)\32)*32 410 ms$="":lmode=0:pmode=0 420 cls:init"kb:0" 430 if size(0)>848 and dr=0 then bxm=((size(0)-720)\16-8)*16 440 if size(1)>800 then bym=((size(1)-1024)\16-16)*16:bym=max(bym,248) else bym==((size(1)-496)\16)*16:wy1=0:h64=32:h63=31 450 if dr=1 then bym=((size(1)-496)\16)*16 460 c=pr(0):c=pr(1):c=pr(2) 470 if garea(0)=0 then callf=init1() 480 bg_scale scx,scy 490 bg_view wx1+h64,wy1+h64,(wd+bxm)\sz,wd\sz,sz,,(x32-1)*2 500 bg_gdset -1,-1 510 c=pr(13) 520 for i=0 to 255:sp_on i,0:next 530 sp_on 1,1 540 sp_put 1,(wx2/sz,wy2\sz-96\sz-((wy1=0)*96))\sz,1 550 on error goto lb_err: 560 on stop gosub lb_stop: :stop on 570 callf=framev():screen 1,1,1,1 580 callf=main() 590 lb_err: 600 ui_msg"save bg_backup.dat":bg_save "bg_backup.dat" 610 lb_stop: 620 stop off:on error goto 0 630 callf=menuf(13) 640 end 650 ' 660 func main() 670 loopf=1 680 while loopf 690 if tch>0 and touch(0)=0 and wx1+63+wd0 then tch=1:tp=1 720 smx=emx:smy=emy 730 emx=touch(4):emy=touch(5):h=16*sz 740 'touch & move 750 if tch>0 then 760 ar=areaget(emx,emy) 770 select case ar 780 case 0: 'put 790 if pmode=1 then 800 pmode=0: ud0=(emx-32)\sz: ud1=(emy-48)\sz 810 c=bgpaint((ud0+bg_map(0))\16,(ud1+bg_map(1))\16,bdata(0)+rv2):break 820 endif 830 if lmode=1 and touch(2)>0 then emy=smy 840 if lmode=2 and touch(1)>0 then emx=smx 850 x2=(emx-h64)\sz:y2=(emy-h64*1.5)\sz:j=0 860 if bs=1 then x2=(x2\16\2)*2*16:y2=(y2\16\2)*2*16 870 if ud0=x2 and ud1=y2 then ud4=1 else ud4=0 880 ud0=x2:ud1=y2:ud2=bsx:ud3=bsy:ud5=1:'undo data 890 if ud4=0 then 900 for yy=0 to bsy-1 910 for xx=0 to bsx-1 920 '"p0=px3+xx+(py3+yy)*256" 930 if j<1024 then 940 undo(j)=bg_get(x2+xx*16,y2+yy*16,0) 950 bg_put x2+xx*16,y2+yy*16,bdata(j)+rv2:j+=1 960 endif 970 next 980 next 990 line(garea(0)+px1*h,garea(1)+py1*h)-(garea(0)+(px1+bsx)*h-1,garea(1)+(py1+bsy)*h-1),0,b 1000 px1=x2\16: py1=y2\16:c=pr(0) 1010 line(garea(0)+px1*h,garea(1)+py1*h)-(garea(0)+(px1+bsx)*h-1,garea(1)+(py1+bsy)*h-1),col(14),b 1020 endif 1030 case 1: c=maproll(-1,0,0) :'L BG 1040 case 2: c=maproll(1,0,0) :'R 1050 case 3: c=maproll(0,-1,0) :'U 1060 case 4: c=maproll(0,1,0) :'D 1070 '"case 15: if tp>0 and dr=0 then inpf=-inpf+1:init"kb:"+str$(inpf*3):bmode=0" 1080 end select 1090 endif 1100 'one touch 1110 if tp>0 then 1120 select case ar 1130 case 5: 1140 select case cpf 1150 case 0 :'sel 1160 px2=((emx-h64-wx2)\h\(1+bs))*(1+bs):py2=((emy-h64-wy2)\h\(1+bs))*(1+bs) 1170 px3=px2+bx:py3=py2+by 1180 pt=px3+(py3)*256 1190 line(x1,y1)-(x1+bsx*h-1,y1+bsy*h-1),0,b 1200 if ldf=1 then c=pr(4):ldf=0 1210 x1=garea(20)+px2*h:y1=garea(21)+py2*h 1220 line(x1,y1)-(x1+bsx*h-1,y1+bsy*h-1),col(14),b 1230 c=pr(9):c=framev() 1240 case 1: 'paste 1250 ui_msg"Paste":gsave"BGgb_undo02.png",1 1260 xx=(emx-h64-wx2)\h+bx:yy=(emy-h64-wy2)\h+by 1270 put@(xx*16,yy*16),bsx*16,bsy*16,(px3*16,py3*16),,,4 1280 cpf=0:ud5=2:ms$=" ":c=pr(8) 1290 case 2: 'start pos 1300 px2=(emx-h64-wx2)\h:py2=(emy-h64-wy2)\h:c=pr(6) 1310 case 3: 'end pos 1320 x2=(emx-h64-wx2)\h+bx:y2=(emy-h64-wy2)\h+by:c=pr(7) 1330 end select 1340 case 6: c=pr(4):c=maproll(-1,0,1) :'L GB 1350 case 7: c=pr(4):c=maproll(1,0,1) :'R 1360 case 8: c=pr(4):c=maproll(0,-1,1) :'U 1370 case 9: c=pr(4):c=maproll(0,1,1) :'D 1380 case 10: 'load 1390 fn$(0)="Buffer Load":fn$(1)="Material Load":fn$(2)="BGMap Load" 1400 fn$(3)="BGMap Save":fn$(4)="Buffer Save":fn$(5)="BGMap clear":fn$(6)="Buffer clear":fn$(7)="End":fn$(8)="" 1410 s=ui_select("fn$","File") 1420 if s=7 then callf=menuf(13):endfunc 1430 if s>=0 then callf=menuf(s) 1440 case 11: 'func 1450 fn$(0)="Copy from Map":fn$(1)="Replace":fn$(2)=lm$(lmode):fn$(3)="Paint":fn$(4)="Align32" 1460 fn$(5)="Help":fn$(6)="":s=ui_select("fn$","Func") 1470 if s>=0 then callf=menuf(s+7) 1480 case 12: rv=(rv+1) mod 4:rv2=(rv mod 2)*128-32768*(rv\2):bsx=1:bsy=1:bs=0:c=pr(11) 'rev 1490 case 13: '"16-32" 1500 if bsx<>1 then bsx=1:bsy=1:bs=0 else bsx=2:bsy=2:bs=1 1510 c=pr(11) 1520 case 14: 'range 1530 if cpf=0 then 1540 line(garea(0)+px1*h,garea(1)+py1*h)-(garea(0)+(px1+bsx)*h-1,garea(1)+(py1+bsy)*h-1),0,b 1550 line(x1,y1)-(x1+bsx*h-1,y1+bsy*h-1),0,b 1560 line(garea(56)+1,garea(57)+1)-(garea(58)-1,garea(59)-1),0,bf 1570 symbol(garea(56)+6,syp)," SEL",sfp,rgb(100,200,200) 1580 cpf=2:c=pr(4):c=pr(5):ms$="!Select Start pos":c=pr(8) 1590 break 1600 endif 1610 if cpf=2 then px2=0:py2=0:c=pr(6):break:'start pos 1620 if cpf=3 then x2=bx:y2=by:c=pr(7):'end pos 1630 case 15: cpf=1:ms$="!Touch Paste point":c=pr(8): 'paste 1640 case 16: 'undo 1650 if ud5=1 then 1660 j=0 1670 for yy=0 to ud3-1: for xx=0 to ud2-1 1680 if j<1024 then bg_put ud0+xx*16,ud1+yy*16,undo(j):j+=1 1690 next: next 1700 endif 1710 if ud5=2 then 1720 if dir$("BGgb_undo02.png")<>"" then gload"BGgb_undo02.png",1 1730 endif 1740 if ud5=-1 and dir$("BGmp_undo02.dat")<>"" then 1750 fx=bg_map(0)\256:fy=bg_map(1)\256 1760 bg_load"BGmp_undo02.dat":bg_scene fx,fy:c=pr(0) 1770 endif 1780 if ud5<>0 then ui_msg"undo.":ud5=0 1790 end select 1800 c=pr(1) 1810 endif 1820 vsync 1 1830 wend 1840 endfunc 1850 ' 1860 func menuf(nm) 1870 select case nm 1880 case 0: 'buffer load 1890 gbfn$=fnget$(" .png ") 1900 if gbfn$<>"" then 1910 gload gbfn$,1,(px3*16,py3*16):c=pr(13) 1920 bg_scene 0,0:c=pr(0) 1930 endif 1940 case 1: 'material 1950 screen 0,1,0,0: ui_msg "Select Material" 1960 cls 2: gload "mt90_sys.png": '"500x640 100 114" 1970 put@(0,0),size(0),size(1),(0,0),500,640,2 1980 tap: n=touch(4)\(size(0)/5)+(touch(5)\(114*size(1)/640))*5+36 1990 if n<41 then n=n-5 2000 if (n>=31 and n<=33) or (n>=41 and n<=65) then 2010 gload "mt"+right$("0"+str$(n),2)+"_sys.png",1,(px3*16,py3*16): 2020 c=pr(13) 2030 bg_scene 0,0:c=pr(0) 2040 endif 2050 cls 2: c=framev(): screen 1,1,1,1 2060 while touch(0)>0: pause 200 : wend 2070 case 2: 'bload 2080 bgfile$=fnget$(" .dat .map .bg .bin ") 2090 if bgfile$<>"" then 2100 c=pr(3):bg_scale scx,scy 2110 bg_load bgfile$:bg_scene 0,0:init"kb:0":c=pr(0):c=pr(2) 2120 endif 2130 case 3: 'bsave 2140 bgfile$=ui_input$("BG Map Save",bgfile$):cls 2150 if bgfile$<>"" then ui_msg bgfile$:bg_save bgfile$ else print "Err" 2160 case 4: 'gsave 2170 gbfn$=ui_input$("G buffer save",gbfn$) 2180 if right$(gbfn$,4)<>".png" then gbfn$=gbfn$+".png" 2190 if gbfn$<>".png" then ui_msg"Save "+gbfn$:gsave gbfn$,1 2200 case 5: 'clear 2210 c=pr(3):c=pr(0):c=pr(2):bg_scale scx,scy 2220 bg_fill 0,0,0,scx*16-1,scy*16-1:bg_scene 0,0:c=pr(0) 2230 case 6: ui_msg"Clear":cls 4:bg_scene 0,0: 'Buffer clear 2240 case 7: 'Copy from Map 2250 c=pr(10):c=pr(0):c=pr(2) 2260 bsx=ipx+1:bsy=ipy+1 2270 for y=0 to ipy 2280 for x=0 to ipx 2290 bdata(x+y*bsx)=bg_get(x*16,y*16,0) 2300 next 2310 next 2320 case 8: c=replace(): 'replace 2330 case 9: 'XY line 2340 lmode=(lmode+1) mod 3 2350 ui_msg(lm$(lmode)) 2360 case 10: pmode=1:ui_msg"Touch paint point": 'paint 2370 case 11: '"align32" 2380 ms$="Align32":c=pr(12) 2390 fx=bg_map(0)\256:fy=bg_map(1)\256 2400 for y=0 to scy*16-1 step 2:for x=0 to scx*16-1 step 2 2410 d=bg_get(x,y,1):x0=d mod 256 mod 2:y0=d\256 mod 2 2420 if x0=0 and y0=0 and d<>0 then bg_fill d+1,x+1,y:bg_fill d+256,x,y+1:bg_fill d+257,x+1,y+1 2430 next:next 2440 bg_scene fx,fy:c=pr(0) 2450 case 12: 'help 2460 if ex_info$(1)="JP" then f$="bgedmanj.txt" else f$="bgedman.txt" 2470 if dir$("sample/"+f$)<>"" then f$="sample/"+f$ 2480 if dir$(f$)<>"" then ui_text f$ 2490 case 13: 'end 2500 if dir$("BGgb_undo02.png")<>"" then kill"BGgb_undo02.png" 2510 if dir$("BGmp_undo02.dat")<>"" then kill"BGmp_undo02.dat" 2520 font fs:init"kb:2":cls 3:screen ,,0,0:loopf=0:'end 2530 end select 2540 endfunc 2550 ' 2560 func replace() 2570 c=pr(10):c=pr(0):c=pr(2):ms$="Replace":c=pr(12) 2580 fx=bg_map(0)\256:fy=bg_map(1)\256 2590 'paste data get 2600 for y=0 to ipy: for x=0 to ipx 2610 undo(x+y*(ipx+1))=bg_get(x*16,y*16,0) 2620 next: next 2630 '"1chip cp" 2640 for y=0 to scy*16-1: for x=0 to scx*16-1 2650 if bg_get(x,y,1)=bdata(0) then 2660 f=0: 'all cp 2670 for y2=0 to bsy-1: for x2=0 to bsx-1 2680 if bg_get(x+x2,y+y2,1)<>bdata(x2+y2*bsx) then f=1:break 2690 next: next 2700 if f=0 then 2710 'write 2720 for y2=0 to ipy: for x2=0 to ipx 2730 bg_fill undo(x2+y2*(ipx+1)),x+x2,y+y2 2740 next: next 2750 endif 2760 endif 2770 next: next 2780 bg_scene fx,fy:c=pr(0) 2790 endfunc 2800 ' 2810 func areaget(posx,posy) 2820 while garea(counta)+garea(counta+2)>0 2830 f=garea(counta)<=posx and garea(counta+2)>=posx and garea(counta+1)<=posy and garea(counta+3)>=posy 2840 if f then break 2850 counta=counta+4 2860 wend 2870 if garea(counta)+garea(counta+2)=0 then counta=-1 else counta=counta\4 2880 endfunc counta 2890 ' 2900 func framev() 2910 cl=rgb(100,200,200) 2920 for i=0 to 64 step 4 2930 if i=0 or i=20 then continue 2940 line(garea(i),garea(i+1))-(garea(i+2),garea(i+3)),cl,b 2950 next 2960 '"GLOAD MT BLOAD BSAVE GSAVE CLEAR REV 16-32 FIX-VARY COPY" 2965 if size(1)>800 then sfp=32+h64\32 else sfp=12 2980 symbol(garea(40)+6,syp),"FILE",sfp,cl 2990 symbol(garea(44)+6,syp),"FUNC",sfp,cl 3000 symbol(garea(48)+6,syp),"REV",sfp,cl 3010 symbol(garea(52)+6,syp),str$(bsx*16),sfp,cl: '"32" 3020 symbol(garea(56)+4,syp),"RANGE",sfp,cl: 'VARY 3030 symbol(garea(60)+6,syp),"PASTE",sfp,cl 3040 symbol(garea(64)+6,syp),"UNDO",sfp,cl 3050 for i=0 to (wd+bxm)\sz\16-1 3060 symbol(wx1+h64+i*sz*16,wy1+10),str$(i),12,rgb(100,200,200) 3070 next 3080 for i=0 to wd\sz\16-1 3090 symbol(wx1+8,wy1+h64+i*sz*16),str$(i),12,rgb(100,200,200) 3100 next 3110 endfunc 3120 ' 3130 func fnget$(ext$) 3140 f$=dir$(curdir$(),0):j=0 3150 if ext$="" or instr(ext$,lcase$(right$(f$,4)))>0 then fn$(j)=f$:j=j+1 3160 for i=1 to 999 3170 f$=dir$() 3180 if f$="" then fn$(j)="":break 3190 if ext$="" or instr(ext$,lcase$(right$(f$,4)))>0 then fn$(j)=f$:j=j+1 3200 next 3210 fn$(j)="":s=ui_select("fn$","File") 3220 if s<0 then f$="" else f$=fn$(s) 3230 endfunc f$ 3240 ' 3250 func pr(n) 3260 select case n 3270 case 0: 3280 locate 0,0:print "Scroll(";str$(bg_map(0)\16);",";str$(bg_map(1)\16);") "; 3290 print " Pos(";str$(px1+bg_map(0)\16);",";str$(py1+bg_map(1)\16);") " 3300 case 1: 3310 if rv mod 2=0 then r$="_" else r$="x" 3320 if rv\2=0 then r$=r$+"_) " else r$=r$+"y) " 3330 locate 0,1:print "Ptn(";str$(px3);",";str$(py3);") Num=";str$(pt);" " 3340 locate 11,2:print " Reverse(";r$ 3350 case 2: 3360 locate 0,2:print "Scale(";str$(scx);",";str$(scy);") " 3370 case 3: 3380 init"kb:2":locate 0,3:print "Input Scale size.(x*y<=256)" 3390 repeat 3400 input "ScaleX";scx:input "ScaleY";scy 3410 until scx*scy>0 and scx*scy<=256 3420 cls:init"kb:0" 3430 case 4: '"line del2" 3440 line(garea(20)+1,garea(21)+1)-(garea(22)-1,garea(23)-1),0,bf 3450 case 5: '"line del1" 3460 line(garea(0)+1,garea(1)+1)-(garea(2)-1,garea(3)-1),0,bf 3470 case 6: 'start pos 3480 px3=px2+bx:py3=py2+by 3490 pt=px3+(py3)*256:bsx=0:bsy=0 3500 x1=garea(20)+px2*h:y1=garea(21)+py2*h 3510 line(x1,y1)-(x1+1*h-1,y1+1*h-1),col(14),b 3520 cpf=3:ms$="!Select 2nd pos ":c=pr(8) 3530 case 7: 'end pos 3540 bsx=x2-px3+1:bsy=y2-py3+1:bs=0 3550 if bsx<=0 then bsx=px3-x2+1:px3=x2 3560 if bsy<=0 then bsy=py3-y2+1:py3=y2 3570 x2=(x2-bx)*h+garea(20):y2=(y2-by)*h+garea(21) 3580 line(x2,y2)-(x2+1*h-1,y2+1*h-1),col(14),b 3590 line(garea(56)+1,garea(57)+1)-(garea(58)-1,garea(59)-1),0,bf 3600 symbol(garea(56)+4,syp),"RANGE",sfp,rgb(100,200,200) 3610 cpf=0:ldf=1:ms$=" ":c=pr(8):ui_msg"Selected":c=pr(9) 3620 case 8: 'mess 3630 color rgb(255,191,191) 3640 locate 0,4:print ms$ 3650 color col(15) 3660 case 9: 'bdata 3670 for y=0 to bsy-1 3680 for x=0 to bsx-1 3690 bdata(x+y*bsx)=px3+x+(py3+y)*256 3700 next 3710 next 3720 case 10: 3730 init"kb:2":locate 0,4:print "Input range pos from BG-map grid." 3740 repeat 3750 input "X";ipx:input "Y";ipy 3760 until ipx<=256 and ipy<=256 3770 cls:init"kb:0" 3780 case 11: '"re16-" 3790 cls 2:c=framev() 3800 c=pr(4):c=pr(5):i=52: line(garea(i)+1,garea(i+1)+1)-(garea(i+2)-1,garea(i+3)-1),0,bf 3810 symbol(garea(52)+6,syp),str$(bsx*16),sfp,rgb(100,200,200) 3820 case 12: 'undo bg_save 3830 ud5=-1:ui_msg ms$:bg_save"BGmp_undo02.dat" 3840 fx=bg_map(0)\256:fy=bg_map(1)\256 3850 case 13: 3860 sp_def 1,(bx*16*x32,by*16*x32),(wd+bxm)*x32\sz,wd*x32\sz\4+bym*x32\sz 3870 end select 3880 endfunc 3890 ' 3900 func bgpaint(x0,y0,d) 3910 ms$="Paint":c=pr(12):cls 2 3920 fx=bg_map(0)\256:fy=bg_map(1)\256 3930 for y=0 to scy*16-1:for x=0 to scx*16-1 3940 pixel bg_get(x,y,1)+rgb(0,0,1),x,y 3950 next:next 3960 setbitmap 3970 line(-1,-1)-(scx*16,scy*16),-2147483646,b 3980 paint(x0,y0),d+rgb(0,0,1) 3990 getbitmap 4000 for y=0 to scy*16-1:for x=0 to scx*16-1 4010 bg_fill pixc(x,y)-rgb(0,0,1),x,y 4020 next:next 4030 cls 2:c=framev() 4040 bg_scene fx,fy:c=pr(0) 4050 endfunc 4060 ' 4070 func maproll(x0,y0,m) 4080 if m=0 then 4090 select case x0+1+(y0+2)*10 4100 case 20: for i=0 to 1:bg_roll -8*(bs+1),0:vsync:next:'L BG 4110 case 22: for i=0 to 1:bg_roll 8*(bs+1),0:vsync:next:'R 4120 case 11: for i=0 to 1:bg_roll 0,-8*(bs+1):vsync:next:'U 4130 case 31: for i=0 to 1:bg_roll 0,8*(bs+1):vsync:next:'D 4140 end select 4150 else 4160 select case x0+1+(y0+2)*10 4170 case 20: c=pr(4):if bx>0 then bx-=1:c=pr(13):pt-=1 :'L GB 4180 case 22: c=pr(4):bx+=1:c=pr(13):pt+=1 :'R 4190 case 11: c=pr(4):if by>0 then by-=1:c=pr(13):pt-=256 :'U 4200 case 31: c=pr(4):by+=1:c=pr(13):pt+=256 :'D 4210 end select 4220 endif 4230 c=pr(0) 4240 endfunc 4250 ' 4260 func flickscr() 4270 flx=touch(1):fly=touch(2) 4280 if abs(flx)>abs(fly) then mv=flx:fx=-sgn(flx):fy=0 else mv=fly:fx=0:fy=-sgn(fly) 4290 mv=abs(mv\32) 4300 if emy800))*rd 4440 garea(i*4+41)=wy4 4450 garea(i*4+42)=(i*sbs3-32*(size(1)>800)+sbs1)*rd 4460 garea(i*4+43)=wy3 4470 next 4475 if size(1)>800 then syp=(garea(41)+garea(43))\2-(32+h64\32)\2-2 else syp=wy4+2 4480 restore lb_data1: 4490 for i=0 to 39 4500 read a$ 4510 garea(i)=exec(a$) 4520 next :'touch area 4530 lb_data1: 4540 data wx1+h64,wy1+h64,wx1+h63+wd+bxm,wy1+h63+wd :'A 4550 data wx1,wy1+h64,wx1+h63,wy1+h63+wd :'L 4560 data wx1+h64+wd+bxm,wy1+h64,wx1+h64*2+wd+bxm,wy1+h63+wd :'R 4570 data wx1+h64,wy1,wx1+h63+wd+bxm,wy1+h63 :'U 4580 data wx1+h64,wy1+h64+wd,wx1+h63+wd+bxm,wy1+h64*2+wd :'D 4590 data wx2+h64,wy2+h64,wx2+h63+wd+bxm,wy2+h63+wd/4+bym :'B 4600 data wx2,wy2+h64,wx2+h63,wy2+h63+wd/4+bym :'L 4610 data wx2+h64+wd+bxm,wy2+h64,wx2+h64*2+wd+bxm,wy2+h63+wd/4+bym :'R 4620 data wx2+h64,wy2,wx2+h63+wd+bxm,wy2+h63 :'U 4630 data wx2+h64,wy2+h64+wd/4+bym,wx2+h63+wd+bxm,wy2+h64*2+wd/4+bym :'D 4640 endfunc 4650 '