forked from Pigu-A/nobankskank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3_title.asm
executable file
·210 lines (194 loc) · 3.14 KB
/
3_title.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
; Part 3: Demo title art
.include "gvars.asm"
SDMCTL = $22f
SDLSTL = $230
* = partEntry_3
start
mva #$22, SDMCTL ; enable dlist dma, normal pf
mwa #dlist, SDLSTL
jsr disnmi
mwa #vbi, rNMI
mva #$c0, rNMIEN ; vblank + dlist
loop
inc vbkreq
- lda vbkreq
bne -
dec cnt
bne loop
mva #3, cnt
jsr scene0 ; update scene-specific variables
scefunc = *-2
ldx #13
- lda hues,x
- sub #$10
beq - ; skip gray ($0x) hue
sta hues,x
lda lums,x
sub dims,x
bcs +
lda #0
beq ++
+ ora hues,x
+ sta pals,x
dex
bpl --
jmp loop
cnt .byte 3
bne +
mwa #scene1, scefunc
+ rts
scene0
ldx #13
- lda dims,x
beq +
dec dims,x
+ dex
bpl -
lda zCurMsxOrd
cmp #$0a
bcc _skip
lda zCurMsxRow
bne _skip
mwa #scene1, scefunc
_skip
rts
scene1
lda zCurMsxOrd
cmp #$0b
bne +
pla ; pop return address so the stack points
pla ; to the loader's return address instead
+ lda zCurMsxRow
cmp #$28
bcc +
ldx #0
- lda dims+1,x
sta dims,x
inx
cpx #13
bne -
inc dims+13
+ rts
vbi
sta nmiA
stx nmiX
sty nmiY
bit rNMIST
bpl +
jmp psw0
VDSLST = *-2
+
mva SDMCTL, rDMACTL
mwa SDLSTL, rDLISTL
mva >#tiledat, rCHBASE
jsr updateMusic
mva #0, vbkreq
retdli
lda nmiA
ldx nmiX
ldy nmiY
rti
vbkreq .byte 0
psw0
lda pals
ldx pals+1
ldy pals+2
sta rWSYNC
sta rCOLPF0
stx rCOLPF1
sty rCOLPF2
mwa #psw1, VDSLST
gne retdli
psw1
lda pals+3
ldx pals+4
ldy pals+5
sta rWSYNC
sta rCOLPF0
stx rCOLPF1
sty rCOLPF3
mwa #csw0, VDSLST
gne retdli
csw0
lda >(#tiledat+$400)
sta rWSYNC
sta rCHBASE
mwa #psw2, VDSLST
gne retdli
psw2
lda pals+5
ldx pals+6
ldy pals+7
sta rWSYNC
sta rCOLPF2
stx rCOLPF0
sty rCOLPF1
mva pals+8, rCOLPF3
mwa #psw3, VDSLST
gne retdli
psw3
lda pals+6
ldx pals+7
ldy pals+8
sta rWSYNC
sta rCOLPF2
stx rCOLPF0
sty rCOLPF1
mva pals+9, rCOLPF3
mwa #psw4csw1, VDSLST
gne retdli
psw4csw1
lda pals+8
ldx pals+9
ldy pals+10
sta rWSYNC
sta rCOLPF2
stx rCOLPF0
sty rCOLPF1
mva pals+11, rCOLPF3
mva >(#tiledat+$800), rCHBASE
mwa #psw5, VDSLST
gne retdli
psw5
lda pals+9
ldx pals+10
ldy pals+11
sta rWSYNC
sta rCOLPF2
stx rCOLPF0
sty rCOLPF1
mva pals+12, rCOLPF3
mwa #psw6, VDSLST
gne retdli
psw6
lda pals+11
ldx pals+12
ldy pals+13
sta rWSYNC
sta rCOLPF2
stx rCOLPF0
sty rCOLPF1
mwa #psw0, VDSLST
gne retdli
pals .fill 14
dims .byte 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11
hues .byte $b0,$40,$70,$60,$90,$30,$20,$10,$e0,$d0,$c0,$b0,$a0,$90
lums .byte $0c,$0c,$0c,$0c,$0c,$0a,$0a,$0a,$0a,$0a,$0a,$0a,$0a,$0a
dlist
.byte $70 ; 10 blank lines
.byte $90 ; pal swap 0
.byte $45 ; 13 mode 5
.word tilemap
.byte $05, $85 ; pal swap 1
.byte $05, $85 ; char swap 0
.byte $85 ; pal swap 2
.byte $05, $85 ; pal swap 3
.byte $85 ; pal swap 4 + char swap 1
.byte $05, $85 ; pal swap 5
.byte $85, $05 ; pal swap 6
.byte $41 ; jvb
.word dlist
tilemap .binary "gfx/nbsk_map.bin"
.align $400
tiledat .binary "gfx/nbsk.2bpp"
.warn format("Part 3's memory usage: %#04x - %#04x", start, *)