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
|
-
|
-
-
|
|
|
|
|
|
|
|
!
!
-
-
|
|
|
|
|
|
-
|
|
|
!
|
-
-
|
|
|
|
|
|
-
|
|
|
|
|
|
|
!
|
!
|
|
|
|
!
!
|
!
-
|
-
|
|
|
!
-
|
-
|
|
|
|
-
|
|
!
!
|
-
-
|
|
|
|
|
|
-
|
|
|
|
|
|
|
!
|
!
-
|
|
|
|
|
!
|
|
!
-
|
|
|
!
!
-
-
|
|
|
|
|
|
|
|
|
|
!
|
!
-
-
|
|
|
|
|
!
!
-
-
|
|
|
|
|
|
|
|
|
!
!
-
|
|
!
-
|
|
|
|
|
-
|
-
|
|
|
!
|
|
|
!
-
|
|
|
!
-
|
|
|
-
|
-
|
|
|
!
|
|
|
|
|
|
!
-
|
|
|
|
|
!
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
-
|
|
|
|
|
!
-
|
|
|
|
|
|
|
|
|
|
|
|
|
!
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
-
|
|
|
|
|
!
-
|
|
-
|
|
|
|
|
!
!
-
|
|
|
!
-
|
|
|
|
!
-
|
|
|
|
!
-
-
|
|
|
!
|
!
-
|
|
|
!
-
|
|
|
|
!
-
|
|
|
|
!
| #include"t_mod.txt"
#define zwx 240
#define zwy 240
#define zw zwx*zwy*3
#define pwx 24
#define pwy 24
#define pw pwx*pwy*3
wx=480:wy=360
w3=wx*wy*3
screen 0,wx,wy:gsel 0,1:ginfo 2
title"BS_draw"
mref vram,66
sdim bram,w3
memcpy bram,vram,w3
x=0:y=0:bx=0:by=0
dim r,9:dim g,9:dim b,9:dim a,9:dim p,9
r=1:g=1:b=1:a=256:p=1
r.1=1:g.1=1:b.1=1:a.1=256:p.1=1
repeat 7,2
r.cnt=255:g.cnt=255:b.cnt=255:a.cnt=256:p.cnt=1
loop
sdim buf,128000
screen 3,128,128,4,prmx+wx+5,prmy
title"New data"
gosub *pal_draw
buffer 5,wx,wy
color:boxf:mref vram5,66
buffer 2,pwx,pwy mref vram2,66 sdim bram2,PW sdim cram2,PW sdim dram2,PW gosub *change
screen 4,zwx,zwy,6,prmx,prmy:gsel 0:gmode 4,p,p,a
*main
await 1,10
stick click,768,1
if click==256{
ginfo 1
if prmx : else{
if z{
tmp=zwx>>z>>1
px=mousex-tmp:py=mousey-tmp
tmp=zwx>>z
if px<0:px=0
if winx-tmp<px:px=winx-tmp
if py<0:py=0
if winy-tmp<py:py=winy-tmp
gsel 4:gzoom zwx,zwy,0,px,py,tmp,tmp:gsel 0
}else gosub *paint
}
if prmx-3:else{
if mousex<128{
tmp=mousey>>4
if tmp==0:if mousex<86:r=mousex*3 : else:if mousex<94:r=255:else:if r-255:r++:wait 15
if tmp==1:if mousex<86:g=mousex*3 : else:if mousex<94:g=255:else:if g-255:g++:wait 15
if tmp==2:if mousex<86:b=mousex*3 : else:if mousex<94:b=255:else:if b-255:b++:wait 15
if tmp==3:if mousex<86:a=mousex*3+1:else:if mousex<94:a=256:else:if a-256:a++:wait 15
if tmp==4{
if mousex<86:p=mousex+1:else:if p-256:p++:wait 15
if pwy-2<p:p=pwy-2
tp=p>>1
}
if tmp==5:gosub *click_wait:pt++:if 4<pt:pt=0:tmp=5
if tmp==6{
if 112<mousex{
wpoke buf,n ,4
wpoke buf,n+2,0
n+4:bn=n
gosub *click_wait
gsel 5:color:boxf:gsel 0
m=0
}else{
wpoke buf,n ,b<<8+4
wpoke buf,n+2,r<<8+g
n+4:bn=n
gosub *click_wait
rgb=r<<8+g<<8+b
gosub *masking
m=1
}
tmp=6
}
if tmp==7:tmp=mousex>>4+1:r.tmp=r:g.tmp=g:b.tmp=b:a.tmp=a:p.tmp=p
gosub *pal_draw
gosub *change
}
}
if prmx-4:else gosub *paint
}
if click==512{
ginfo 1
if prmx : else{
pget mousex,mousey:r=rval:g=gval:b=bval
gosub *pal_draw
gosub *change
}
if prmx-3:else{
tmp=mousey>>4
if mousex>=94{
if tmp==0:if r-0:r--:wait 15
if tmp==1:if g-0:g--:wait 15
if tmp==2:if b-0:b--:wait 15
if tmp==3:if a-1:a--:wait 15
if tmp==4:if p-1:p--:wait 15{
if pwy-2<p:p=pwy-2
tp=p>>1
}
}
if tmp==5:gosub *click_wait:tmp=5:if pt-0:pt--
if tmp==6{
if 112<mousex{
wpoke buf,n ,7
wpoke buf,n+2,0:n+4
bn=n
gosub *click_wait
gsel 5:color:boxf:gsel 0
m=0
}else{
rgb=r<<8+g<<8+b
if rgb:wpoke buf,n,b<<8+7:else wpoke buf,n,b<<8+4
wpoke buf,n+2,r<<8+g:n+4
bn=n
gosub *click_wait
gosub *rMasking
m=1
}
tmp=6
}
if tmp==7{
tmp=mousex>>4+1
r=r.tmp:g=g.tmp:b=b.tmp:a=a.tmp
if p-p.tmp:p=p.tmp:tp=p>>1
gosub *click_wait
tmp=7
}
gosub *pal_draw
gosub *change
}
if prmx-4:else{
pget mousex>>z+px,mousey>>z+py:r=rval:g=gval:b=bval
gosub *pal_draw
gosub *change
}
}
if click==16{
if z:gsel 4,-1:z=0:else{
gsel 0:z++
tmp=zwx>>z>>1
px=mousex-tmp:py=mousey-tmp
tmp=zwx>>z
if px<0:px=0
if winx-tmp<px:px=winx-tmp
if py<0:py=0
if winy-tmp<py:py=winy-tmp
gsel 4,2
gzoom zwx,zwy,0,px,py,tmp,tmp
}
gsel 0
}
if click==2{
if z:if z-4{
z++:tmp=zwx>>z>>1:px+tmp:py+tmp
gsel 4
tmp=zwx>>z
gzoom zwx,zwy,0,px,py,tmp,tmp
gsel 0
}
}
if click==8{
if 1<z{
tmp=zwx>>z>>1:px-tmp:py-tmp
z--:tmp=zwx>>z
if px<0:px=0
if winx-tmp<px:px=winx-tmp
if py<0:py=0
if winy-tmp<py:py=winy-tmp
gsel 4
gzoom zwx,zwy,0,px,py,tmp,tmp
gsel 0
}
}
if click==32:gosub *save
if click==4:gosub *draw
if click==128:gosub *load
if click==1024:gosub *undo
goto *main
*click_wait
repeat
wait 1
stick click,768
if click:else:break
loop
return
*pal_draw
gsel 3:redraw 0
color:boxf
color 255,0,0
boxf 0,2 ,r/3,14
color 0,255,0
boxf 0,18,g/3,30
color 0,0,255
boxf 0,34,b/3,46
color 99,0,99
boxf 0,50,a/3,62
color 255,255,255
boxf 0,66,p,78
boxf 94,80,117,95
color r,g,b
boxf 95,81,116,94
color 255,255,255
pos 94,0 :mes r
pos 94,16:mes g
pos 94,32:mes b
pos 94,48:mes a
pos 94,64:mes p
color 96,96,96
pos 0,80:mes"点線塗写消"
color 255,255,255
pos 0,80
if pt : else:mes"点"
if pt-1:else:mes" 線"
if pt-2:else:mes" 塗"
if pt-3:else:mes" 写"
if pt-4:else:mes" 消"
tmp="マスク "
if m:tmp+"有":else:tmp+"無"
pos 0,96:mes tmp
repeat 8,1
color r.cnt,g.cnt,b.cnt
boxf cnt-1<<4+1,113,cnt<<4-1,126
loop
redraw 1:gsel 0
return
*Masking
title"Mask making "+rgb:k=0
repeat wx*wy
memcpy vrgb,vram,3,,k
if rgb=vrgb:memcpy vram5,vrgb,3,k
k+3:await
loop
title""+n
return
*rMasking
title"rMask making "+rgb:k=0
repeat wx*wy
memcpy vrgb,vram,3,,k
if rgb-vrgb:memcpy vram5,vrgb,3,k
k+3:await
loop
title""+n
return
*undo
if n-bn:else return
memset buf,0,n-bn,bn
n=bn:bx=bbx:by=bby
memcpy vram,bram,w3
redraw 1
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
title""+n
return
*change
gsel 2
color:boxf
color r,g,b:circlef tp,tp,p-1
gsel 0:gmode 4,p,p,a
memcpy bram2,vram2,PW return
*paint
x=mousex:y=mousey
if z :x=x>>z+px:y=y>>z+py
if p-bp:wpoke buf,n,p<<8+3:n+2
if r-br|(g-bg)|(b-bb){
wpoke buf,n,r<<8+2
wpoke buf,n+2,b<<8+g:n+4
}
if a-ba:wpoke buf,n,a-1<<8+6:n+2
bp=p:br=r:bg=g:bb=b:ba=a:bn=n
bbx=bx:bby=by
memcpy bram,vram,w3
if pt : else:gosub *pset_draw
if pt-1:else:gosub *line_draw
if pt-2:else:gosub *fill_draw
if pt-3:else:gosub *copy_draw
if pt-4:else:gosub *cls_draw
if m:gmode 2:pos 0,0:gcopy 5,0,0,wx,wy:gmode 4,p,p,a
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
title""+n
return
*test_draw1
gsel 2:pos 0,0:tmp1=pwx>>1:tmp2=pwy>>1:gcopy 0,x-tmp1,y-tmp2,pwx,pwy:gsel 0
memcpy cram2,vram2,PW memcpy vram2,bram2,PW return
*test_draw2
tmp=0
gsel 2:pos 0,0:tmp1=pwx>>1:tmp2=pwy>>1:gcopy 0,x-tmp1,y-tmp2,pwx,pwy:gsel 0
repeat PW
peek tmp1,vram2,cnt
peek tmp2,cram2,cnt
if tmp1-tmp2:tmp++:break
loop
memcpy vram2,bram2,PW return
*pset_draw
repeat:await 1
getkey click,1:if click:else:break
x=mousex:y=mousey if z:x=x>>z+px:y=y>>z+py
gosub *test_draw1 pos x-tp,y-tp:gcopy 2 gosub *test_draw2 if tmp:else:continue
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
poke buf,n,1
wpoke buf,n+1,x-bx+32768
wpoke buf,n+3,y-by+32768:n+5
bx=x:by=y
repeat:await 1 x=mousex:y=mousey if z:x=x>>z+px:y=y>>z+py tx=x-bx : ty=y-by if tx|ty{
gosub *test_draw1 gosub *gap gosub *test_draw2 if tmp:else:break
tx=x-bx : ty=y-by if -7<tx&(tx<7)&(-7<ty)&(ty<7){
poke buf,n,ty<<4+tx+136:n++
}else{
poke buf,n,15
wpoke buf,n+1,tx+32768
wpoke buf,n+3,ty+32768:n+5
}
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
bx=x:by=y
title""+n
}
getkey click,1:if click:else break
loop
loop
return
*line_draw
title"Line "+n
pos x-tp,y-tp:gcopy 2
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
poke buf,n,1
wpoke buf,n+1,x-bx+32768
wpoke buf,n+3,y-by+32768:n+5
bx=x:by=y:tmp1=x:tmp2=y
xline tmp1,tmp2,bx,by
gosub *click_wait
repeat
await 1 getkey click,2
if click:xline tmp1,tmp2,bx,by:break
x=mousex:y=mousey if z:x=x>>z+px:y=y>>z+py tmp=y-tmp2
if x-tmp1|tmp{
xline tmp1,tmp2,bx,by:tmp1=x:tmp2=y
xline tmp1,tmp2,bx,by
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
}
getkey click,1
if click{
xline tmp1,tmp2,bx,by:tmp1=x:tmp2=y
tx=x-bx:ty=y-by if -7<tx&(tx<7)&(-7<ty)&(ty<7){
poke buf,n,ty<<4+tx+136:n++
}else{
poke buf,n,15
wpoke buf,n+1,tx+32768
wpoke buf,n+3,ty+32768:n+5
}
gosub *gap
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
bx=x:by=y
xline tmp1,tmp2,bx,by
title"Line "+n
gosub *click_wait
}
loop
gosub *click_wait
return
*fill_draw
pget x,y
if r=rval:if g=gval:if b=bval:gosub *click_wait:return
color r,g,b:fill x,y:color
poke buf,n,5
wpoke buf,n+1,x-bx+32768
wpoke buf,n+3,y-by+32768:n+5
bx=x:by=y
gosub *click_wait
return
*copy_draw
title"COPY "+n
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
poke buf,n,8:n++
wpoke buf,n,x-bx+32768:n+2
wpoke buf,n,y-by+32768:n+2
bx=x:by=y:tmp1=x:tmp2=y
xbox tmp1,tmp2,bx,by
gosub *click_wait
repeat
await 1
x=mousex:y=mousey if z:x=x>>z+px:y=y>>z+py
tmp=y-tmp2
if x-tmp1|tmp{
redraw 0
xbox tmp1,tmp2,bx,by:tmp1=x:tmp2=y
xbox tmp1,tmp2,bx,by
redraw 1
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
}
getkey click,1
if click{
if x>bx:tmp3=bx:else tmp3=x
if y>by:tmp4=by:else tmp4=y
xbox tmp1,tmp2,bx,by:tmp1=x:tmp2=y
tx=x-bx:ty=y-by
wpoke buf,n+0,tx+32768
wpoke buf,n+2,ty+32768
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
if tx<0:tx=-tx
if ty<0:ty=-ty
bx=x:by=y
break
}
loop
gosub *click_wait
xbox tmp1,tmp2,tmp1+tx,tmp2+ty
repeat
await 1
x=mousex:y=mousey if z:x=x>>z+px:y=y>>z+py
tmp=y-tmp2
if x-tmp1|tmp{
redraw 0
xbox tmp1,tmp2,tmp1+tx,tmp2+ty:tmp1=x:tmp2=y
xbox tmp1,tmp2,tmp1+tx,tmp2+ty
redraw 1
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
}
getkey click,1
if click{
xbox tmp1,tmp2,tmp1+tx,tmp2+ty:tmp1=x:tmp2=y
gmode 0
pos x,y:gcopy 0,tmp3,tmp4,tx,ty
gmode 4,p,p,a
tx=x-bx:ty=y-by
wpoke buf,n+4,tx+32768
wpoke buf,n+6,ty+32768:n+8
if z:gsel 4:gzoom zwx,zwy,0,px,py,zwx>>z,zwy>>z:gsel 0
bx=x:by=y
break
}
loop
gosub *click_wait
return
*cls_draw
if m:gsel 5:color:boxf:gsel 0
bx=0:by=0:m=0:z=0:n=0:bn=0
br=0:bg=0:bb=0:bp=0:ba=0
color 255,255,255:boxf:color
gosub *click_wait
gosub *pal_draw
return
*save
wait 5:dialog"tbs",17:if stat:else return
bsave refstr,buf,n
gsel 3:title""+refstr:gsel 0
return
*load
wait 5
dialog"tbs",16:if stat:else return
exist refstr:if 0<strsize:else return
memset buf,0,n
bload refstr,buf,strsize:n=strsize
gsel 3:title""+refstr:gsel 0
gosub *draw
return
*draw
if m:gsel 5:color:boxf:gsel 0
i=0:bx=0:by=0:x=0:y=0:t=0:m=0
r=1:g=0:b=0:a=256:p=1
color 255,255,255:boxf:color
gmode 4,p,p,a
repeat
if n<=i:break
peek j,buf,i:i++
if j-8:else{
if m:gmode 2:pos 0,0:gcopy 5,0,0,wx,wy:gmode 4,p,p,a
wpeek x,buf,i
wpeek y,buf,i+2
x+bx-32768:y+by-32768:bx=x:by=y
wpeek x,buf,i+4
wpeek y,buf,i+6
x+bx-32768:y+by-32768
if x>bx:x1=bx:x2=x-bx:else x1=x:x2=bx-x
if y>by:y1=by:y2=y-by:else y1=y:y2=by-y
bx=x:by=y
wpeek x,buf,i+8
wpeek y,buf,i+10:i+12
x+bx-32768:y+by-32768
gmode 0
pos x,y:gcopy 0,x1,y1,x2,y2
gmode 4,p,p,a
}
if j-5:else{
if m:gmode 2:pos 0,0:gcopy 5,0,0,wx,wy:gmode 4,p,p,a
wpeek x,buf,i
wpeek y,buf,i+2:i+4
x+bx-32768:y+by-32768
color r,g,b:fill x,y:color
}
if j-4:else{
if m:gmode 2:pos 0,0:gcopy 5,0,0,wx,wy:gmode 4,p,p,a
memcpy rgb,buf,3,,i:i+3
if rgb:gosub *Masking:m=1:else{
gmode 2
pos 0,0:gcopy 5,0,0,wx,wy
gmode 4,p,p,a
gsel 5:color:boxf:gsel 0
m=0
}
}
if j-7:else{
if m:gmode 2:pos 0,0:gcopy 5,0,0,wx,wy:gmode 4,p,p,a
memcpy rgb,buf,3,,i:i+3
gosub *rMasking:m=1
}
if j-2:else{
peek r,buf,i
peek g,buf,i+1
peek b,buf,i+2:i+3
gosub *change
}
if j-3:else peek p,buf,i:i++:tp=p>>1:gosub *change
if j-6:else peek a,buf,i:a++:i++:gmode 4,p,p,a
if j-1:else{
wpeek x,buf,i
wpeek y,buf,i+2:i+4
x+bx-32768:y+by-32768
pos x-tp,y-tp:gcopy 2
}
if 14<j{
if j==15{
wpeek x,buf,i
wpeek y,buf,i+2:i+4
x+bx-32768:y+by-32768
}else x+=j&15-8:y+=j>>4-8
gosub *gap
}
bx=x:by=y
getkey click,38 if click:w++:title"Wait "+w:wait 40
getkey click,40 if click:if w:w--:title"Wait "+w:wait 40
if w{
repeat w*w*1000
if cnt&1:await
loop
}else:if cnt&1:await
loop
if m:gmode 2:pos 0,0:gcopy 5,0,0,wx,wy:gmode 4,p,p,a
bp=p:br=r:bg=g:bb=b:ba=a
gosub *pal_draw
gosub *change
gsel 0:tmp=""+n:title tmp
return
*gap
dx=x-bx:dy=y-by
if dx<0:dx=-dx:x_plus=-1:else x_plus=1
if dy<0:dy=-dy:y_plus=-1:else y_plus=1
tx=bx-tp:ty=by-tp:l=0
if dy<dx:gosub *gap_x:else gosub *gap_y
return
*gap_x
l=dx>>1
repeat dx
tx+x_plus:l+dy
if l>=dx:ty+y_plus:l-dx
pos tx,ty:gcopy 2
loop
return
*gap_y
l=dy>>1
repeat dy
ty+y_plus:l+dx
if l>=dy:tx+x_plus:l-dy
pos tx,ty:gcopy 2
loop
return
*gap_x2
p--:tmp=tp-x_plus
gsel 2:color
circlef tmp,tp-y_plus,p
memcpy cram2,vram2,PW
memcpy vram2,bram2,PW
circlef tmp,tp,p
memcpy dram2,vram2,PW
gsel 0
l=dx>>1
repeat dx:await
tx+x_plus:l+dy
if l>=dx{
ty+y_plus:l-dx
memcpy vram2,cram2,PW
pos tx,ty:gcopy 2
memcpy vram2,dram2,PW
}else pos tx,ty:gcopy 2
loop
p++
return
*gap_y2
p--:tmp=tp-y_plus
gsel 2:color
circlef tp-x_plus,tmp,p
memcpy cram2,vram2,PW
memcpy vram2,bram2,PW
circlef tp,tmp,p
memcpy dram2,vram2,PW
gsel 0
l=dy>>1
repeat dy:await
ty+y_plus:l+dx
if l>=dy{
tx+x_plus:l-dy
memcpy vram2,cram2,PW
pos tx,ty:gcopy 2
memcpy vram2,dram2,PW
}else pos tx,ty:gcopy 2
loop
p++
return
|