Move more code from home.asm into home/

This commit is contained in:
Rangi
2018-04-05 00:35:14 -04:00
parent 1e1bbbbf8c
commit 99df17d571
18 changed files with 1349 additions and 1361 deletions

25
home/clear_sprites.asm Normal file
View File

@@ -0,0 +1,25 @@
ClearSprites:: ; 300b
; Erase OAM data
ld hl, wVirtualOAM
ld b, wVirtualOAMEnd - wVirtualOAM
xor a
.loop
ld [hli], a
dec b
jr nz, .loop
ret
; 3016
HideSprites:: ; 3016
; Set all OAM y-positions to 160 to hide them offscreen
ld hl, wVirtualOAMSprite00YCoord
ld de, SPRITEOAMSTRUCT_LENGTH
ld b, NUM_SPRITE_OAM_STRUCTS
ld a, SCREEN_WIDTH_PX
.loop
ld [hl], a ; y
add hl, de
dec b
jr nz, .loop
ret
; 3026