-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathneslyric.asm
executable file
·175 lines (124 loc) · 3.52 KB
/
neslyric.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
;
; _/ _/
; _/_/_/ _/_/ _/_/_/ _/ _/ _/ _/ _/_/ _/_/_/
; _/ _/ _/_/_/_/ _/_/ _/ _/ _/ _/_/ _/ _/
; _/ _/ _/ _/_/ _/ _/ _/ _/ _/ _/
;_/ _/ _/_/_/ _/_/_/ _/ _/_/_/ _/ _/ _/_/_/
; _/
; _/_/
; neslyric 8-bit animation framework
; creative commons attribution
; by 0xabad1dea 2011
; INES header
.inesprg 4 ; don't touch unless you're taking off every zig
.ineschr 2 ; The number of 8KB CHR files, DO touch5
.inesmir 0 ; Yeah don't touch this.
.inesmap 4 ; mmc3, do not touch
;------------------------------------------------;
;---- bank usage record -------------------------;
; 0 0 $8000 the NSF
; 1 0 $a000 data.asm
; 2 0 $c000 events.asm
; 3 0 $e000 nmi.asm $f000 main.asm
; ---- chr ----
; 4.0 miku and teto logo
; 4.1 font
;;;; ---------- music bank
.bank 0
.org $8000
.incbin "res/popipo.nsf"
.bank 4 ; ugly hack for powerpak
.org $8000
.incbin "res/popipo.nsf"
.bank 1 ; ugly hack for powerpak
.org $a000
.include "data.asm"
.bank 2 ; ugly hack for powerpak
.org $8000
.incbin "res/silence.nsf"
.bank 3 ; ugly hack for powerpak
.org $8000
.incbin "res/silence.nsf"
;;;; ---------- graphics banks
; the first graphics bank starts numerically after the last prg bank
.bank 8
.org $0000
.incbin "res/miku-teto.chr" ; 0, 1
.bank 9
.org $0000
.incbin "res/font.chr" ; 2, 3
;;;; ---------- Reset Bank (final prg bank), runs first
.bank 7
.org $f000
.include "main.asm"
;;;; ---------- data bank
.bank 5
.org $8000
.incbin "res/silence.nsf"
;;;; ---------- event bank
.bank 6
.org $c000
.include "events.asm"
;;;; ---------- nmi, a part of this balanced breakfast
.bank 7
.org $e000
NMI_Routine:
.include "nmi.asm"
.org $FFA0
NMIResume:
;========== this chunk needs to be .orged at $FFA0 in every high bank
Music:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; lda Timer
; and #1
; cmp #1
; bne NMIEnd
NMIEnd:
;;;;
; temporary, until loading scroll values from events
; get this - I had this earlier in NMI and it didn't work (the ld/in/st) -
; what the heck, Nintendo? Why do you do this to me?
ldx XScroll
inx
stx XScroll
ldx YScroll
inx
stx YScroll
; scrolling
lda XScroll
sta $2005
lda #0
sta $2005
jsr $8084 ;sound_driver_start
rti
IRQ_Routine: ; sprite 0 interrupt will go here
lda #%00000000
sta $8000
lda #5 ; alphabet
sta $8001
lda #$2A ; color bias
sta $2001
;lda #$20
;sta $2006
lda #0
sta $2005
sta $2005
lda #$23
sta $2006
lda #$00
sta $2006
sta $e000
sta $e001
rti
.org $FFFA ; vectors
.dw NMI_Routine
.dw Reset_Routine
.dw IRQ_Routine
;##############################################################################
; variables, zp
.rsset $001B ; start the reserve counter past the nsf's greedy usage
Timer .rs 1 ; fractions of a second (every NMI)
SecondsTimer .rs 1 ; increments when Timer hits 60
Tmp .rs 1 ; what it says on the tin
XScroll .rs 1 ; ''
YScroll .rs 1 ; ''