From 23708441effabc167439724ee3d81a6f5ca84a76 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 15 Jul 2018 11:58:10 +0200 Subject: [PATCH] Make proper cmdqueue constants --- constants/script_constants.asm | 10 ++++++++-- 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