summaryrefslogtreecommitdiff
path: root/home/clear_sprites.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2018-04-09 21:30:24 -0400
committerGitHub <noreply@github.com>2018-04-09 21:30:24 -0400
commit40b537d45b4b8937038126f7e5d2d21ccee460c0 (patch)
tree881a090b80b2c22985fc6d1231b03c6721a83462 /home/clear_sprites.asm
parente4b41fad4fd3787ca2e61adb5377ba8f68fca7ef (diff)
parent53ff57ca663dc5bf9c3731022b0eb0dc73f2207f (diff)
Merge pull request #503 from Rangi42/master
Factor wMisc into meaningful parts; move most code out of home.asm
Diffstat (limited to 'home/clear_sprites.asm')
-rw-r--r--home/clear_sprites.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/home/clear_sprites.asm b/home/clear_sprites.asm
new file mode 100644
index 000000000..8d64c6b10
--- /dev/null
+++ b/home/clear_sprites.asm
@@ -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