diff options
author | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-15 20:10:54 -0500 |
---|---|---|
committer | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-15 20:10:54 -0500 |
commit | 1038ebca5e2638ecbce1052c1dad7474372a7fd5 (patch) | |
tree | 7bc9722faff9aa68ab1e5dc0960f9ce35da6bbec /engine/collision_stdscripts.asm | |
parent | 606817f18b67a7d033adad31cbbea19d2e05e98e (diff) |
Move more contiguous related code blocks from main.asm to engine/ and events/
Diffstat (limited to 'engine/collision_stdscripts.asm')
-rw-r--r-- | engine/collision_stdscripts.asm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/engine/collision_stdscripts.asm b/engine/collision_stdscripts.asm new file mode 100644 index 000000000..17b1e49b2 --- /dev/null +++ b/engine/collision_stdscripts.asm @@ -0,0 +1,29 @@ +CheckFacingTileForStd:: ; 1365b +; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry. + ld a, c + ld de, 3 + ld hl, TileCollisionStdScripts + call IsInArray + jr nc, .notintable + + ld a, jumpstd_command + ld [wJumpStdScriptBuffer], a + inc hl + ld a, [hli] + ld [wJumpStdScriptBuffer + 1], a + ld a, [hli] + ld [wJumpStdScriptBuffer + 2], a + ld a, BANK(Script_JumpStdFromRAM) + ld hl, Script_JumpStdFromRAM + call CallScript + scf + ret + +.notintable + xor a + ret + +INCLUDE "data/collision_stdscripts.asm" + +Script_JumpStdFromRAM: ; 0x1369a + jump wJumpStdScriptBuffer |