summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/effect_commands.asm2
-rw-r--r--engine/gfx/load_push_oam.asm23
2 files changed, 16 insertions, 9 deletions
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 336d66e62..94d8d7615 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -2520,7 +2520,7 @@ EndMoveEffect:
ld l, a
ld a, [wBattleScriptBufferAddress + 1]
ld h, a
- ld a, $ff
+ ld a, endmove_command
ld [hli], a
ld [hli], a
ld [hl], a
diff --git a/engine/gfx/load_push_oam.asm b/engine/gfx/load_push_oam.asm
index 2e43c1ffe..395188817 100644
--- a/engine/gfx/load_push_oam.asm
+++ b/engine/gfx/load_push_oam.asm
@@ -1,21 +1,28 @@
WriteOAMDMACodeToHRAM::
ld c, LOW(hTransferVirtualOAM)
- ld b, .PushOAMEnd - .PushOAM
- ld hl, .PushOAM
-.loop
+ ld b, OAMDMACodeEnd - OAMDMACode
+ ld hl, OAMDMACode
+.copy
ld a, [hli]
ldh [c], a
inc c
dec b
- jr nz, .loop
+ jr nz, .copy
ret
-.PushOAM:
+OAMDMACode:
+; This code is defined in ROM, but
+; copied to and called from HRAM.
+LOAD "OAM DMA", HRAM
+hTransferVirtualOAM::
+ ; initiate DMA
ld a, HIGH(wVirtualOAM)
ldh [rDMA], a
+ ; wait for DMA to finish
ld a, NUM_SPRITE_OAM_STRUCTS
-.pushoam_loop
+.wait
dec a
- jr nz, .pushoam_loop
+ jr nz, .wait
ret
-.PushOAMEnd
+ENDL
+OAMDMACodeEnd: