Make proper cmdqueue constants

This commit is contained in:
mid-kid
2018-07-15 11:58:10 +02:00
parent 04d0490c4c
commit 23708441ef
2 changed files with 11 additions and 5 deletions

View File

@@ -119,8 +119,14 @@ CMDQUEUE_05 EQU 5
CMDQUEUE_ENTRY_SIZE EQU 6 CMDQUEUE_ENTRY_SIZE EQU 6
CMDQUEUE_CAPACITY EQU 4 CMDQUEUE_CAPACITY EQU 4
; command queue types ; HandleQueuedCommand.Jumptable indexes (see engine/overworld/events.asm)
CMDQUEUE_STONETABLE EQU 2 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 ; elevfloor macro values
; ElevatorFloorNames indexes (see data/events/elevator_floors.asm) ; ElevatorFloorNames indexes (see data/events/elevator_floors.asm)

View File

@@ -1336,8 +1336,8 @@ DoBikeStep::
ClearCmdQueue:: ClearCmdQueue::
ld hl, wCmdQueue ld hl, wCmdQueue
ld de, 6 ld de, CMDQUEUE_ENTRY_SIZE
ld c, 4 ld c, CMDQUEUE_CAPACITY
xor a xor a
.loop .loop
ld [hl], a ld [hl], a
@@ -1443,7 +1443,7 @@ HandleQueuedCommand:
ld hl, CMDQUEUE_TYPE ld hl, CMDQUEUE_TYPE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp 5 cp NUM_CMDQUEUE_TYPES
jr c, .okay jr c, .okay
xor a xor a