-
Notifications
You must be signed in to change notification settings - Fork 2
/
editor.asm
5906 lines (5137 loc) · 91.4 KB
/
editor.asm
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
.FEATURE force_range
editorInit:
jsr setupSpriteCursor
jsr initKeyRepeats
lda #$00
sta maxDma
sta editorDecoding ;clear blocking flags
sta editorEditingValue ;
sta editorEditingBuffer ;
lda #PLAY_MODE_STOPPED ;set player mode and previous mode to STOPPED
sta plyrMode
sta plyrModeOld
lda #EDIT_MODE_GRID ;set editing mode to GRID
sta editorMode
lda #$00 ;reset edit cursor position to top-left (0,0)
sta cursorX_grid
sta cursorY_grid
sta cursorY_editMenu
lda #$00 ;clear key repeats and repeat counters
sta keyStopB
sta keyDelayA
sta keyDelayB
sta keyDelayUD
sta keyDelayLR
sta editorWaitForAB ;clear various editig flags
sta editorWaitForClone
sta editorPhraseForClone
lda #$00 ;clear copy buffer
sta triggerCopyBuffer+0
sta triggerCopyBuffer+1
sta triggerCopyBuffer+2
sta triggerCopyBuffer+3
sta triggerCopyBuffer+4
ldx #$00 ;clear Editor trigger indexes
stx editorTriggerIndex+0
stx editorTriggerIndex+1
stx editorTriggerIndex+2
stx editorTriggerIndex+3
stx editorTriggerIndex+4
stx editorTriggerIndex+5
lda #4+(2*12) ;set last note value to C3
sta editorTrackLastNote+0
sta editorTrackLastNote+1
sta editorTrackLastNote+2
sta editorTrackLastNote+3
sta editorTrackLastNote+4
sta editorTrackLastNote+5
lda #$00 ;clear Last Triger for all tracks
sta editorTrackLastTrigger+0
sta editorTrackLastTrigger+1
sta editorTrackLastTrigger+2
sta editorTrackLastTrigger+3
sta editorTrackLastTrigger+4
sta editorTrackLastTrigger+5
lda #$01 ;set Channel Status to 1 for each track
sta editorChannelStatus+0 ;Channel Status is for Mute and Solo
sta editorChannelStatus+1
sta editorChannelStatus+2
sta editorChannelStatus+3
sta editorChannelStatus+4
sta editorChannelStatus+5
lda #$FF
sta editorSoloChannel ;Clear Solo channel
lda #$00 ;Clear sub mode indexes for each track
sta editorSubModeIndexes+0
sta editorSubModeIndexes+1
sta editorSubModeIndexes+2
sta editorSubModeIndexes+3
sta editorSubModeIndexes+4
sta editorSubModeIndexes+5
sta editorDrumAuxIndex ;Clear various flags
sta editorEditDrumName
sta lastDrumParameterValue
sta editorTrackWipeSpeed
sta editorForceTrackLoad
sta editMenuActive
sta editCopyBuffer
sta cursorY_grid
sta cursorX_track
sta editPatternInfoSubMode
sta editorDrumSubMode
sta editorLastDrumValue
sta editorLastPhraseValue
sta editorLastSongLoop
sta editSongIndex
sta editorSongLastPattern
lda #STARTING_SONG ;read Starting Song and load song data
jsr editorSelectSong
lda #SONG_MODE_OFF ;turn off Song Mode
sta editSongMode
lda #$00 ;turn of Song Mode Recording
sta editSongModeRecord
jsr editorInitVoiceSwitchSprites
jsr editorCheckSignature ;check to see if Save File has been 'formatted'
bcc :+ ;as a PR8 file, if not wipe all data
jsr editorWipeAll
:
lda #STARTING_PATTERN ;set starting pattern
sta editorCurrentPattern
jmp editorInit2 ;
editorInit2:
lda editorCurrentPattern ;
jsr editorSelectPattern ;fetch current pattern to display
jsr editorInitCopyInfo ;clear copy message buffer
ldx #$07
jsr editorSetPlayBackMessage
jsr editorDecodePattern ;decode current pattern for printing
jsr editorDecodeTriggerParameters ;decode current pattern triggers for printing
ldy cursorY_grid ;get drum under cursor and decode for printing
lda (editorTmp0),y
lda editorTrackDrum,y
sta editorCurrentDrum
jsr editorDecodeDrum
jsr editorDecodeSong ;decode song for printing
lda #procSongAll ;add song printing to async dma buffer (non-blocking print)
jsr addProcessToBuffer
lda #procGridRowAll ;print grid row (non blocking)
jsr addProcessToBuffer
lda #procTrackDrumAll ;print track drum assignments (non blocking)
jsr addProcessToBuffer
jsr editorPrintTriggers ;print triggers for each track
jsr editorPrintDrum ;print current drum
lda #procCopyInfoAll ;print copy message (non blocking)
jsr addProcessToBuffer
lda #procGridPattern ;print current pattern to display grid (non blocking)
jsr addProcessToBuffer
rts
editorCheckSignature: ;check if SAV file has been 'formatted' for PR8
lda #WRAM_BANK_00
jsr setMMC1r1
ldx #$00
: lda PR8_HEADER,x ;simple header check against PR8 header string
cmp @header,x
bne :+
inx
cpx #@headerEnd-@header
bcc :-
clc ;clear carry if SAV file is correctly formatted
rts
: ldx #$00 ;if header dosn't match PR8 header, write PR8 header to save area
: lda @header,x
sta PR8_HEADER,x
inx
cpx #@headerEnd-@header
bcc :-
sec
rts
@header: .BYTE "P","R","8",0 ;PR8 header for PR8 formatted save file
@headerEnd:
; ****
; Main Loop
; ****
editorMainLoop: ;main background loop, refreshed once per vertical blank
lda vblankFlag
: cmp vblankFlag
beq :-
jsr editorRefresh ;call to refresh editor (many functions below)
jmp editorMainLoop ;back to main loop
;
;
;
editorRefresh:
jsr editorGlobalKeys ;check non modal key input
jsr editorFlashCursor ;animate (flash) sprite cursor
jsr editorUpdateTrackIndexCursor ;update track index cursor
jsr editorTrackWipeSprites ;clear track sprite for later refresh
jsr editorStepIndicator ;update step indicator
jsr editorMeters ;update track meters
jsr editorShowParameterHint ;update Trigger Parameter indicator sprites
jsr editorGhostCursor ; *** not sure ***
jsr editorShowSongMode ;display current song mode
jsr editorShowTimer ;display timer
jsr editorCheckCopyInfoMessage ;update copy info message (on timer)
ldx editorMode ;editor mode is integer value
lda editModeJumpLo,x ;fetch vector for edit mode from table
sta editModeVector
lda editModeJumpHi,x
sta editModeVector+1
jmp (editModeVector) ;jump to current edit mode vector
editModeJumpLo:
.LOBYTES editorDisabled
.LOBYTES editTrack
.LOBYTES editGrid
.LOBYTES editTriggerParameters
.LOBYTES editDrum
.LOBYTES editDrumAux
.LOBYTES editorEditGridMenu
.LOBYTES editorEditDrumMenu
.LOBYTES editorEditPatternNumber
.LOBYTES editorSong
.LOBYTES editorEditSongMenu
.LOBYTES editorEditEchoMenu
.LOBYTES editorClearMenu
editModeJumpHi:
.HIBYTES editorDisabled
.HIBYTES editTrack
.HIBYTES editGrid
.HIBYTES editTriggerParameters
.HIBYTES editDrum
.HIBYTES editDrumAux
.HIBYTES editorEditGridMenu
.HIBYTES editorEditDrumMenu
.HIBYTES editorEditPatternNumber
.HIBYTES editorSong
.HIBYTES editorEditSongMenu
.HIBYTES editorEditEchoMenu
.HIBYTES editorClearMenu
editorDisabled:
rts
editorTryLoadingPattern:
lda editSongMode
cmp #SONG_MODE_OFF
bne :+
lda editorCurrentPattern
sta plyrNextPattern
: rts
editorGlobalKeys:
jsr checkRepeatKeySelect
jsr checkRepeatKeyStart
lda PAD1_firea
beq :+
lda keyReleaseStart
beq :+
lda #PLAY_MODE_SONG_LOOP
sta plyrMode
jsr editorTryLoadingPattern
rts
: lda PAD1_fireb
beq :++++
lda keyReleaseSelect
beq :+
ldx cursorY_grid
lda editorChannelStatus,x
eor #$01
sta editorChannelStatus,x
rts
: lda keyReleaseStart
beq :++
lda cursorY_grid
cmp editorSoloChannel
bne :+
lda #$FF
bmi :+
: sta editorSoloChannel
: rts
: lda PAD1_sel
beq :++
lda keyReleaseStart
beq :+
lda #PLAY_MODE_START
sta plyrMode
jsr editorTryLoadingPattern
: rts
: lda keyReleaseStart
beq :+
lda plyrMode
eor #$01
sta plyrMode
jsr editorTryLoadingPattern
: rts
.IF 0=1
lda keyReleaseStart
beq :+++
lda PAD1_firea
beq :+
;Start song from Loop point
lda #PLAY_MODE_SONG_LOOP
sta plyrMode
jsr editorTryLoadingPattern
rts
: lda PAD1_fireb
bne :++
lda #PLAY_MODE_START
ldx PAD1_sel
bne :+
lda plyrMode
eor #$01
: sta plyrMode
jsr editorTryLoadingPattern
:
lda PAD1_fireb
beq :+++
lda keyReleaseSelect
beq :+
ldx cursorY_grid
lda editorChannelStatus,x
eor #$01
sta editorChannelStatus,x
rts
: lda keyReleaseStart
beq :++
lda cursorY_grid
cmp editorSoloChannel
bne :+
lda #$FF
bmi :+
: sta editorSoloChannel
: rts
.ENDIF
;------------------------------------------------------------------------------
; SPRITE CURSOR ROUTINES
;------------------------------------------------------------------------------
setupSpriteCursor:
ldx #$00
: lda @cursor,x
sta SPR00_Y,x
inx
cpx #(5 *4)
bcc :-
rts
@cursor: ; Y CH AT X
.BYTE $23,$01,$00,$0C ;0
.BYTE $23,$02,$00,$14 ;1
.BYTE $2B,$03,$00,$0C ;2
.BYTE $2B,$04,$00,$14 ;3
.BYTE $20,$05,$02,$20 ;4
editorUpdateCursor:
ldx editorCursorMode
bne :+
lda #240
sta SPR00_Y
sta SPR01_Y
sta SPR02_Y
sta SPR03_Y
rts
: lda #$01
sta SPR00_CHAR
lda #$02
sta SPR01_CHAR
cpx #$05
bcc :+
lda #$00
sta SPR00_CHAR
sta SPR01_CHAR
:
lda editorCursorX
sta SPR00_X
sta SPR02_X
clc
adc @cursorModeXOffsets,x
sta SPR01_X
sta SPR03_X
lda editorCursorY
sta SPR00_Y
sta SPR01_Y
clc
adc @cursorModeYOffsets,x
sta SPR02_Y
sta SPR03_Y
rts
@cursorModeXOffsets:
.BYTE $00
.BYTE $0A,$12,$1B,$3A,$0A
@cursorModeYOffsets:
.BYTE $00
.BYTE $0A,$09,$09,$09,$0A
editorFlashCursor:
lda #CURSOR_HOLD_COLOUR
sta cursorFlashColour
lda keyRepeatA
ora keyRepeatB
beq @b
rts
; lda editBufferFlag
; bne @b
; lda editNavFlag
; bne @d
;@c: rts
@b: ldx cursorFlashIndex
lda cursorFlashColours,x
sta cursorFlashColour
inx
cpx #cursorFlashColoursEnd-cursorFlashColours
bcc @a
ldx #$00
@a: stx cursorFlashIndex
rts
cursorFlashColours:
;.RES 5,$30
.RES 3,$30
.RES 3,$30+CURSOR_BASE_COLOUR
.RES 2,$20+CURSOR_BASE_COLOUR
.RES 1,$10+CURSOR_BASE_COLOUR
;.RES 1,$00+CURSOR_BASE_COLOUR
.RES 6,$0F
;.RES 1,$00+CURSOR_BASE_COLOUR
.RES 2,$10+CURSOR_BASE_COLOUR
.RES 4,$20+CURSOR_BASE_COLOUR
.RES 6,$30+CURSOR_BASE_COLOUR
cursorFlashColoursEnd:
editorUpdateTriggerIndexCursor:
ldx cursorY_grid
lda editorTriggerIndex,x
tay
lda @triggerIndexY,y
sta SPR04_Y
lda #TRIGGER_CURSOR_X_BASE
sta SPR04_X
rts
@triggerIndexY:
.REPEAT 5,i
.BYTE TRIGGER_CURSOR_Y_BASE + (8 * i)
.ENDREPEAT
editorUpdateTrackIndexCursor:
ldx cursorY_grid
lda @trackCursorY,x
sta SPR0F_Y
lda #9*8
sta SPR0F_X
rts
@trackCursorY:
.BYTE 9*8-2,10*8-2,11*8-2,12*8-2,13*8-2,14*8-2
editorInitVoiceSwitchSprites:
ldx #$00
: lda @sprites,x
sta SPR05_Y,x
inx
cpx #(27 * 4)
bcc :-
rts
@sprites: .BYTE 19*8,SPR_VOICE_OFF,$01,14*8 ;5 drum voice switches
.BYTE 19*8,SPR_VOICE_OFF,$01,28*8 ;6
.BYTE 24*8,SPR_VOICE_OFF,$01,11*8 ;7
.BYTE 24*8,SPR_VOICE_OFF,$01,15*8 ;8
.BYTE 24*8,SPR_VOICE_OFF,$01,28*8 ;9
.BYTE 17*8,$00,%00100010,4*8 ;A hints
.BYTE 17*8,$00,%00100010,5*8 ;B
.BYTE 17*8,$00,%00100010,5*8 ;C
.BYTE 9*8-1,$0A,%00100010,9*8-1 ;D track wipe anim
.BYTE 8*8,$0B,%00100000,10*8 ;E step indicator
.BYTE 9*8-2,$09,%00000010,9*8 ;F track index
.BYTE 9*8-1,$10,%00100011,3*8 ;10 mute/solo/activity
.BYTE 10*8-1,$10,%00100011,3*8 ;11
.BYTE 11*8-1,$10,%00100011,3*8 ;12
.BYTE 12*8-1,$10,%00100011,3*8 ;13
.BYTE 13*8-1,$10,%00100011,3*8 ;14
.BYTE 14*8-1,$10,%00100011,3*8 ;15
.BYTE 0,$00,%00000010,0 ;16
.BYTE 0,$00,%00000010,0 ;17
.BYTE 0,$00,%00000010,0 ;18
.BYTE 0,$00,%00000010,0 ;19
.BYTE 4*8-1,$20,%00000001,13*8 ;1A play mode
.BYTE 4*8-1,$21,%00000001,14*8 ;1B
.BYTE 4*8-1,$30,%00100000,5*8 ;1C ghost cursor
.BYTE 4*8-1,$30,%00100000,6*8 ;1D
.BYTE 4*8-1,$30,%00100000,8*8 ;1E
.BYTE 4*8-1,$30,%00100000,9*8 ;1F
editorShowTimer:
lda editSongMode
cmp #SONG_MODE_OFF
bne :+
lda plyrCurrentPattern
ldx #$00
jsr @printHexSpr
lda patternIndex
ldx #$08
jsr @printHexSpr
rts
: lda plyrSongBar
ldx #$00
jsr @printHexSpr
lda plyrCurrentPattern
ldx #$08
jsr @printHexSpr
rts
@printHexSpr:
cmp #$FF
beq :+
pha
lsr a
lsr a
lsr a
lsr a
clc
adc #$30
sta SPR1C_CHAR,x
pla
and #$0F
clc
adc #$30
sta SPR1D_CHAR,x
rts
: lda #$0F
sta SPR1C_CHAR,x
sta SPR1D_CHAR,x
rts
editorShowSongMode:
ldx editSongMode
lda @chr0,x
sta SPR1A_CHAR
lda @chr1,x
sta SPR1B_CHAR
lda @attr,x
sta SPR1A_ATTR
sta SPR1B_ATTR
rts
@chr0: .BYTE $20,$22,$24
@chr1: .BYTE $21,$23,$25
@attr: .BYTE $01,$03,$00
trackWipeSpeed = 3
trackWipeX = 9*8-4
trackWipeY = 9*8-1
editorTrackWipeSprites:
lda editorTrackWipeSpeed
bne :+
sta SPR0D_CHAR
rts
: clc
adc SPR0D_X
sta SPR0D_X
cmp #26*8
bcs :+
lda #$0A
sta SPR0D_CHAR
ldx cursorY_grid
lda @wipeY,x
sta SPR0D_Y
rts
: lda #$00
sta editorTrackWipeSpeed
lda #trackWipeX
sta SPR0D_X
rts
@wipeY: .REPEAT 6,i
.BYTE trackWipeY+(i *8)
.ENDREPEAT
editorStepIndicator:
ldx patternIndex
bpl :+
ldx #$00
: lda #8*8
sta SPR0E_Y
lda @indicatorY,x
sta SPR0E_X
rts
@indicatorY: .REPEAT 16,i
.BYTE 10*8 + (i * 8)
.ENDREPEAT
editorMeters:
inc editorMuteFlashIndex
lda editorMuteFlashIndex
cmp #(@muteSpritesEnd-@muteSprites)
bcc :+
lda #$00
sta editorMuteFlashIndex
: lda editorSoloChannel
bmi @noSolo
ldx #$00
: cpx editorSoloChannel
beq :+++
lda editorChannelStatus,x
bne :+
pha
beq :++
: ldy editorMuteFlashIndex
lda @muteSprites,y
pha
: txa
asl a
asl a
tay
pla
sta SPR10_CHAR,y
lda #$00
beq :++
: lda editorMeterCounters,x
tay
lda @meterSprites,y
pha
txa
asl a
asl a
tay
pla
clc
adc #$08
sta SPR10_CHAR,y
: lda editorMeterCounters,x
beq :++
clc
adc #$01
cmp #@meterSpritesEnd-@meterSprites
bcc :+
lda #$00
: sta editorMeterCounters,x
: inx
cpx #numberOfTracks
bcc :-------
rts
@noSolo: ldx #$00
: lda editorChannelStatus,x
bne :+
lda #$00
bpl :++
: lda editorMeterCounters,x
tay
lda @meterSprites,y
: pha
txa
asl a
asl a
tay
pla
sta SPR10_CHAR,y
lda editorMeterCounters,x
beq :++
clc
adc #$01
cmp #@meterSpritesEnd-@meterSprites
bcc :+
lda #$00
: sta editorMeterCounters,x
: inx
cpx #numberOfTracks
bcc :-----
rts
@meterSprites:
.BYTE $17,$10,$11,$12,$13,$14,$15,$16,$17
@meterSpritesEnd:
.BYTE $00
@muteSprites:
.BYTE $17,$17,$17,$17,$17
.REPEAT 32
.BYTE $00
.ENDREPEAT
@muteSpritesEnd:
HINT_X_BASE = (4*8)+4
HINT_Y_BASE = (17*8)-1
HINT_CHR_DARK = $0C
HINT_CHR_LIGHT = $0D
editorShowParameterHint:
lda vblankFlag
and #%00001000
sta editorTmp2
lda vblankFlag
and #%00000011
bne :+
lda editorMultiHintIndex
clc
adc #$01
and #$03
sta editorMultiHintIndex
:
lda #HINT_CHR_DARK
sta SPR0A_CHAR
sta SPR0B_CHAR
sta SPR0C_CHAR
lda #240
sta SPR0A_Y
sta SPR0B_Y
sta SPR0C_Y
lda #WRAM_DRUMS
jsr setMMC1r1
ldx editorCurrentDrum
lda drumAddressLo,x
sta editorTmp0
lda drumAddressHi,x
sta editorTmp1
lda editorMode
cmp #EDIT_MODE_DRUM_AUX
bne :+
lda editorDrumAuxIndex
beq :+
sec
sbc #$01
bpl :++
: ldx cursorY_grid
lda editorTriggerIndex,x
beq :++
cmp #$02
bcc :++
sbc #$02
: asl a
asl a
tax
lda #HINT_CHR_LIGHT
sta SPR0A_CHAR,x
: ldy #mod_Parameter0
lda (editorTmp0),y
bmi :+
jsr @checkMulti
tax
lda #HINT_X_BASE
clc
adc auxHintXOffsets,x
sta SPR0A_X
lda #HINT_Y_BASE
clc
adc auxHintYOffsets,x
sta SPR0A_Y
: ldy #mod_Parameter1
lda (editorTmp0),y
bmi :+
jsr @checkMulti
tax
lda #HINT_X_BASE
clc
adc auxHintXOffsets,x
sta SPR0B_X
lda #HINT_Y_BASE
clc
adc auxHintYOffsets,x
sta SPR0B_Y
: ldy #mod_Parameter2
lda (editorTmp0),y
bmi :+
jsr @checkMulti
tax
lda #HINT_X_BASE
clc
adc auxHintXOffsets,x
sta SPR0C_X
lda #HINT_Y_BASE
clc
adc auxHintYOffsets,x
sta SPR0C_Y
: rts
;MLD = $29 $03,$0E,$18,$0E
;MLS = $2A $04,$0F,$19,$0F
;MLW = $2B $05,$10,$1A,$10
;
;MAV = $2C $06,$11,$21,$11
;MAE = $2D $07,$12,$22,$12
;MAT = $2D $08,$13,$1C,$23
;
@checkMulti: cmp #$29
bcc :+
sec
sbc #$29
asl a
asl a
clc
adc editorMultiHintIndex
tax
lda @multiIndexes,x
rts
: ldy editorTmp2
bne :+
lda #$29
: rts
@multiIndexes: .BYTE $03,$0E,$18,$2a
.BYTE $04,$0F,$19,$2a
.BYTE $05,$10,$1A,$2a
.BYTE $06,$11,$21,$2a
.BYTE $07,$12,$22,$2a
.BYTE $08,$13,$1C,$23
auxHintXOffsets:
.BYTE $00,$00,$00, $18,$18,$18, $30,$30,$30, $48,$48
.BYTE $70,$70,$70, $88,$88,$88, $A0,$A0,$A0, $B8,$B8
.BYTE $00,$00, $18,$18,$18, $30,$30
.BYTE $50, $68,$68,$68, $80,$80,$80
.BYTE $A0,$A0,$A0, $B8,$B8
.BYTE $00,$00,$00,$00,$00,$00
auxHintYOffsets:
.BYTE $00,$08,$10, $00,$08,$10, $00,$08,$10, $00,$08
.BYTE $00,$08,$10, $00,$08,$10, $00,$08,$10, $00,$08
.BYTE $28,$30, $28,$30,$38, $28,$30
.BYTE $28, $28,$30,$38, $28,$30,$38
.BYTE $28,$30,$38, $28,$30
.BYTE 240-(17*8)
.BYTE 240-(17*8)
.BYTE 240-(17*8)
.BYTE 240-(17*8)
.BYTE 240-(17*8)
.BYTE 240-(17*8)
.BYTE 240-(17*8)
editorGhostCursor:
ldx #$00
lda editorMode
cmp #EDIT_MODE_TRIGGER_PARAMETER
beq :+
stx SPR16_CHAR
stx SPR17_CHAR
stx SPR18_CHAR
stx SPR19_CHAR
rts
: inx
stx SPR16_CHAR
inx
stx SPR17_CHAR
inx
stx SPR18_CHAR
inx
stx SPR19_CHAR
rts
;------------------------------------------------------------------------------
;
;------------------------------------------------------------------------------
editorInitCopyInfo:
ldx #$00
stx editorCopyInfoTimer
jsr editorSetPlayBackMessage
rts
editorCheckCopyInfoMessage:
lda editorCopyInfoTimer
beq :+
cmp #$FF
beq :++
dec editorCopyInfoTimer
bne :+
ldx editSongMode
lda @infoModes,x
tax
jsr editorSetPlayBackMessage
lda #procCopyInfoAll
jsr addProcessToBuffer
rts
: lda editSongMode
beq :+
: rts
@infoModes: .BYTE MSG_PTRN,MSG_SONG,MSG_SONG
@printHex: pha
lsr a
lsr a
lsr a
lsr a
clc
adc #$30
sta scnCopyInfoBuffer,y
iny
pla
and #$0F
clc
adc #$30
sta scnCopyInfoBuffer,y
iny
rts
editorSetPlayBackMessage:
lda infoTextIndexes,x
tax
ldy #$00
: lda infoMessages,x
sta scnCopyInfoBuffer,y
inx
iny
cpy #12
bcc :-
rts
editorSetErrorMessage:
pha
lda infoTextIndexes,x
tax
ldy #$00
: lda infoMessages,x
sta scnCopyInfoBuffer,y
inx
iny
cpy #12
bcc :-
pla
sta editorCopyInfoTimer
lda #procCopyInfoAll
jsr addProcessToBuffer
rts
editorSetCopyInfoMessage:
pha
lda infoTextIndexes,x
tax
ldy #$00
: lda infoMessages,x
sta scnCopyInfoBuffer,y
inx
iny
cpy #12
bcc :-
pla
ldy #$04
jsr @printHex
lda #$60
sta editorCopyInfoTimer
lda #procCopyInfoAll