mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-09-29 14:02:22 -04:00
c8e9901947
- Lowercase hex literals - Lowercase rgbasm keywords (rept, endr) - Use decimal literals by default, binary when bits are meaningful; hex indicates that it needs further review, e.g. to define a constant - Tabs, not spaces - Newline at end of file (rgbds sometimes complains otherwise) - Doc comments underneath function names
23 lines
376 B
NASM
23 lines
376 B
NASM
INCLUDE "constants.asm"
|
|
|
|
SECTION "Delay", ROM0[$0317]
|
|
|
|
DelayFrame::
|
|
; Wait for one frame
|
|
ld a, 1
|
|
ld [wVBlankOccurred], a
|
|
.halt
|
|
; Wait for the next VBlank, halting to conserve battery
|
|
halt ; rgbasm adds a nop after this instruction by default
|
|
ld a, [wVBlankOccurred]
|
|
and a
|
|
jr nz, .halt
|
|
ret
|
|
|
|
DelayFrames::
|
|
; Wait c frames
|
|
call DelayFrame
|
|
dec c
|
|
jr nz, DelayFrames
|
|
ret
|