Files
pokegold-spaceworld/home/clear_sprites.asm
luckytyphlosion e1659ecd41 Introduce linkerscript.
Addresses of sections will now be added to the linkerscript via `org`, and the section name will be the path/to/file. If there is more than one section in the file, then add a @SectionName after the path/to/file to describe the section.
2018-07-03 17:07:05 -04:00

29 lines
474 B
NASM

INCLUDE "constants.asm"
; if DEBUG
SECTION "home/clear_sprites.asm", ROM0
; else
; SECTION "Sprite clearing", ROM0[$32A0]
; endc
ClearSprites:: ; 32dc
ld hl, wVirtualOAM
ld b, wVirtualOAMEnd - wVirtualOAM
xor a
.loop
ld [hli], a
dec b
jr nz, .loop
ret
HideSprites:: ; 32e7
ld hl, wVirtualOAM
ld de, SPRITEOAMSTRUCT_LENGTH
ld b, NUM_SPRITE_OAM_STRUCTS
ld a, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS
.loop
ld [hl], a
add hl, de
dec b
jr nz, .loop
ret