diff options
author | mid-kid <esteve.varela@gmail.com> | 2018-07-15 11:58:10 +0200 |
---|---|---|
committer | mid-kid <esteve.varela@gmail.com> | 2018-07-18 10:55:30 +0200 |
commit | 23708441effabc167439724ee3d81a6f5ca84a76 (patch) | |
tree | ebacb4fba3a93ec30bf1d84adc550a02081d9044 | |
parent | 04d0490c4c55366220310b9b8e1c4a181e07d842 (diff) |
Make proper cmdqueue constants
-rw-r--r-- | constants/script_constants.asm | 10 | ||||
-rw-r--r-- | engine/overworld/events.asm | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/constants/script_constants.asm b/constants/script_constants.asm index 35f988c4e..a31394a36 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -119,8 +119,14 @@ CMDQUEUE_05 EQU 5 CMDQUEUE_ENTRY_SIZE EQU 6 CMDQUEUE_CAPACITY EQU 4 -; command queue types -CMDQUEUE_STONETABLE EQU 2 +; HandleQueuedCommand.Jumptable indexes (see engine/overworld/events.asm) + const_def + const CMDQUEUE_NULL + const CMDQUEUE_NULL2 + const CMDQUEUE_STONETABLE + const CMDQUEUE_TYPE3 + const CMDQUEUE_TYPE4 +NUM_CMDQUEUE_TYPES EQU const_value ; elevfloor macro values ; ElevatorFloorNames indexes (see data/events/elevator_floors.asm) diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 707d31e66..e4defbc2b 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -1336,8 +1336,8 @@ DoBikeStep:: ClearCmdQueue:: ld hl, wCmdQueue - ld de, 6 - ld c, 4 + ld de, CMDQUEUE_ENTRY_SIZE + ld c, CMDQUEUE_CAPACITY xor a .loop ld [hl], a @@ -1443,7 +1443,7 @@ HandleQueuedCommand: ld hl, CMDQUEUE_TYPE add hl, bc ld a, [hl] - cp 5 + cp NUM_CMDQUEUE_TYPES jr c, .okay xor a |