diff options
author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2020-07-22 09:11:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-22 09:11:19 -0400 |
commit | 1aea38fd3e660ed7eeb74be1a8ce5ca0ee512d6c (patch) | |
tree | c8131f981d29d8c9a7f1ec2feb86c023300dfe74 /engine | |
parent | d96f914315c6ab82d30facbc4a5be1710f3c4a33 (diff) | |
parent | bb25c1074c9926da7912b18c4cae309104671183 (diff) |
Merge pull request #745 from Rangi42/master
Use LOAD/ENDL for OAM DMA code in HRAM (requires rgbds 0.4.1)
Diffstat (limited to 'engine')
-rw-r--r-- | engine/battle/effect_commands.asm | 2 | ||||
-rw-r--r-- | engine/gfx/load_push_oam.asm | 23 |
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: |