diff options
Diffstat (limited to 'engine/overworld')
-rw-r--r-- | engine/overworld/events.asm | 45 | ||||
-rw-r--r-- | engine/overworld/map_objects.asm | 22 | ||||
-rw-r--r-- | engine/overworld/map_objects_2.asm | 2 | ||||
-rw-r--r-- | engine/overworld/npc_movement.asm | 4 | ||||
-rw-r--r-- | engine/overworld/overworld.asm | 2 | ||||
-rw-r--r-- | engine/overworld/player_movement.asm | 16 | ||||
-rw-r--r-- | engine/overworld/player_object.asm | 16 | ||||
-rw-r--r-- | engine/overworld/scripting.asm | 14 |
8 files changed, 61 insertions, 60 deletions
diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 178a889a3..d4c6ec0bf 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -759,40 +759,41 @@ PlayerMovement: ret .pointers - dw .zero - dw .one - dw .two - dw .three - dw .four - dw .five - dw .six - dw .seven - -.zero -.four +; entries correspond to PLAYERMOVEMENT_* constants + dw .normal + dw .warp + dw .turn + dw .force_turn + dw .finish + dw .continue + dw .exit_water + dw .jump + +.normal: +.finish: xor a ld c, a ret -.seven +.jump: call ret_968d7 ; mobile xor a ld c, a ret -.one - ld a, 5 +.warp: + ld a, PLAYEREVENT_WARP ld c, a scf ret -.two - ld a, 9 +.turn: + ld a, PLAYEREVENT_JOYCHANGEFACING ld c, a scf ret -.three +.force_turn: ; force the player to move in some direction ld a, BANK(Script_ForcedMovement) ld hl, Script_ForcedMovement @@ -802,8 +803,8 @@ PlayerMovement: scf ret -.five -.six +.continue: +.exit_water: ld a, -1 ld c, a and a @@ -923,13 +924,13 @@ CountStep: ret .hatch - ld a, 8 + ld a, PLAYEREVENT_HATCH scf ret ; unused .unreferenced - ld a, 7 + ld a, PLAYEREVENT_WHITEOUT scf ret @@ -1626,7 +1627,7 @@ CmdQueue_StoneTable: jr c, .fall_down_hole .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, de ld d, h ld e, l diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index 6a1c1a22b..16562213b 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -10,7 +10,7 @@ DeleteMapObject:: push af ld h, b ld l, c - ld bc, OBJECT_STRUCT_LENGTH + ld bc, OBJECT_LENGTH xor a call ByteFill pop af @@ -2082,11 +2082,11 @@ DespawnEmote: jr z, .next push bc xor a - ld bc, OBJECT_STRUCT_LENGTH + ld bc, OBJECT_LENGTH call ByteFill pop bc .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, de ld d, h ld e, l @@ -2149,7 +2149,7 @@ Function55e0:: jr z, .ok call Function565c .ok - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2205,7 +2205,7 @@ Function5645: .loop ldh [hMapObjectIndexBuffer], a call SetFacing_Standing - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2421,7 +2421,7 @@ HandleNPCStep:: jr z, .next call Function437b .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2582,7 +2582,7 @@ Function587a: add hl, bc set OBJ_FLAGS2_5, [hl] .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2625,7 +2625,7 @@ Function58b9:: add hl, bc res OBJ_FLAGS2_5, [hl] .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2750,7 +2750,7 @@ ApplyBGMapAnchorToObjects: add e ld [hl], a .skip - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2809,7 +2809,7 @@ InitSprites: jr .add .skip - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2817,7 +2817,7 @@ InitSprites: jr .next .add - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l diff --git a/engine/overworld/map_objects_2.asm b/engine/overworld/map_objects_2.asm index f055e0fd9..d89d95fc0 100644 --- a/engine/overworld/map_objects_2.asm +++ b/engine/overworld/map_objects_2.asm @@ -19,7 +19,7 @@ LoadObjectMasks: ld [de], a inc de pop bc - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index d249d2fd4..f4c730247 100644 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -369,7 +369,7 @@ IsNPCAtCoord: jr nz, .setcarry .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -523,7 +523,7 @@ Unreferenced_Function7113: jr .yes .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l diff --git a/engine/overworld/overworld.asm b/engine/overworld/overworld.asm index e47645f2c..814f608f7 100644 --- a/engine/overworld/overworld.asm +++ b/engine/overworld/overworld.asm @@ -109,7 +109,7 @@ AddIndoorSprites: push af ld a, [hl] call AddSpriteGFX - ld de, OBJECT_LENGTH + ld de, MAPOBJECT_LENGTH add hl, de pop af inc a diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm index 09d6b47de..9f372640b 100644 --- a/engine/overworld/player_movement.asm +++ b/engine/overworld/player_movement.asm @@ -120,7 +120,7 @@ DoPlayerMovement:: ld c, a call CheckWhirlpoolTile jr c, .not_whirlpool - ld a, 3 + ld a, PLAYERMOVEMENT_FORCE_TURN scf ret @@ -222,7 +222,7 @@ DoPlayerMovement:: .continue_walk ld a, STEP_WALK call .DoStep - ld a, 5 + ld a, PLAYERMOVEMENT_CONTINUE scf ret @@ -247,7 +247,7 @@ DoPlayerMovement:: ld a, STEP_TURN call .DoStep - ld a, 2 + ld a, PLAYERMOVEMENT_TURN scf ret @@ -345,7 +345,7 @@ DoPlayerMovement:: call PlayMapMusic ld a, STEP_WALK call .DoStep - ld a, 6 + ld a, PLAYERMOVEMENT_EXIT_WATER scf ret @@ -374,7 +374,7 @@ DoPlayerMovement:: call PlaySFX ld a, STEP_LEDGE call .DoStep - ld a, 7 + ld a, PLAYERMOVEMENT_JUMP scf ret @@ -428,11 +428,11 @@ DoPlayerMovement:: call .StandInPlace scf - ld a, 1 + ld a, PLAYERMOVEMENT_WARP ret .not_warp - xor a + xor a ; PLAYERMOVEMENT_NORMAL ret .EdgeWarps: @@ -465,7 +465,7 @@ DoPlayerMovement:: ld a, [hl] ld [wPlayerTurningDirection], a - ld a, 4 + ld a, PLAYERMOVEMENT_FINISH ret .Steps: diff --git a/engine/overworld/player_object.asm b/engine/overworld/player_object.asm index 9f1b13dd9..478c8f6c6 100644 --- a/engine/overworld/player_object.asm +++ b/engine/overworld/player_object.asm @@ -132,9 +132,9 @@ CopyObjectStruct:: and a ret nz ; masked - ld hl, wObjectStructs + OBJECT_STRUCT_LENGTH * 1 + ld hl, wObjectStructs + OBJECT_LENGTH * 1 ld a, 1 - ld de, OBJECT_STRUCT_LENGTH + ld de, OBJECT_LENGTH .loop ldh [hObjectStructIndexBuffer], a ld a, [hl] @@ -224,7 +224,7 @@ CopyMapObjectToObjectStruct: ret InitializeVisibleSprites: - ld bc, wMapObjects + OBJECT_LENGTH + ld bc, wMapObjects + MAPOBJECT_LENGTH ld a, 1 .loop ldh [hMapObjectIndexBuffer], a @@ -271,7 +271,7 @@ InitializeVisibleSprites: jp c, .ret .next - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -311,7 +311,7 @@ CheckObjectEnteringVisibleRange:: ld d, a ld a, [wXCoord] ld e, a - ld bc, wMapObjects + OBJECT_LENGTH + ld bc, wMapObjects + MAPOBJECT_LENGTH ld a, 1 .loop_v ldh [hMapObjectIndexBuffer], a @@ -345,7 +345,7 @@ CheckObjectEnteringVisibleRange:: pop de .next_v - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -367,7 +367,7 @@ CheckObjectEnteringVisibleRange:: ld e, a ld a, [wYCoord] ld d, a - ld bc, wMapObjects + OBJECT_LENGTH + ld bc, wMapObjects + MAPOBJECT_LENGTH ld a, 1 .loop_h ldh [hMapObjectIndexBuffer], a @@ -401,7 +401,7 @@ CheckObjectEnteringVisibleRange:: pop de .next_h - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 128439205..245d8e763 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -148,7 +148,7 @@ ScriptCommandTable: dw Script_farjumptext ; 52 dw Script_jumptext ; 53 dw Script_waitbutton ; 54 - dw Script_buttonsound ; 55 + dw Script_promptbutton ; 55 dw Script_pokepic ; 56 dw Script_closepokepic ; 57 dw Script__2dmenu ; 58 @@ -398,7 +398,7 @@ Script_waitbutton: jp WaitButton -Script_buttonsound: +Script_promptbutton: ; script command 0x55 ldh a, [hOAMUpdate] @@ -406,7 +406,7 @@ Script_buttonsound: ld a, $1 ldh [hOAMUpdate], a call WaitBGMap - call ButtonSound + call PromptButton pop af ldh [hOAMUpdate], a ret @@ -525,7 +525,7 @@ GiveItemScript: end .Full: - buttonsound + promptbutton pocketisfull end @@ -1952,7 +1952,7 @@ Script_getmoney: call ResetStringBuffer1 call GetMoneyAccount ld hl, wStringBuffer1 - lb bc, PRINTNUM_RIGHTALIGN | 3, 6 + lb bc, PRINTNUM_LEFTALIGN | 3, 6 call PrintNum ld de, wStringBuffer1 jp GetStringBuffer @@ -1964,7 +1964,7 @@ Script_getcoins: call ResetStringBuffer1 ld hl, wStringBuffer1 ld de, wCoins - lb bc, PRINTNUM_RIGHTALIGN | 2, 6 + lb bc, PRINTNUM_LEFTALIGN | 2, 6 call PrintNum ld de, wStringBuffer1 jp GetStringBuffer @@ -1976,7 +1976,7 @@ Script_getnum: call ResetStringBuffer1 ld de, wScriptVar ld hl, wStringBuffer1 - lb bc, PRINTNUM_RIGHTALIGN | 1, 3 + lb bc, PRINTNUM_LEFTALIGN | 1, 3 call PrintNum ld de, wStringBuffer1 jp GetStringBuffer |