-
Notifications
You must be signed in to change notification settings - Fork 0
/
chr.asm
197 lines (155 loc) · 4.84 KB
/
chr.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
;-------------------------------------------------------------------------------
; Needed macros
;-------------------------------------------------------------------------------
; A function that loads the art and returns it's chr bank id and offset in bank
ChrArt .function file
_ChrFile: .binary file
.endf {.bank: _ChrFile/CHRBankSize, .tile = (_ChrFile % CHRBankSize)/$10}
ChrBankStart .segment id=-1
.cwarn (\id != -1) && (*/CHRBankSize)!=\id, "Bank IDs do not match (expected id - " .. repr(floor(\id)) .. ", actual id - " .. repr(*/CHRBankSize) .. ")"
CHR_CurrentBankStart .var *
.endsegment \id
ChrBankEnd .function
BankID = */CHRBankSize
.cwarn Debug && (* % CHRBankSize)!=0, "CHR Bank " .. repr(bytes(BankID)) .. " is not full"
.cerror * > (CHR_CurrentBankStart+CHRBankSize), "CHR Bank " .. repr(bytes(BankID)) .. " is too big (actual size is " .. repr(*-CHR_CurrentBankStart) .. ", expected size is " .. repr(CHRBankSize) .. ")"
.align CHRBankSize
.endf
; TODO: add where needed
CHR_EmptyAndFilledTiles .macro
.fill 16, 0
.fill 16, $FF
.endm
CHR_FillUntil .macro addr
.fill \addr-(*%CHRBankSize)
.endm
;-------------------------------------------------------------------------------
; TODO: properly name all .chr files and add stuff to levels/ and characters/ folders
.cpu "65816" ; So we can use 3-byte addresses
.logical 0 ; Reset current address to 0
; Bank 0 - Texts
ChrBankStart 0
ChrArt "data/art/bank00.chr"
ChrBankEnd
CHR_BoardPieces_Static: ChrBankStart 1
ChrArt "data/art/bank01.chr"
ChrBankEnd
CHR_BoardPieces_Sprites:ChrBankStart 2
ChrArt "data/art/bank02.chr"
ChrBankEnd
ChrBankStart 3
ChrArt "data/art/bank03.chr"
ChrBankEnd
ChrBankStart 4
ChrArt "data/art/bank04.chr"
ChrBankEnd
ChrBankStart 5
ChrArt "data/art/bank05.chr"
ChrBankEnd
ChrBankStart 6
ChrArt "data/art/bank06.chr"
ChrBankEnd
ChrBankStart 7
ChrArt "data/art/bank07.chr"
ChrBankEnd
ChrBankStart 8
ChrArt "data/art/bank08.chr"
ChrBankEnd
ChrBankStart 9
ChrArt "data/art/bank09.chr"
ChrBankEnd
ChrBankStart $A
ChrArt "data/art/bank0A.chr"
ChrBankEnd
ChrBankStart $B
ChrArt "data/art/bank0B.chr"
ChrBankEnd
ChrBankStart $C
ChrArt "data/art/bank0C.chr"
ChrBankEnd
ChrBankStart $D
ChrArt "data/art/bank0D.chr"
ChrBankEnd
CHR_IntroCutscene: ChrBankStart $E
ChrArt "data/art/bank0E.chr"
ChrBankEnd
ChrBankStart $F
ChrArt "data/art/bank0F.chr"
ChrBankEnd
ChrBankStart $10
CHR_EmptyAndFilledTiles
Art_MechaGodzilla: ChrArt "data/art/bosses/MechaGodzilla.chr"
ChrBankEnd
ChrBankStart $11
CHR_EmptyAndFilledTiles
Art_Hedorah: ChrArt "data/art/bosses/Hedorah.chr"
CHR_FillUntil $F30
ChrArt "data/art/bosses/HedorahParticles.chr"
ChrBankEnd
ChrBankStart $12
CHR_EmptyAndFilledTiles
Art_Ghidora: ChrArt "data/art/bosses/Ghidora.chr"
ChrBankEnd
ChrBankStart $13
CHR_EmptyAndFilledTiles
Art_Gezora: ChrArt "data/art/bosses/Gezora.chr"
Art_Moguera: ChrArt "data/art/bosses/Moguera.chr"
CHR_FillUntil $F00
ChrArt "data/art/bosses/GezoraTentacle.chr"
ChrBankEnd
ChrBankStart $14
CHR_EmptyAndFilledTiles
Art_Varan: ChrArt "data/art/bosses/Varan.chr"
ChrBankEnd
ChrBankStart $15
CHR_EmptyAndFilledTiles
Art_Baragon: ChrArt "data/art/bosses/Baragon.chr"
ChrBankEnd
ChrBankStart $16
CHR_EmptyAndFilledTiles
Art_Gigan: ChrArt "data/art/bosses/Gigan.chr"
ChrBankEnd
ChrBankStart $17
ChrArt "data/art/bank17.chr"
ChrBankEnd
ChrBankStart $18
ChrArt "data/art/bank18.chr"
ChrBankEnd
ChrBankStart $19
CHR_EmptyAndFilledTiles
Art_BoldFont: ChrArt "data/art/BoldFont.chr"
Art_HUD = Art_BoldFont
Art_UranusSky: ChrArt "data/art/skies/UranusSky.chr"
Art_PlanetXSky: ChrArt "data/art/skies/PlanetXSky.chr"
Art_NeptuneSky: ChrArt "data/art/skies/NeptuneSky.chr"
ChrArt "data/art/bank19.chr"
ChrBankEnd
ChrBankStart $1A
CHR_EmptyAndFilledTiles
ChrArt "data/art/BoldFont.chr"
Art_TheEarthSky: ChrArt "data/art/skies/TheEarthSky.chr"
Art_SaturnSky: ChrArt "data/art/skies/SaturnSky.chr"
ChrArt "data/art/bank1A.chr"
ChrBankEnd
ChrBankStart $1B
CHR_EmptyAndFilledTiles
ChrArt "data/art/BoldFont.chr"
Art_PlutoSky: ChrArt "data/art/skies/PlutoSky.chr"
Art_MarsSky: ChrArt "data/art/skies/MarsSky.chr"
Art_JupiterSky: ChrArt "data/art/skies/JupiterSky.chr"
ChrArt "data/art/bank1B.chr"
ChrBankEnd
CHR_TitleScreen_Part1: ChrBankStart $1C
ChrArt "data/art/bank1C.chr"
ChrBankEnd
CHR_TitleScreen_Part2: ChrBankStart $1d
ChrArt "data/art/bank1D.chr"
ChrBankEnd
CHR_TitleScreen_Part3: ChrBankStart $1E
ChrArt "data/art/bank1E.chr"
ChrBankEnd
CHR_Gohten: ChrBankStart $1F
ChrArt "data/art/bank1F.chr"
ChrBankEnd
.cwarn (*/CHRBankSize) > CHRBankCount, "The actual number of CHR rom banks is greater than 'CHRBankCount' constant, change the constant and the iNES mapper if needed"
.endlogical