This repository has been archived by the owner on Jun 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunclist.txt
304 lines (248 loc) · 7.53 KB
/
funclist.txt
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
LIST OF FUNCTIONS IN AEVILIA GB
This document's purpose is to provide a quick overview of all of Aevilia GB's functions, or at least the most common ones.
All registers not listed under a function's effects are preserved.
rst waitVBlank
restarts.asm
Waits until next VBlank.
Requires VBlank interrupt to be active.
- Modifies a.
rst isVBlanking
restarts.asm
Sets C if and only if VBlanking (except for last scanline).
- Modifies a.
rst isVRAMOpen
restarts.asm
Sets Z if and only if VRAM can be safely accessed.
- Modifies a.
rst fill
restarts.asm
Fills c bytes, starting at hl, with a.
- Zeroes c.
- Modifies hl.
rst copy
restarts.asm
Copies c bytes from hl to de.
- Zeroes c.
- Modifies hl and de.
- Modifies a.
rst bankswitch
restarts.asm
Switches to ROM bank a (and registers switch in HRAM).
ALWAYS use this to bankswitch !
- Preserves all registers.
rst copyStr
restarts.asm
Copies bytes from hl to de, up to and including the first $00 (NULL) byte.
- Modifies hl and de.
- Zeroes a.
rst callHL
restarts.asm
Emulates "call [hl]", but crashes if hl doesn't point to ROM.
- Passes all registers intact to the callee.
VBlankHandler
handlers.asm
Handles a VBlank interrupt.
- Modifies a and bc.
- If interrupt vector, caller should save a and bc before calling !
- Doesn't re-enable interrupts by itself, should be done by caller.
UpdateJoypadState
handlers.asm
Polls the hardware to update hHeldButtons and hPressedButtons. (And performs soft-reset)
- Modifies a and bc.
- Usually called by VBlankHandler, but may be used from any context.
PollJoypad
handlers.asm
Polls the hardware and returns polled keys in a.
- Modifies a.
- Caller should have set bits 4 or 5 before calling this !
- Subfunction of UpdateJoypadState, but may be called from any other context if needed.
DMAScript
handlers.asm
Performs an OAM DMA and waits until it has completed.
- Zeroes b.
- MUST be in HRAM when called ! Otherwise... welp, crash :D
- To achieve desired effect, call with c = $46 (rDMA & $FF) and a = (SourceOAM >> 8).
STATHandler
handlers.asm
Handles a STAT interrupt.
- Currently only designed for textbox LY=LYC interrupt.
- Modifies a.
Fill
home/utilities.asm
Fills bc bytes starting at hl with a.
- Zeroes bc and a.
- Modifies hl.
Copy
home/utilities.asm
Copies bc bytes from de to hl.
- Zeroes bc.
- Modifies de and hl.
- Modifies a.
FillVRAMLite
home/utilities.asm
Fills c bytes starting at hl with a.
- Waits when VRAM can't be accessed.
- Zeroes c.
- Modifies d and hl.
CopyToVRAM
home/utilities.asm
Copies bc bytes from de to hl.
- Doesn't copy when VRAM can't be accessed.
- Zeroes bc.
- Modifies de and hl.
- Modifies a.
CopyStrToVRAM
home/utilities.asm
Copies bytes from hl to de, up to and including the first $00 (NULL) byte.
- Doesn't copy when VRAM can't be accessed.
- Zeroes bc.
- Modifies de and hl.
- Zeroes a.
OpenSRAM
home/utilities.asm
Performs a write to ROM to unlock SRAM.
- Sets a to $0A.
- Please don't mind the hackish "db $D6" that saves one byte and maybe nothing in processor time.
CloseSRAM
home/utilities.asm
Performs a write to ROM to lock SRAM.
- Zeroes a.
DelayBCFrames
home/utilities.asm
Waits for bc frames to go by.
- Zeroes a and bc.
- To delay by a single frame, consider using rst waitVBlank instead.
CallAcrossBanks
home/utilities.asm
Call [b:hl] (call the routine in bank b at address hl).
- Use this when the caller and the callee are in switchable ROM space and in different banks.
- Only c and de are passed to the callee.
CopyAcrossLite
home/utilities.asm
Copy c bytes in bank b starting at hl to de.
- Zeroes c.
- Modifies hl and de.
- Modifies a.
CopyStrAcross
home/utilities.asm
Copy bytes in bank b starting at hl to de up to and including the first $00 (NULL) byte.
- Modifies a, hl and de.
- Preserves bc... yup. Somehow.
SaveCurRAMBank
home/utilities.asm
Push the current RAM bank ID on the stack.
- Modifies hl.
RestoreRAMBank
home/utilities.asm
Used in conjunction with SaveCurRAMBank. I'll let you guess what it does.
- Modifies a.
- Modifies hl.
PreventJoypadMovement
home/utilities.asm
Increments the joypad movement prevention counter.
- Cannot overflow.
- Modifies a.
AllowJoypadMovement
home/utilities.asm
Decrements the joypad movement prevention counter.
- Cannot underflow.
- Modifies a.
SpeedUpCPU
home/utilities.asm
Switches to CPU double speed mode.
- Modifies a.
SlowDownCPU
home/utilities.asm
Switches to CPU normal speed mode.
- Modifies a.
MultiplyDEByA
home/utilities2.asm
Multiplies de by a and puts the result into hl.
- Detecting overflow would be quite a pain... ensure it doesn't happen, instead.
- Zeroes a.
- Modifies de.
DivideHLByDE
home/utilities2.asm
Divides hl by de and puts the result into bc.
- The remainder can be obtained in hl by adding de to hl.
- Causes an error screen if trying to divide by zero. Won't softlock :)
- Modifies a and hl.
DivideHLByDE_KnownDE
home/utilities2.asm
Performs DivideHLByDE but skips the "division by zero" check.
- Use only if de is certain to be non-zero before the call. The check is quick enough.
_AtHL_FatalError
home/utilities2.asm
Where "rst callHL" jumps to trap jumps to RAM.
FatalError
home/utilities2.asm
Prints a fatal error screen.
- Call with error message ID in a.
- Save a before that by loading it into wSaveA.
CopyAcross
home/utilities2.asm
Copy bc bytes in bank a from hl to de.
- Zeroes bc.
- Modifies hl and de.
- Modifies a.
CopyAcrossToVRAM
home/utilities2.asm
Copy bc bytes in bank a from hl to de.
- Doesn't copy when VRAM can't be accessed.
- Modifies hl and de.
- Modifies a.
SwitchRAMBanks
home/utilities2.asm
Switches to WRAM bank a.
- Preserves all registers.
SwitchROMBanks
home/utilities2.asm
Saves the current ROM bank on the stack, then switches to ROM bank b.
- Modifies hl.
- Modifies a.
RestoreROMBank
home/utilities2.asm
Pops a ROM bank ID from the stack, and switches to that ROM bank.
- Modifies hl.
- Modifies a.
LoadOBJPalette
gfx/graphics.asm
Loads OBJ palette #a with the colors pointed to by hl.
- Modifies all registers.
LoadOBJPalette_Hook
gfx/graphics.asm
Loads OBJ palette #c with the colors pointed to by de.
- See LoadOBJPalette.
LoadBGPalette
gfx/graphics.asm
Loads BG palette #a with the colors pointed to by hl.
- Modifies all registers.
LoadBGPalette_Hook
gfx/graphics.asm
Loads BG palette #c with the colors pointed to by de.
- See LoadBGPalette.
TransitionToFixedMap
gfx/graphics.asm
Copies the currrently displayed tiles (from free mode) and their attributes to the fixed tilemap.
- Also sets the tilemap mode to fixed map.
- Assumes the current tilemap mode is free mode.
- Modifies all registers.
CopyToFixedMap
gfx/graphics.asm
Subfunction of TransitionToFixedMap. Copies the data in one VRAM bank.
- All dashes from TransitionToFixedMap apply here.
EnableTextbox
gfx/graphics.asm
Makes the text box do its appearing animation.
- Even if the text box is already up... or going down.
- Modifies a.
WaitForTextbox
gfx/graphics.asm
Waits until the text box has fully appeared.
- Will wait even if the text box is closed or closing...
- Modifies a.
DisableTextbox
gfx/graphics.asm
Starts the text box's disappearing animation, and waits until it has been completed.
- I recommend using this instead of just setting bit 7, because it's a potential mine of bugs.
- Zeroes a.