-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWave_OrnamentPlot.s
More file actions
149 lines (136 loc) · 2.37 KB
/
Wave_OrnamentPlot.s
File metadata and controls
149 lines (136 loc) · 2.37 KB
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
;Wave_OrnamentPlot.s
; 0123456789012345678901234567890123456789
;18 --SAMPLES--+---VOL-SEQ F----+-ORNAMENT--
;19 00 Sample01|00 +N +E +T P+05|00 L +00 XX
;20 01 Sample02|01 +N +E +T P+05|01 +01 XX
;21 02 Sample03|02 +N +E +T P+05|02 -01 XX
;22 03 Sample04|03 +N +E +T P+05|03 --- XX
;23 04 Sample05|04 +N +E +T P+05|04 --- XX
;24 05 Sample06|05 +N +E +T P+05|05 --- XX
;25 06 Sample07|06 +N +E +T P+05|06 --- XX
;26 07 Sample08|07 +N +E +T P+05|07 --- XX
DisplayOrnamentID
lda #<$BB80+37+40*18
sta screen
lda #>$BB80+37+40*18
sta screen+1
lda OrnamentID
ldx #128
ldy #00
jmp Display1DH
;Ornaments
;Split into header and data areas
;Data(Up to 32 bytes)
; B0-6
; 0-127 Offset
; B7
; 0 Note Offset(-128 to +127)
; 1 End(End(0) or Loop back offset(1-127))
OrnamentCursorPlot
ldx OrnamentCursorY
lda OrnamentScreenRowAddressLo,x
sta screen
lda OrnamentScreenRowAddressHi,x
sta screen+1
ldy #8
.(
loop1 lda (screen),y
ora #128
sta (screen),y
dey
bpl loop1
.)
rts
OrnamentScreenRowAddressLo
.byt <$BB80+28+40*19
.byt <$BB80+28+40*20
.byt <$BB80+28+40*21
.byt <$BB80+28+40*22
.byt <$BB80+28+40*23
.byt <$BB80+28+40*24
.byt <$BB80+28+40*25
.byt <$BB80+28+40*26
OrnamentScreenRowAddressHi
.byt >$BB80+28+40*19
.byt >$BB80+28+40*20
.byt >$BB80+28+40*21
.byt >$BB80+28+40*22
.byt >$BB80+28+40*23
.byt >$BB80+28+40*24
.byt >$BB80+28+40*25
.byt >$BB80+28+40*26
OrnamentPlot
;
lda #<$BB80+28+40*19
sta screen
lda #>$BB80+28+40*19
sta screen+1
;Calculate ornament address into source
jsr FetchOrnamentAddress
lda #8
sta ScreenRows
ldy OrnamentBaseIndex
sty SourceIndex
.(
loop1 ;Display sign
ldy SourceIndex
lda (ornament),y
beq skip3
ldy #5
ldx #00
jsr DisplaySigned8DD
jmp skip2
skip3 ldy #5
lda #8
sta (screen),y
iny
sta (screen),y
iny
sta (screen),y
iny
sta (screen),y
skip2 ;Display Ornament Index
lda SourceIndex
ldy #00
ldx #00
jsr Display2DD
ldy #2
lda #1
sta (screen),y
ldy #4
lda #6
sta (screen),y
;Display Loop Flag
lda #"L"
ldx OrnamentID
ldy mmOrnamentLoops,x
cpy SourceIndex
beq skip1
lda #8
skip1 ldy #3
sta (screen),y
jsr nl_screen
inc SourceIndex
dec ScreenRows
bne loop1
.)
rts
FetchOrnamentAddress
lda OrnamentID
asl
asl
asl
asl
asl
sta ornament
lda #>mmOrnamentMemory
adc #00
sta ornament+1
lda ornament
adc #<mmOrnamentMemory
sta ornament
.(
bcc skip1
inc ornament+1
skip1 rts
.)