-
Notifications
You must be signed in to change notification settings - Fork 0
/
NA_DRPE.prg
2216 lines (1905 loc) · 46.3 KB
/
NA_DRPE.prg
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
'===============
' Drop-e by Na
'===============
'SAVE "NA_DRPE","11302"
'Package:
' SPU1,BGU0,BGU1,BGF0,SCU0
'LIST @LIST
PNLTYPE "OFF"
COLOR 0,0:CLS
GPAGE 1,1,1:GCLS
GPAGE 0,0,0:GCLS
SPPAGE 1:SPCLR
SPPAGE 0:SPCLR
BGPAGE 1:BGCLR
BGPAGE 0:BGOFS 0,0,0:BGCLR 1
CLEAR
BGMSTOP
?"Loading...
MEM$=""
SYSBEEP=0
SAVFILE$="MEM:NA_DRPE"
LOAD SAVFILE$,0
IF PACKAGE$=="11302" THEN @LDSKIP
LOAD "BGU0U:SLOP",0
LOAD "BGU1U:DROPE_LG",0
LOAD "SPU1U:NUM16",0
LOAD "SCU0U:DRP2",0
LOAD "BGF0U:HIRAKATA",0
BEEP
@LDSKIP
SYSBEEP=1
BREPEAT 0,13,8
BREPEAT 1,13,8
BREPEAT 2,20,11
BREPEAT 3,20,11
SPPAGE 0
BGPAGE 0
GPAGE 0,0,0
GPRIO 1
FOR I=0 TO 3
'252ハ゛ンノSPヲケス
CHRSET "SPU3",240+I,"0"*64
'52ハ゛ンノSPヲケス
CHRSET "SPU0",208+I,"0"*64
NEXT
FOR I=0 TO 255
'SPU1カラSPS1Lニコヒ゜-
CHRREAD("SPU1",I),C$
CHRSET "SPS1L",I,C$
'BGF0カラBGU3ニコヒ゜-
CHRREAD("BGF0",I),C$
C2$=""
FOR J=0 TO 63
IF MID$(C$,J,1)=="0" THEN C2$=C2$+"3" ELSE C2$=C2$+"D"
NEXT
CHRSET "BGU3",I,C2$
'BGF0カラBGF0Lニコヒ゜-
CHRREAD("BGF0",I),C$
CHRSET "BGF0L",I,C$
NEXT
GP=0
V_S=0 '〜-1:ヒョウシ゛ナシ(アニメフレ-ム) 0:ハンテイオワリ
V_T1=1
V_T2=2
V_BN=3
V_BC=4
V_BV=5
V_BP=6
V_X=7
'シュルイ
KMAX=26
DIM KC[KMAX]
DIM KBN[KMAX]
DIM KBC[KMAX]
DIM KBV[KMAX]
DIM KBP[KMAX]
DIM KX[KMAX]
DIM LV$[2]
LV$[0]="│л■л"
LV$[1]="а┰м├"
DIM HNT$[4]
HNT$[0]="е├"
HNT$[1]="Ы▲┼"
HNT$[2]="■мб"
HNT$[3]="ミス"
SVLEN=35
SVLEN1=17
'SE
BGMSET 128,"T480@86@D24B-6_<B-
BGMSET 129,"T480@86@D24<B-6_>B-
BGMSETD 140,@MTIT
'キョク
RESTORE @LIST
READ BGM_CNT
IF LEN(MEM$)<SVLEN*BGM_CNT THEN MEM$=MEM$+CHR$(0)*(SVLEN*BGM_CNT-LEN(MEM$))
DIM BGM_ID[BGM_CNT]
DIM BGM_VOL[BGM_CNT]
DIM BGM_TIT$[BGM_CNT]
DIM BGM_CMP$[BGM_CNT]
DIM BGM_LV[BGM_CNT,2]
DIM BGM_BG$[BGM_CNT]
FOR I=0 TO BGM_CNT-1
READ ID,VOL,T$,C$,LV1,LV2
BGM_ID[I]=ID
BGM_VOL[I]=VOL
BGM_TIT$[I]=T$
BGM_CMP$[I]=C$
BGM_LV[I,0]=LV1
BGM_LV[I,1]=LV2
BG$=""
FOR J=0 TO 23
BG$=BG$+"C"+HEX$(ASC(MID$(T$,J,1)+" ")+768,3)
NEXT
BGM_BG$[I]=BG$
NEXT
FOR I=0 TO BGM_CNT-1
IF BGM_ID[I]>=128 THEN BGMSETD BGM_ID[I],"@M"+STR$(BGM_ID[I])
NEXT
CRB$="BG":CRI=&HDB:GOSUB @COLRD
BG_C$=C$
COLSET "BG",0,BG_C$
BGPAGE 1
BG_C1$="101020"
COLSET "BG",0,BG_C1$
VISIBLE 1,1,1,1,1,1
@TIT
GPAGE 1
SPPAGE 1
GCLS
SPCLR
GPAGE 0
SPPAGE 0
BGPAGE 0
COLSET "BG",&HF6,"203880"
COLSET "BG",&HFF,"FFFFFF"
GCLS
CLS
BGFILL 1,0,0,31,0,"801A"
'BGFILL 1,0,1,31,1,"80B380B4"
BGFILL 1,0,1,31,7,"8003"
BGOFS 1,0,-140
LOCATE 9,13:?"リス゛ムケ゛-ム
LOCATE 14,14:?"Drop-e
LOCATE 11,16:?"(c)2020 Na
LOCATE 13,19:?"Й Щ┝мбз
LOCATE 13,21:?" ─кз
TSEL=0
BGMPLAY 0,140,70
TITCNT=0
@TITLOOP
BX=256+12+8*SIN(RAD(TITCNT%360))
BY=320+8+8*SIN(RAD(1.5*TITCNT%360))
BGOFS 0,BX,BY
VSYNC 1
B=BUTTON(1)
IF B AND 1+2 THEN BEEP 9:TSEL=!TSEL
LOCATE 13,19:?MID$("Й ",TSEL,1)
LOCATE 13,21:?MID$(" Й",TSEL,1)
IF (B AND 16)>0 AND TSEL==0 THEN @MENULOAD
IF (B AND 16)>0 AND TSEL==1 THEN @END
TITCNT=(TITCNT+1.2)%720
GOTO @TITLOOP
@END
BEEP 4
BGMSTOP 0,1
ACLS
CHRINIT "BGU0U"
CHRINIT "BGU1U"
CHRINIT "SPU1U"
CHRINIT "SPS1L"
CHRINIT "BGF0U"
CHRINIT "BGF0L"
CHRINIT "BGU3L"
END
@MENULOAD
BEEP 3
BGMSTOP 0,0.5
COLSET "BG",&HF6,BG_C$
COLSET "BG",&HFF,BG_C$
MENUSCR=1
BGM=0
@MENU
CLS
GPAGE 1
SPPAGE 1
BGPAGE 1
GCLS
FOR I=0 TO 23
PNLSTR 0,I," "*32
NEXT
SPCLR
BGCLR
FOR I=0 TO 2
SPSET I,92,12,0,0,0
SPOFS I,24+I*28,58
SPSCALE I,200
NEXT
FOR I=0 TO 5
SPSET 30+I,64+10,0,0,0,0
SPOFS 30+I,220-16*I,68
NEXT
GLINE 16,124,239,124,15
PNLSTR 9,17,"│┌□┌┝■ И Ш │┰м"
PNLSTR 16,17,"И",6
SPSET 3,92,0,0,0,0
SPOFS 3,66,150
SPSCALE 3,200
SPSET 4,64+13,0,0,0,0
SPOFS 4,98,160
PNLSTR 19,21,"/"+RIGHT$(" "+STR$(6*BGM_CNT),3)
STARNUM=0
FOR I=0 TO BGM_CNT-1
STAR=ASC(MID$(MEM$,SVLEN*I,1))
FOR J=0 TO 5
IF STAR AND 1 THEN STARNUM=STARNUM+1
STAR=STAR/2
NEXT
NEXT
SV=STARNUM
FOR I=0 TO 1
SPSET 5+I,64+10*(I>0 AND SV<10),0,0,0,0
SPOFS 5+I,130-16*I,160
NEXT
SPANIM 5,SV%10+1,4,1
SPANIM 6,FLOOR(SV/10)+1,4,1
WAIT 1
GPAGE 0
SPPAGE 0
BGPAGE 0
GCLS
SPCLR
BGFILL 1,32,0,63,23,0
COLSET "BG",0,BG_C$
BG_MY=(40-30)/2
BG_MYG=BG_MY*8
BGOFS 0,256,BG_MYG-192
BGOFS 1,256,BG_MYG-192
LOCATE 0,23
?"↑↓:┥л┿┨┌ ←→:○л├□м А:Щ┝мбз Х:オ-ト ";
GFILL 0,183,255,191,26
NOBGM=0
MENUCNT=0
BGMSTOPCNT=0
MOVE=0
EXCHG=0
EX=0
GOSUB @MENU_LS
BGOFS 0,256,BG_MYG+36,15*MENUSCR
BGOFS 1,256,BG_MYG+36,15*MENUSCR
MENUSCR=0
GOSUB @MENU_LS1
VSYNC 1
@MENULOOP
B=BUTTON(1)
IF B AND 128 THEN AUTO=1:GOTO @GAME
IF B AND 16 THEN AUTO=0:GOTO @GAME
IF B AND 32 THEN BEEP 4:GOSUB @MENUWAIT:GOTO @TIT
IF B AND 1 THEN MOVE=MOVE-1:BEEP 9
IF B AND 2 THEN MOVE=MOVE+1:BEEP 9
IF (B AND 4)>0 AND EXCHG==0 THEN EXCHG=-10:EX=!EX:BGMPLAY 129:GOSUB @MENU_LS1
IF (B AND 8)>0 AND EXCHG==0 THEN EXCHG= 10:EX=!EX:BGMPLAY 128:GOSUB @MENU_LS1
GOSUB @MENUFRM
GOTO @MENULOOP
@MENUFRM
IF !BGMCHK(6) THEN BGMSTOPCNT=BGMSTOPCNT+1
IF MOVE<0 THEN @MENU_UP
IF MOVE>0 THEN @MENU_DN
IF MENUCNT==15 THEN @MENU_MV
IF (MENUCNT==20 OR BGMSTOPCNT>=120)AND !NOBGM THEN BGMPLAY 6,BGM_ID[BGM],BGM_VOL[BGM]:BGMSTOPCNT=0
IF MENUCNT>15 AND EXCHG!=0 THEN @MENU_EX
@MENUFRME
VSYNC 1
IF MENUCNT<10000 THEN MENUCNT=MENUCNT+1
RETURN
@MENU_UP
IF BGM==0 THEN @MENUUPSKP
IF MENUCNT>15 THEN @MENU_RMV
IF MENUCNT<0 THEN @MENUFRME
BGM=BGM-1
EX=0:EXCHG=0
GOSUB @MENU_LS
BGOFS 0,256,BG_MYG+60
BGOFS 0,256,BG_MYG+36,6
BGOFS 1,256,BG_MYG+60
BGOFS 1,256,BG_MYG+36,6
GOSUB @MENU_LS1
MENUCNT=-6
@MENUUPSKP
MOVE=MOVE+1
GOTO @MENUFRME
@MENU_DN
IF BGM==BGM_CNT-1 THEN @MENUDNSKP
IF MENUCNT>15 THEN @MENU_RMV
IF MENUCNT<0 THEN @MENUFRME
BGM=BGM+1
EX=0:EXCHG=0
GOSUB @MENU_LS
BGOFS 0,256,BG_MYG+12
BGOFS 0,256,BG_MYG+36,6
BGOFS 1,256,BG_MYG+12
BGOFS 1,256,BG_MYG+36,6
GOSUB @MENU_LS1
MENUCNT=-6
@MENUDNSKP
MOVE=MOVE-1
GOTO @MENUFRME
@MENU_LS
FOR I=0 TO 10
L=I>=5
IF BGM-5+I<0 THEN @MLSCLR
IF BGM-5+I>=BGM_CNT THEN @MLSCLR
BGPUT L,32+3,BG_MY+I*3,"C0AD"
BGFILL L,32+4,BG_MY+I*3,63-4,BG_MY+I*3,"C0AE"
BGPUT L,63-3,BG_MY+I*3,"C0AF"
BGPUT L,32+3,BG_MY+I*3+1,"C0CD"
BGFILL L,32+4,BG_MY+I*3+1,63-4,BG_MY+I*3+1,"C0CE"
BGPUT L,63-3,BG_MY+I*3+1,"C0CF"
BGPUT L,32+3,BG_MY+I*3+2,"C0ED"
BGFILL L,32+4,BG_MY+I*3+2,63-4,BG_MY+I*3+2,"C0EE"
BGPUT L,63-3,BG_MY+I*3+2,"C0EF"
'キョクタイトル
BGFILL L,32+4,BG_MY+I*3+1,63-4,BG_MY+I*3+1,BGM_BG$[BGM-5+I]
@MLSSKIP
NEXT
GFILL 24-4,80-2,232+3,114,0
RETURN
@MENU_LS1
SVDATA$=MID$(MEM$,SVLEN*BGM,SVLEN)
STAR=ASC(SVDATA$)
SVDATA1$=MID$(SVDATA$,1+SVLEN1*EX,SVLEN1)
SCORE$=LEFT$(SVDATA1$,5)
OLDSCORE=VAL("&H"+SCORE$)
SCORE$=RIGHT$(" "+STR$(OLDSCORE),6)
HNT1$=RIGHT$(" "+STR$(VAL("&H"+MID$(SVDATA1$,5,3))),4)
HNT2$=RIGHT$(" "+STR$(VAL("&H"+MID$(SVDATA1$,8,3))),4)
HNT3$=RIGHT$(" "+STR$(VAL("&H"+MID$(SVDATA1$,11,3))),4)
HNT4$=RIGHT$(" "+STR$(VAL("&H"+MID$(SVDATA1$,14,3))),4)
GPAGE 1
SPPAGE 1
GFILL 24,21,255,39,0
GT$=BGM_TIT$[BGM]
GX=24:GY=21:GS=2:GOSUB @GPRT_L
PNLSTR 3,6,LV$[EX]
L1$="Lv."+RIGHT$(" "+STR$(BGM_LV[BGM,EX]),2)
PNLSTR 9,6,L1$
PNLSTR 17,7,"ハイスコア"
SI=30:SC=6:SZ=0:SV=OLDSCORE:GOSUB @SCSET
FOR I=0 TO 3
PNLSTR 6+6*I,12,HNT$[I]
NEXT
PNLSTR 7,13,HNT1$
PNLSTR 13,13,HNT2$
PNLSTR 19,13,HNT3$
PNLSTR 25,13,HNT4$
B=1+7*EX
FOR I=0 TO 2
SPCHR I,92,12*((STAR AND B)==0),0,0,0
B=B*2
NEXT
GPAGE 0
SPPAGE 0
RETURN
@MLSCLR
BGFILL L,32+3,BG_MY+I*3,63-3,BG_MY+I*3+2,0
GOTO @MLSSKIP
@MENU_MV
BGFILL 1,32+3,BG_MY+5*3,63-3,BG_MY+5*3+2,0
IF !NOBGM THEN BGOFS 0,256,BG_MYG+40,6
IF !NOBGM THEN BGOFS 1,256,BG_MYG+32,6
GPUTCHR 24-4,80-2,"BGU0",&HAD,12,1
GPUTCHR 24-4,88-2,"BGU0",&HCD,12,1
GPUTCHR 24-4,96-2,"BGU0",&HCD,12,1
GPUTCHR 24-4,104-2,"BGU0",&HCD,12,1
GPUTCHR 24-4,104+2,"BGU0",&HED,12,1
FOR I=32-4 TO 224-4 STEP 8
GPUTCHR I,80-2,"BGU0",&HAE,12,1
GPUTCHR I,88-2,"BGU0",&HCE,12,1
GPUTCHR I,96-2,"BGU0",&HCE,12,1
GPUTCHR I,104-2,"BGU0",&HCE,12,1
GPUTCHR I,104+2,"BGU0",&HEE,12,1
NEXT
GPUTCHR 224+4,80-2,"BGU0",&HAF,12,1
GPUTCHR 224+4,88-2,"BGU0",&HCF,12,1
GPUTCHR 224+4,96-2,"BGU0",&HCF,12,1
GPUTCHR 224+4,104-2,"BGU0",&HCF,12,1
GPUTCHR 224+4,104+2,"BGU0",&HEF,12,1
L1$=LV$[0]+" Lv."+RIGHT$(" "+STR$(BGM_LV[BGM,0]),2)
L2$=LV$[1]+" Lv."+RIGHT$(" "+STR$(BGM_LV[BGM,1]),2)
GDRAWMD 1
'None 11000011
'Front 11001100
'Back 11100011
'Fr+Bk 11101100
' XOR 00010000
GT$=BGM_TIT$[BGM]:GX=32-2:GY=88:GS=1:GP=2:GOSUB @GPRT_L
GT$=BGM_CMP$[BGM]:GX=32-2:GY=96:GS=1:GP=2:GOSUB @GPRT_L
GT$=L1$:GX=224+2:GY=96:GS=1:GP=0:GOSUB @GPRT_R
GT$=L2$:GX=224+2:GY=96:GS=1:GP=2:GOSUB @GPRT_R
GP=0:GOSUB @GPRT_R
GDRAWMD 0
CRB$="BG":CRI=&HC3:GOSUB @COLRD
COLSET "GRP",&HCC,"FFFFFF"
COLSET "GRP",&HE3,C$
COLSET "GRP",&HEC,"FFFFFF"
FOR J=5 TO 3 STEP -1
CRB$="BG":CRI=&HD0+J:GOSUB @COLRD
COLSET "GRP",&HD0+J,C$
NEXT
COLSET "GRP",&HDC,C$
COLSET "GRP",&HF3,"FFFF00"
COLSET "GRP",&HFC,"FFFF00"
COLSET "GRP",&H10,BG_C$
GOTO @MENUFRME
@COLRD
COLREAD(CRB$,CRI),CR,CG,CB
C$=HEX$(CR,2)+HEX$(CG,2)+HEX$(CB,2)
RETURN
@MENU_RMV
BGMSTOP 6,1
BGOFS 0,256,BG_MYG+36,6
BGOFS 1,256,BG_MYG+36,6
'GFILL 24-4,80-2,232+3,112+1,0
MENUCNT=-6
GOTO @MENUFRME
@MENU_EX
'x 24-4 → 224+4+8 = 216
'y 80-2 → 104+2+8
GDRAWMD 1
IF EXCHG>0 THEN GFILL 20+21.6*(10-EXCHG),78,20+21.6*(11-EXCHG)-1,114,&H10
IF EXCHG<0 THEN GFILL 20+21.6*(-1-EXCHG),78,20+21.6*(-EXCHG)-1,114,&H10
GDRAWMD 0
EXCHG=EXCHG-SGN(EXCHG)
GOTO @MENUFRME
@MENUWAIT
BGMSTOP 6,1
NOBGM=1
FOR WT=1 TO 60
GOSUB @MENUFRM
NEXT
RETURN
'---------------------------
@GAME
BEEP 32
BGFILL 1,32+3,BG_MY+5*3,63-3,BG_MY+5*3+2,0
BGOFS 0,512,BG_MYG+40,24
BGOFS 1,512,BG_MYG+32,24
GOSUB @MENUWAIT
'---------------------------
'キョクヨミコミ
ID=BGM_ID[BGM]
VOL=BGM_VOL[BGM]
FLABEL$="@F"+STR$(ID)+"EX"*EX
FM$=""
TIT$=BGM_TIT$[BGM]
CMP$=BGM_CMP$[BGM]
SCGMAXS=100000
SCGCLRS=80000
SCBASE=100000
SCBONUS=60000
'RESTORE @KDFLT
FOR I=0 TO KMAX-1
'READ KC[I],KN[I],KX[I]
KC[I]=3
KBN[I]=-1
KBC[I]=0
KBV[I]=127
KBP[I]=64
KX[I]=100
NEXT
@KDFLT
DATA 3,47,100
DATA 4,48,100
ONPCNT=0
RESTORE FLABEL$
READ TMP
LOOPC=0
FOR I=0 TO F$!=""
READ F$
IF !VAL(F$) THEN @OCLOOPSKP
LOOPC=LOOPC+1
IF LOOPC<VAL(F$) THEN RESTORE FLABEL$+"_L"
GOTO @ONPCNT_S
@OCLOOPSKP
IF LEFT$(F$,1)=="@" THEN READ C,BN,BC,BV,BP,X:GOTO @ONPCNT_S
FOR I=0 TO LEN(F$)-1
C=ASC(MID$(F$,I,1))
IF C>=ASC("A") AND C<=ASC("Z") THEN ONPCNT=ONPCNT+2
IF C>=ASC("a") AND C<=ASC("z") THEN ONPCNT=ONPCNT+1
NEXT
@ONPCNT_S
I=0
NEXT
RESTORE FLABEL$
READ TMP
LOOPC=0
BGMSET 255,"T"+STR$(TMP)+"[$0=0R16$0=1R16]"
MSCNT=FLOOR(4*3600/TMP+.5) 'ROUNDノカワリ
MSLEN=202
TGX=86:TGY=104
'--------------------------
'カ゛メン
CLS
GPAGE 1
SPPAGE 1
GCLS
SPCLR
GPAGE 0
BGPAGE 0
SPPAGE 0
GCLS
BGOFS 0,0,320
BGOFS 1,0,0
'コンホ゛
CRB$="BG":CRI=&H3F:GOSUB @COLRD
COLSET "GRP",&H3F,C$
COLSET "GRP",&H30,BG_C$
'ハイケイ
BGFILL 1,0,0,63,23,"D00B"
BGFILL 1,40,4,42,5,"D042D043D044D062D063D064"
CRB$="BG":CRI=&H06:GOSUB @COLRD
COLSET "BG",&H8A,C$
FOR I=0 TO 31
SPSET I,252,0,0,0,0
SPHOME I,8,8
SPSETV I,V_S,-100
SPOFS I,-16,-16
NEXT
SPOFS 31,TGX,TGY
SPSCALE 31,200
GT$=TIT$:GX=246:GY=132:GS=2:GOSUB @GPRT_R
GT$=CMP$:GX=246:GY=152:GS=1:GOSUB @GPRT_R
GT$=LV$[EX]+" Lv.":GX=214:GY=176:GS=1:GOSUB @GPRT_R
GT$=STR$(BGM_LV[BGM,EX]):GX=246:GY=170:GS=2:GOSUB @GPRT_R
GT$="[オ-トフ゜レイ]":GX=246:GY=116:GS=1
IF AUTO THEN GOSUB @GPRT_R
SPPAGE 1
GPAGE 1
PNLSTR 20,22,"START▼мгбз"
GT$="スコア":GX=24:GY=21:GS=2:GOSUB @GPRT_L
PNLSTR 3,7,"ハイスコア"
PNLSTR 23,7,SCORE$
'スコアケ゛-シ゛
SCGX=25:SCGY=44
SCGLEN=207
SCGX2=SCGX+FLOOR(SCGLEN*(SCGCLRS/SCGMAXS))
GLINE SCGX,SCGY-1,256-SCGX,SCGY-1,15
GLINE SCGX,SCGY+6,256-SCGX,SCGY+6,15
GLINE SCGX-1,SCGY,SCGX-1,SCGY+5,15
GLINE 256-SCGX+1,SCGY,256-SCGX+1,SCGY+5,15
COLSET "GRP",&HF8,"383838"
COLSET "GRP",&HF9,"282828"
COLSET "GRP",&HFA,"505050"
COLSET "GRP",&HFB,"404040"
COLSET "GRP",&HFC,"00F018"
COLSET "GRP",&HFD,"208030"
COLSET "GRP",&HFE,"FFA000"
COLSET "GRP",&HFF,"8C6028"
GFILL SCGX,SCGY,SCGX2,SCGY+3,&HF8
GFILL SCGX,SCGY+4,SCGX2,SCGY+5,&HF9
GFILL SCGX2,SCGY,256-SCGX,SCGY+3,&HFA
GFILL SCGX2,SCGY+4,256-SCGX,SCGY+5,&HFB
FOR I=0 TO 5
SPSET 30+I,64+10*(I>0),0,0,0,0
SX=220-16*I:SY=21
SPSETV 30+I,0,SX
SPSETV 30+I,1,SY
SPOFS 30+I,SX,SY
SPSET I,64+10,7,0,0,0
SX=220-16*I:SY=10
SPSETV I,0,SX
SPSETV I,1,SY
SPOFS I,SX,SY
NEXT
GX=150:GS=1
GT$=HNT$[0]:GY=78:GOSUB @GPRT_L
GT$=HNT$[1]:GY=98:GOSUB @GPRT_L
GT$=HNT$[2]:GY=118:GOSUB @GPRT_L
GT$=HNT$[3]:GY=138:GOSUB @GPRT_L
GT$="Ш└ж":GY=158:GOSUB @GPRT_L
FOR I=0 TO 3
SPSET 10+I,64+10*(I>0),0,0,0,0
SPSET 15+I,64+10*(I>0),0,0,0,0
SPSET 20+I,64+10*(I>0),0,0,0,0
SPSET 25+I,64+10*(I>0),0,0,0,0
SPSET 40+I,64+10*(I>0),0,0,0,0
SPOFS 10+I,226-16*I,73
SPOFS 15+I,226-16*I,93
SPOFS 20+I,226-16*I,113
SPOFS 25+I,226-16*I,133
SPOFS 40+I,226-16*I,153
NEXT
HNT1C=0:HNT1C_O=0
HNT2C=0:HNT2C_O=0
HNT3C=0:HNT3C_O=0
HNT4C=0:HNT4C_O=0
SCORE=0:SCORE_O=0
SCADD=0
SCA=0
SCE=0:SCS=0
COMBO=0:COMBO_O=0
MAXCMB=0:MAXCMB_O=0
REST=ONPCNT:REST_O=REST
SI=40:SC=4:SZ=0:SV=REST:GOSUB @SCSET
IF ONPCNT<=100 THEN SCORE_MX=100000+20000/3*SQR(ONPCNT)
IF ONPCNT>100 THEN SCORE_MX=100000+20000/3/ONPCNT*1000+100000/ONPCNT*(ONPCNT-100)
FOR I=0 TO 2
SPSET 7+I,92,12,0,0,0
SPOFS 7+I,24+I*28,80
SPSCALE 7+I,200
NEXT
SPPAGE 0
GPAGE 0
FOR I=0 TO 3
SPSET 32+I,64+10,0,0,0,0
SPSETV 32+I,2,64
SPSETV 32+I,1,48
NEXT
FEND=0
SPI=0
FX=0
FS=0
CNT=0
OA=-1
BGMPLAY 7,255
GOTO @LOOP
@GPRT_R
FOR I=1 TO LEN(GT$)
GPUTCHR GX-I*8*GS,GY,"BGF0",ASC(RIGHT$(GT$,I)),GP,GS
NEXT
RETURN
@GPRT_L
FOR I=0 TO LEN(GT$)-1
GPUTCHR GX+I*8*GS,GY,"BGF0",ASC(MID$(GT$,I,1)),GP,GS
NEXT
RETURN
LASTC=MAINCNTL
STARTCNT=MAINCNTL
@LOOP
IF FX<12 THEN SPCHR 31,252+3*!(FX%4),2,0,0,0
A=BGMGETV(7,0)
IF A!=OA AND !FEND THEN GOSUB @FREAD
OA=A
BT=0
IF !AUTO THEN GOSUB @BTN
IF AUTO THEN GOSUB @AUTO
GOSUB @HNT
GOSUB @MOVE
GOSUB @SCOR
IF MAINCNTL<STARTCNT THEN STARTCNT=STARTCNT-524287-1
CNT=MAINCNTL-STARTCNT
BGOFS 1,CNT/2,0
'FPS=FPS+1
'IF MAINCNTL-LASTC>59 THEN LOCATE 0,0:?FPS,:FPS=0:LASTC=MAINCNTL
IF FEND THEN FEND=FEND+1
IF FEND==MSCNT+60 THEN BGMSTOP 6,5
IF FEND==MSCNT+120 THEN @RESULT
VSYNC 1
IF BUTTON() AND 1024 THEN @QUIT
GOTO @LOOP
@FREAD
IF FX-FS<LEN(FM$) THEN @FRSKIP
FS=FX
READ FM$
@FRCHK
IF FM$=="" THEN FEND=1:RETURN
IF VAL(FM$) THEN @FLOOPCHK
IF LEFT$(FM$,1)=="@" THEN @FKSET
@FRSKIP
IF FX==16 THEN BGMPLAY 6,ID,VOL
NT$=MID$(FM$,FX-FS,1)
FX=FX+1
IF NT$==" " THEN RETURN
S=2
K=ASC(NT$)-ASC("A")
IF K>26 THEN K=ASC(NT$)-ASC("a"):S=1
C=KC[K]
BN=KBN[K]
BC=KBC[K]
BV=KBV[K]
BP=KBP[K]
X=KX[K]
SPOFS SPI,-16,-16
SPCHR SPI,181,C,0,0,0
SPSETV SPI,V_S,S
SPSETV SPI,V_T1,CNT
SPSETV SPI,V_T2,CNT+MSCNT
SPSETV SPI,V_BN,BN
SPSETV SPI,V_BC,BC
SPSETV SPI,V_BV,BV
SPSETV SPI,V_BP,BP
SPSETV SPI,V_X,X
SPI=SPI+1 AND 31
RETURN
@FKSET
NT$=RIGHT$(FM$,1)
K=ASC(NT$)-ASC("A")
READ C,BN,BC,BV,BP,X
IF C!=-1 THEN KC[K]=C
IF BN!=-1 THEN KBN[K]=BN
IF BC!=-1 THEN KBC[K]=BC
IF BV!=-1 THEN KBV[K]=BV
IF BP!=-1 THEN KBP[K]=BP
IF X!=-1 THEN KX[K]=X
READ FM$
GOTO @FRCHK
@FLOOPCHK
LOOPC=LOOPC+1
IF LOOPC<VAL(FM$) THEN RESTORE FLABEL$+"_L"
READ FM$
GOTO @FRCHK
@MOVE
FOR I=0 TO 31
STAT=SPGETV(I,V_S)
IF STAT<-10 THEN @MVSKIP
IF STAT<0 THEN @MVANCNT
IF STAT==1 THEN SPSCALE I,100
IF STAT==2 THEN SPSCALE I,140
T1=SPGETV(I,V_T1)
T2=SPGETV(I,V_T2)
XP=SPGETV(I,V_X)
XD=MSLEN*XP/100
P=(T2-CNT)/(T2-T1)*1.1
D=MSLEN*P
IF D>XD THEN @MV0
IF D>0 THEN @MV1
IF D>-56 THEN @MV2
@MV3
X=30
Y=TGY-(D+56)*1.5
IF Y>192+16 THEN SPSETV I,V_S,-100
GOTO @MV
@MV2
X=TGX+D
Y=TGY
GOTO @MV
@MV1
X=TGX+D*0.832 'COS
Y=TGY-D*0.555 'SIN
GOTO @MV
@MV0
X=TGX+XD*0.832
Y=TGY-XD*0.555-(D-XD)
@MV
SPOFS I,X,Y
SPANGLE I,360*P*4 'MSLEN/(16*PI())
@MVSKIP
NEXT
RETURN
@MVANCNT
SPSETV I,V_S,STAT-1
IF STAT==-10 THEN SPOFS I,-32,-32
GOTO @MVSKIP
@AUTO
FOR J=SPI TO SPI+31
I=J AND 31
IF SPGETV(I,V_S)<=0 THEN @ATSKIP
T2=SPGETV(I,V_T2)
IF CNT<T2 THEN J=J+32:GOTO @ATSKIP 'RETURN
BT=BT+1
J=J+32':GOTO @ATSKIP
'RETURN
@ATSKIP
NEXT
RETURN
@HNT
BN0=-1
FOR J=SPI TO SPI+31
I=J AND 31
STAT=SPGETV(I,V_S)
IF STAT<=0 THEN @HNTSKIP
T2=SPGETV(I,V_T2)
FRM=CNT-T2
'-:ハヤイ +:オソイ
IF FRM<-15 THEN J=J+32:GOTO @HNTEND 'RETURN
BN=SPGETV(I,V_BN)
BC=SPGETV(I,V_BC)
BV=SPGETV(I,V_BV)
BP=SPGETV(I,V_BP)
IF BN0<0 THEN BN0=BN:BC0=BC:BV0=BV:BP0=BP
IF !BT AND FRM>5 THEN @HNT4
IF !BT THEN J=J+32:GOTO @HNTEND 'RETURN
@HNTREDO
BT=BT-1
IF BN>=0 THEN BEEP BN,BC,BV,BP
IF STAT==1 THEN SPSETV I,V_S,-1
IF STAT==2 THEN SPSETV I,V_S,1
IF ABS(FRM)<=2 THEN @HNT1
IF ABS(FRM)<=4 THEN @HNT2
@HNT3 'Bad
IF STAT==1 THEN SPCHR I,252,0,0,0,0
HNT3C=HNT3C+1
COMBO=0
REST=REST-1
GOTO @HNTSKIP
@HNT4 'Miss
SPSETV I,V_S,0
HNT4C=HNT4C+STAT
COMBO=0
SCADD=-FLOOR(SCBASE/ONPCNT+.5)
SCORE=SCORE+SCADD
REST=REST-STAT
GOTO @HNTSKIP
@HNT2 'OK
IF STAT==1 THEN SPCHR I,48,0,0,0,0
IF STAT==1 THEN SPANIM I,5,2,1
HNT2C=HNT2C+1
COMBO=COMBO+1
IF COMBO>=MAXCMB THEN MAXCMB=COMBO
IF COMBO>=100 THEN SCADD=SCBASE+SCBONUS ELSE SCADD=SCBASE+COMBO*(SCBONUS/100)
SCADD=FLOOR(SCADD/ONPCNT*.6+.5)
SCORE=SCORE+SCADD
REST=REST-1
GOTO @HNTSKIP
@HNT1 'Good
IF STAT==1 THEN SPCHR I,248,0,0,0,0
IF STAT==1 THEN SPANIM I,5,2,1
HNT1C=HNT1C+1
COMBO=COMBO+1
IF COMBO>=MAXCMB THEN MAXCMB=COMBO
IF COMBO>=100 THEN SCADD=SCBASE+SCBONUS ELSE SCADD=SCBASE+COMBO*(SCBONUS/100)
SCADD=FLOOR(SCADD/ONPCNT+.5)
SCORE=SCORE+SCADD
REST=REST-1
@HNTSKIP
IF BT>0 AND STAT==2 THEN STAT=1:GOTO @HNTREDO
@HNTEND
NEXT
IF BN0<0 THEN BN0=KBN[0]:BC0=KBC[0]:BV0=KBV[0]:BP0=KBP[0]
IF BT AND BN0>=0 THEN BEEP BN0,BC0,BV0,BP0
RETURN
@BTN
B_=BUTTON()
B=B_ AND NOT OB
OB=B_
FOR I=0 TO 9
IF B AND 1 THEN BT=BT+1
B=B/2
NEXT
' IF TCHST AND !OT THEN BT=BT+1
' OT=TCHST
RETURN
@SCOR
SPPAGE 1
GPAGE 1