diff options
Diffstat (limited to 'engine/overworld')
-rwxr-xr-x | engine/overworld/card_key.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/doors.asm | 55 | ||||
-rwxr-xr-x | engine/overworld/ledges.asm | 26 | ||||
-rwxr-xr-x | engine/overworld/npc_movement.asm | 88 | ||||
-rwxr-xr-x | engine/overworld/pewter_guys.asm | 8 |
5 files changed, 76 insertions, 103 deletions
diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index f601a951..48b2380d 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -74,7 +74,7 @@ SilphCoMapList: ; 52645 (14:6645) CardKeySuccessText: ; 52650 (14:6650) TX_FAR _CardKeySuccessText1 - db $0b + TX_SFX_ITEM TX_FAR _CardKeySuccessText2 db "@" diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index 6b0c0464..8ec9772a 100755 --- a/engine/overworld/doors.asm +++ b/engine/overworld/doors.asm @@ -25,33 +25,21 @@ IsPlayerStandingOnDoorTile: ; 1a609 (6:6609) and a ret -DoorTileIDPointers: ; 1a62c (6:662c) - db OVERWORLD - dw OverworldDoorTileIDs - db FOREST - dw ForestDoorTileIDs - db MART - dw MartDoorTileIDs - db HOUSE - dw HouseDoorTileIDs - db FOREST_GATE - dw TilesetMuseumDoorTileIDs - db MUSEUM - dw TilesetMuseumDoorTileIDs - db GATE - dw TilesetMuseumDoorTileIDs - db SHIP - dw ShipDoorTileIDs - db LOBBY - dw LobbyDoorTileIDs - db MANSION - dw MansionDoorTileIDs - db LAB - dw LabDoorTileIDs - db FACILITY - dw FacilityDoorTileIDs - db PLATEAU - dw PlateauDoorTileIDs +DoorTileIDPointers: ; 1a7a8 (6:67a8) + dbw OVERWORLD, OverworldDoorTileIDs + dbw FOREST, ForestDoorTileIDs + dbw MART, MartDoorTileIDs + dbw HOUSE, HouseDoorTileIDs + dbw FOREST_GATE, TilesetMuseumDoorTileIDs + dbw MUSEUM, TilesetMuseumDoorTileIDs + dbw GATE, TilesetMuseumDoorTileIDs + dbw SHIP, ShipDoorTileIDs + dbw LOBBY, LobbyDoorTileIDs + dbw MANSION, MansionDoorTileIDs + dbw LAB, LabDoorTileIDs + dbw FACILITY, FacilityDoorTileIDs + dbw PLATEAU, PlateauDoorTileIDs + dbw INTERIOR, InteriorDoorTileIDs db $ff OverworldDoorTileIDs: ; 1a654 (6:6654) @@ -72,17 +60,20 @@ TilesetMuseumDoorTileIDs: ; 1a65d (6:665d) ShipDoorTileIDs: ; 1a65f (6:665f) db $1e,$00 -LobbyDoorTileIDs: ; 1a661 (6:6661) +LobbyDoorTileIDs: ; 1a7e0 (6:67e0) db $1c,$38,$1a,$00 -MansionDoorTileIDs: ; 1a665 (6:6665) +MansionDoorTileIDs: ; 1a7e4 (6:67e4) db $1a,$1c,$53,$00 -LabDoorTileIDs: ; 1a669 (6:6669) +LabDoorTileIDs: ; 1a7e8 (6:67e8) db $34,$00 -FacilityDoorTileIDs: ; 1a66b (6:666b) +FacilityDoorTileIDs: ; 1a7ea (6:67ea) db $43,$58,$1b,$00 -PlateauDoorTileIDs: ; 1a66f (6:666f) +PlateauDoorTileIDs: ; 1a7ee (6:67ee) db $3b,$1b,$00 + +InteriorDoorTileIDs: ; 1a7f1 (6:67f1) + db $04,$15,$00 diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index b04f6332..a6ebd9be 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -1,4 +1,4 @@ -HandleLedges: ; 1a672 (6:6672) +HandleLedges: ; 1a7f4 (6:67f4) ld a, [wd736] bit 6, a ; already jumping down ledge ret nz @@ -55,7 +55,7 @@ HandleLedges: ; 1a672 (6:6672) ret ; (player direction) (tile player standing on) (ledge tile) (input required) -LedgeTiles: ; 1a6cf (6:66cf) +LedgeTiles: ; 1a851 (6:6851) db SPRITE_FACING_DOWN, $2C,$37,D_DOWN db SPRITE_FACING_DOWN, $39,$36,D_DOWN db SPRITE_FACING_DOWN, $39,$37,D_DOWN @@ -66,21 +66,25 @@ LedgeTiles: ; 1a6cf (6:66cf) db SPRITE_FACING_RIGHT,$39,$0D,D_RIGHT db $FF -LoadHoppingShadowOAM: ; 1a6f0 (6:66f0) +LoadHoppingShadowOAM: ; 1a872 (6:6872) ld hl, vChars1 + $7f0 ld de, LedgeHoppingShadow lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 call CopyVideoDataDouble - ld a, $9 - lb bc, $54, $48 ; b, c = y, x coordinates of shadow - ld de, LedgeHoppingShadowOAM - call WriteOAMBlock + ld hl, LedgeHoppingShadowOAM + ld de, wOAMBuffer + 36 * 4 + ld bc, LedgeHoppingShadowOAMEnd - LedgeHoppingShadowOAM + call CopyData + ld a, $a0 + ld [wOAMBuffer + 38 * 4], a + ld [wOAMBuffer + 39 * 4], a ret -LedgeHoppingShadow: ; 1a708 (6:6708) +LedgeHoppingShadow: ; 1a893 (6:6893) INCBIN "gfx/ledge_hopping_shadow.1bpp" LedgeHoppingShadowEnd: -LedgeHoppingShadowOAM: ; 1a710 (6:6710) - db $FF,$10,$FF,$20 - db $FF,$40,$FF,$60 +LedgeHoppingShadowOAM: ; 1a89b (6:689b) + db $58,$48,$FF,$00 + db $58,$50,$FF,$20 +LedgeHoppingShadowOAMEnd: ; 1a8a3 (6:68a3) diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index 719c8835..58eb6a47 100755 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -27,7 +27,7 @@ PlayerStepOutFromDoor: ; 1a3e0 (6:63e0) res 7, [hl] ret -_EndNPCMovementScript: ; 1a41d (6:641d) +_EndNPCMovementScript: ; 1a527 (6:6527) ld hl, wd730 res 7, [hl] ld hl, wd72e @@ -37,21 +37,21 @@ _EndNPCMovementScript: ; 1a41d (6:641d) res 1, [hl] xor a ld [wNPCMovementScriptSpriteOffset], a - ld [wNPCMovementScriptPointerTableNum], a ld [wNPCMovementScriptFunctionNum], a + ld [wNPCMovementScriptPointerTableNum], a ld [wWastedByteCD3A], a ld [wSimulatedJoypadStatesIndex], a ld [wSimulatedJoypadStatesEnd], a ret -PalletMovementScriptPointerTable: ; 1a442 (6:6442) +PalletMovementScriptPointerTable: ; 1a54c (6:654c) dw PalletMovementScript_OakMoveLeft dw PalletMovementScript_PlayerMoveLeft dw PalletMovementScript_WaitAndWalkToLab dw PalletMovementScript_WalkToLab dw PalletMovementScript_Done -PalletMovementScript_OakMoveLeft: ; 1a44c (6:644c) +PalletMovementScript_OakMoveLeft: ; 1a556 (6:6556) ld a, [wXCoord] sub $a ld [wNumStepsToTake], a @@ -79,13 +79,17 @@ PalletMovementScript_OakMoveLeft: ; 1a44c (6:644c) ld a, $3 ld [wNPCMovementScriptFunctionNum], a .done + ld a, BANK(Music_MuseumGuy) + ld c, a + ld a, MUSIC_MUSEUM_GUY + call PlayMusic ld hl, wFlags_D733 set 1, [hl] ld a, $fc ld [wJoyIgnore], a ret -PalletMovementScript_PlayerMoveLeft: ; 1a485 (6:6485) +PalletMovementScript_PlayerMoveLeft: ; 1a597 (6:6597) ld a, [wd730] bit 0, a ; is an NPC being moved by a script? ret nz ; return if Oak is still moving @@ -98,12 +102,12 @@ PalletMovementScript_PlayerMoveLeft: ; 1a485 (6:6485) ld [wNPCMovementScriptFunctionNum], a ret -PalletMovementScript_WaitAndWalkToLab: ; 1a4a1 (6:64a1) +PalletMovementScript_WaitAndWalkToLab: ; 1a5b3 (6:65b3) ld a, [wSimulatedJoypadStatesIndex] and a ; is the player done moving left yet? ret nz -PalletMovementScript_WalkToLab: ; 1a4a6 (6:64a6) +PalletMovementScript_WalkToLab: ; 1a5b8 (6:65b8) xor a ld [wOverrideSimulatedJoypadStatesMask], a ld a, [wSpriteIndex] @@ -127,8 +131,9 @@ PalletMovementScript_WalkToLab: ; 1a4a6 (6:64a6) ld [wNPCMovementScriptFunctionNum], a ret -RLEList_ProfOakWalkToLab: ; 1a4dc (6:64dc) - db NPC_MOVEMENT_DOWN, $05 + +RLEList_ProfOakWalkToLab: ; 1a5ee (6:65ee) + db NPC_MOVEMENT_DOWN, $06 ; differs from red db NPC_MOVEMENT_LEFT, $01 db NPC_MOVEMENT_DOWN, $05 db NPC_MOVEMENT_RIGHT, $03 @@ -136,15 +141,15 @@ RLEList_ProfOakWalkToLab: ; 1a4dc (6:64dc) db $E0, $01 ; stand still db $FF -RLEList_PlayerWalkToLab: ; 1a4e9 (6:64e9) +RLEList_PlayerWalkToLab: ; 1a5fb (6:65fb) db D_UP, $02 db D_RIGHT, $03 db D_DOWN, $05 db D_LEFT, $01 - db D_DOWN, $06 + db D_DOWN, $07 ; differs from red db $FF -PalletMovementScript_Done: ; 1a4f4 (6:64f4) +PalletMovementScript_Done: ; 1a606 (6:6606) ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -157,17 +162,15 @@ PalletMovementScript_Done: ; 1a4f4 (6:64f4) res 7, [hl] jp EndNPCMovementScript -PewterMuseumGuyMovementScriptPointerTable: ; 1a510 (6:6510) +PewterMuseumGuyMovementScriptPointerTable: ; 1a622 (6:6622) dw PewterMovementScript_WalkToMuseum dw PewterMovementScript_Done -PewterMovementScript_WalkToMuseum: ; 1a514 (6:6514) +PewterMovementScript_WalkToMuseum: ; 1a626 (6:6626) ld a, BANK(Music_MuseumGuy) - ld [wAudioROMBank], a - ld [wAudioSavedROMBank], a + ld c, a ld a, MUSIC_MUSEUM_GUY - ld [wNewSoundID], a - call PlaySound + call PlayMusic ld a, [wSpriteIndex] swap a ld [wNPCMovementScriptSpriteOffset], a @@ -179,7 +182,7 @@ PewterMovementScript_WalkToMuseum: ; 1a514 (6:6514) ld [wSimulatedJoypadStatesIndex], a xor a ld [wWhichPewterGuy], a - predef PewterGuys + call PewterGuys ld hl, wNPCMovementDirections2 ld de, RLEList_PewterMuseumGuy call DecodeRLEList @@ -189,21 +192,21 @@ PewterMovementScript_WalkToMuseum: ; 1a514 (6:6514) ld [wNPCMovementScriptFunctionNum], a ret -RLEList_PewterMuseumPlayer: ; 1a559 (6:6559) +RLEList_PewterMuseumPlayer: ; 1a661 (6:6661) db 0, $01 db D_UP, $03 db D_LEFT, $0D db D_UP, $06 db $FF -RLEList_PewterMuseumGuy: ; 1a562 (6:6562) +RLEList_PewterMuseumGuy: ; 1a66a (6:666a) db NPC_MOVEMENT_UP, $06 db NPC_MOVEMENT_LEFT, $0D db NPC_MOVEMENT_UP, $03 db NPC_MOVEMENT_LEFT, $01 db $FF -PewterMovementScript_Done: ; 1a56b (6:656b) +PewterMovementScript_Done: ; 1a673 (6:6673) ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -213,17 +216,15 @@ PewterMovementScript_Done: ; 1a56b (6:656b) res 7, [hl] jp EndNPCMovementScript -PewterGymGuyMovementScriptPointerTable: ; 1a57d (6:657d) +PewterGymGuyMovementScriptPointerTable: ; 1a685 (6:6685) dw PewterMovementScript_WalkToGym dw PewterMovementScript_Done -PewterMovementScript_WalkToGym: ; 1a581 (6:6581) +PewterMovementScript_WalkToGym: ; 1a689 (6:6689) ld a, BANK(Music_MuseumGuy) - ld [wAudioROMBank], a - ld [wAudioSavedROMBank], a + ld c, a ld a, MUSIC_MUSEUM_GUY - ld [wNewSoundID], a - call PlaySound + call PlayMusic ld a, [wSpriteIndex] swap a ld [wNPCMovementScriptSpriteOffset], a @@ -236,7 +237,7 @@ PewterMovementScript_WalkToGym: ; 1a581 (6:6581) ld [wSimulatedJoypadStatesIndex], a ld a, 1 ld [wWhichPewterGuy], a - predef PewterGuys + call PewterGuys ld hl, wNPCMovementDirections2 ld de, RLEList_PewterGymGuy call DecodeRLEList @@ -248,7 +249,7 @@ PewterMovementScript_WalkToGym: ; 1a581 (6:6581) ld [wNPCMovementScriptFunctionNum], a ret -RLEList_PewterGymPlayer: ; 1a5cd (6:65cd) +RLEList_PewterGymPlayer: ; 1a6cb (6:66cb) db 0, $01 db D_RIGHT, $02 db D_DOWN, $05 @@ -257,7 +258,7 @@ RLEList_PewterGymPlayer: ; 1a5cd (6:65cd) db D_LEFT, $0F db $FF -RLEList_PewterGymGuy: ; 1a5da (6:65da) +RLEList_PewterGymGuy: ; 1a6cd8(6:66d8) db NPC_MOVEMENT_DOWN, $02 db NPC_MOVEMENT_LEFT, $0F db NPC_MOVEMENT_UP, $05 @@ -266,27 +267,4 @@ RLEList_PewterGymGuy: ; 1a5da (6:65da) db NPC_MOVEMENT_RIGHT, $03 db $FF -FreezeEnemyTrainerSprite: ; 1a5e7 (6:65e7) - ld a, [wCurMap] - cp POKEMONTOWER_7 - ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them - ld hl, RivalIDs - ld a, [wEngagedTrainerClass] - ld b, a -.loop - ld a, [hli] - cp $ff - jr z, .notRival - cp b - ret z ; the rival leaves after battling, so don't freeze him - jr .loop -.notRival - ld a, [wSpriteIndex] - ld [H_SPRITEINDEX], a - jp SetSpriteMovementBytesToFF - -RivalIDs: ; 1a605 (6:6605) - db OPP_SONY1 - db OPP_SONY2 - db OPP_SONY3 - db $ff +INCLUDE "engine/overworld/pewter_guys.asm" diff --git a/engine/overworld/pewter_guys.asm b/engine/overworld/pewter_guys.asm index 543dac91..ff3c6152 100755 --- a/engine/overworld/pewter_guys.asm +++ b/engine/overworld/pewter_guys.asm @@ -1,4 +1,4 @@ -PewterGuys: ; 37ca1 (d:7ca1) +PewterGuys: ; 1a6e5 (6:66e5) ld hl, wSimulatedJoypadStatesEnd ld a, [wSimulatedJoypadStatesIndex] dec a ; this decrement causes it to overwrite the last byte before $FF in the list @@ -48,14 +48,14 @@ PewterGuys: ; 37ca1 (d:7ca1) inc hl jr .findMatchingCoordsLoop -PointerTable_37ce6: ; 37ce6 (d:7ce6) +PointerTable_37ce6: ; 1a72a (6:672a) dw PewterMuseumGuyCoords dw PewterGymGuyCoords ; these are the four coordinates of the spaces below, above, to the left and ; to the right of the museum guy, and pointers to different movements for ; the player to make to get positioned before the main movement. -PewterMuseumGuyCoords: ; 37cea (d:7cea) +PewterMuseumGuyCoords: ; 1a72e (6:672e) db 18, 27 dw .down db 16, 27 @@ -78,7 +78,7 @@ PewterMuseumGuyCoords: ; 37cea (d:7cea) ; different movements for the player to make to get positioned before the ; main movement ; $00 is a pause -PewterGymGuyCoords: ; 37d06 (d:7d06) +PewterGymGuyCoords: ; 1a74a (6:674a) db 16, 34 dw .one db 17, 35 |