From 69a0ce42ac81d96f48a0f8522efc4f195de04493 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Fri, 20 May 2016 23:32:54 -0400 Subject: Disassemble yellow sounds --- engine/overworld/card_key.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/overworld') diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index 2ef7529c..74c0d489 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -73,7 +73,7 @@ SilphCoMapList: ; 526e3 (14:66e3) CardKeySuccessText: ; 526ee (14:66ee) TX_FAR _CardKeySuccessText1 - db $0b + TX_SFX_ITEM TX_FAR _CardKeySuccessText2 db "@" -- cgit v1.3.1-sl0p From eeb058a23137bff0a7c046506cd448066500b608 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sat, 21 May 2016 22:45:53 -0400 Subject: Some work on disassembling npc movement scripts (aka informed copy/paste from red) --- audio/sfx/heal_ailment_4.asm | 7 ++ audio/sfx/tink_4.asm | 8 ++ audio/sfx/unknown_80263.asm | 4 + audio/sfx/unknown_8029f.asm | 10 +++ engine/overworld/npc_movement.asm | 176 +++++++------------------------------- home.asm | 2 +- main.asm | 14 +-- wram.asm | 5 +- 8 files changed, 65 insertions(+), 161 deletions(-) create mode 100755 audio/sfx/heal_ailment_4.asm create mode 100755 audio/sfx/tink_4.asm create mode 100755 audio/sfx/unknown_80263.asm create mode 100755 audio/sfx/unknown_8029f.asm (limited to 'engine/overworld') diff --git a/audio/sfx/heal_ailment_4.asm b/audio/sfx/heal_ailment_4.asm new file mode 100755 index 00000000..fd80517d --- /dev/null +++ b/audio/sfx/heal_ailment_4.asm @@ -0,0 +1,7 @@ +SFX_8027f_4_Ch4: + duty 2 + unknownsfx0x10 23 + unknownsfx0x20 15, 240, 240, 4 + unknownsfx0x20 15, 242, 80, 6 + unknownsfx0x10 8 + endchannel diff --git a/audio/sfx/tink_4.asm b/audio/sfx/tink_4.asm new file mode 100755 index 00000000..4efa3209 --- /dev/null +++ b/audio/sfx/tink_4.asm @@ -0,0 +1,8 @@ +SFX_8028e_4_Ch4: + duty 2 + unknownsfx0x10 58 + unknownsfx0x20 4, 242, 0, 2 + unknownsfx0x10 34 + unknownsfx0x20 8, 226, 0, 2 + unknownsfx0x10 8 + endchannel diff --git a/audio/sfx/unknown_80263.asm b/audio/sfx/unknown_80263.asm new file mode 100755 index 00000000..884c1352 --- /dev/null +++ b/audio/sfx/unknown_80263.asm @@ -0,0 +1,4 @@ +SFX_80263_4_Ch7: + unknownnoise0x20 1, 226, 51 + unknownnoise0x20 8, 225, 34 + endchannel diff --git a/audio/sfx/unknown_8029f.asm b/audio/sfx/unknown_8029f.asm new file mode 100755 index 00000000..475c2813 --- /dev/null +++ b/audio/sfx/unknown_8029f.asm @@ -0,0 +1,10 @@ +SFX_8029f_4_Ch7: + unknownnoise0x20 6, 241, 17 + unknownnoise0x20 7, 242, 34 + unknownnoise0x20 8, 243, 51 + unknownnoise0x20 9, 244, 66 + unknownnoise0x20 10, 245, 51 + unknownnoise0x20 11, 246, 34 + unknownnoise0x20 12, 247, 17 + endchannel + diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index 719c8835..5c86d94f 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,31 +79,37 @@ PalletMovementScript_OakMoveLeft: ; 1a44c (6:644c) ld a, $3 ld [wNPCMovementScriptFunctionNum], a .done + ld a, $2 + ld c, a + ld a, SFX_BATTLE_34 + 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 ld a, [wNumStepsToTake] ld [wSimulatedJoypadStatesIndex], a ld [hNPCMovementDirections2Index], a - predef ConvertNPCMovementDirectionsToJoypadMasks + ; predef ConvertNPCMovementDirectionsToJoypadMasks + ld a, $23 + call Predef call StartSimulatingJoypadStates ld a, $2 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 +133,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,157 +143,32 @@ 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 ld a, $0 ld [wMissableObjectIndex], a - predef HideObject - ld hl, wd730 - res 7, [hl] - ld hl, wd72e - res 7, [hl] - jp EndNPCMovementScript - -PewterMuseumGuyMovementScriptPointerTable: ; 1a510 (6:6510) - dw PewterMovementScript_WalkToMuseum - dw PewterMovementScript_Done - -PewterMovementScript_WalkToMuseum: ; 1a514 (6:6514) - ld a, BANK(Music_MuseumGuy) - ld [wAudioROMBank], a - ld [wAudioSavedROMBank], a - ld a, MUSIC_MUSEUM_GUY - ld [wNewSoundID], a - call PlaySound - ld a, [wSpriteIndex] - swap a - ld [wNPCMovementScriptSpriteOffset], a - call StartSimulatingJoypadStates - ld hl, wSimulatedJoypadStatesEnd - ld de, RLEList_PewterMuseumPlayer - call DecodeRLEList - dec a - ld [wSimulatedJoypadStatesIndex], a - xor a - ld [wWhichPewterGuy], a - predef PewterGuys - ld hl, wNPCMovementDirections2 - ld de, RLEList_PewterMuseumGuy - call DecodeRLEList - ld hl, wd72e - res 7, [hl] - ld a, $1 - ld [wNPCMovementScriptFunctionNum], a - ret - -RLEList_PewterMuseumPlayer: ; 1a559 (6:6559) - db 0, $01 - db D_UP, $03 - db D_LEFT, $0D - db D_UP, $06 - db $FF - -RLEList_PewterMuseumGuy: ; 1a562 (6:6562) - 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) - ld a, [wSimulatedJoypadStatesIndex] - and a - ret nz + ; predef HideObject + ld a, $11 + call Predef ld hl, wd730 res 7, [hl] ld hl, wd72e res 7, [hl] jp EndNPCMovementScript -PewterGymGuyMovementScriptPointerTable: ; 1a57d (6:657d) - dw PewterMovementScript_WalkToGym - dw PewterMovementScript_Done - -PewterMovementScript_WalkToGym: ; 1a581 (6:6581) - ld a, BANK(Music_MuseumGuy) - ld [wAudioROMBank], a - ld [wAudioSavedROMBank], a - ld a, MUSIC_MUSEUM_GUY - ld [wNewSoundID], a - call PlaySound - ld a, [wSpriteIndex] - swap a - ld [wNPCMovementScriptSpriteOffset], a - xor a - ld [wSpriteStateData2 + $06], a - ld hl, wSimulatedJoypadStatesEnd - ld de, RLEList_PewterGymPlayer - call DecodeRLEList - dec a - ld [wSimulatedJoypadStatesIndex], a - ld a, 1 - ld [wWhichPewterGuy], a - predef PewterGuys - ld hl, wNPCMovementDirections2 - ld de, RLEList_PewterGymGuy - call DecodeRLEList - ld hl, wd72e - res 7, [hl] - ld hl, wd730 - set 7, [hl] - ld a, $1 - ld [wNPCMovementScriptFunctionNum], a - ret - -RLEList_PewterGymPlayer: ; 1a5cd (6:65cd) - db 0, $01 - db D_RIGHT, $02 - db D_DOWN, $05 - db D_LEFT, $0B - db D_UP, $05 - db D_LEFT, $0F - db $FF - -RLEList_PewterGymGuy: ; 1a5da (6:65da) - db NPC_MOVEMENT_DOWN, $02 - db NPC_MOVEMENT_LEFT, $0F - db NPC_MOVEMENT_UP, $05 - db NPC_MOVEMENT_LEFT, $0B - db NPC_MOVEMENT_DOWN, $05 - 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 +PewterMuseumGuyMovementScriptPointerTable: ; 1a622 (6:6622) + dr $1a622,$1a685 +PewterGymGuyMovementScriptPointerTable: ; 1a685 (6:6685) + dr $1a685,$1a785 +IsPlayerStandingOnDoorTile: ; 1a785 (6:6785) + dr $1a785,$1a7f4 diff --git a/home.asm b/home.asm index c3942031..c8f227ef 100644 --- a/home.asm +++ b/home.asm @@ -2447,7 +2447,7 @@ RunNPCMovementScript:: ; 30ae (0:30ae) ret .NPCMovementScriptPointerTables - dw ProfOakMovementScriptPointerTable + dw PalletMovementScriptPointerTable dw PewterMuseumGuyMovementScriptPointerTable dw PewterGymGuyMovementScriptPointerTable .playerStepOutFromDoor diff --git a/main.asm b/main.asm index e9064d2b..2f08ff94 100755 --- a/main.asm +++ b/main.asm @@ -232,18 +232,8 @@ INCLUDE "engine/menu/pc.asm" SECTION "bank06",ROMX,BANK[$06] dr $18000,$1a4ea -PlayerStepOutFromDoor: ; 1a4ea (6:64ea) - dr $1a4ea,$1a527 -_EndNPCMovementScript: ; 1a527 (6:6527) - dr $1a527,$1a54c -ProfOakMovementScriptPointerTable: ; 1a54c (6:654c) - dr $1a54c,$1a622 -PewterMuseumGuyMovementScriptPointerTable: ; 1a622 (6:6622) - dr $1a622,$1a685 -PewterGymGuyMovementScriptPointerTable: ; 1a685 (6:6685) - dr $1a685,$1a785 -IsPlayerStandingOnDoorTile: ; 1a785 (6:6785) - dr $1a785,$1a7f4 + +INCLUDE "engine/overworld/npc_movement.asm" HandleLedges: ; 1a7f4 (6:67f4) dr $1a7f4,$1c000 diff --git a/wram.asm b/wram.asm index 6aa3ce32..3ba0c67b 100755 --- a/wram.asm +++ b/wram.asm @@ -3026,7 +3026,10 @@ wFlags_D733:: ; d733 wBeatLorelei:: ; d734 ; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby ; the game uses this to tell when Elite 4 events need to be reset - ds 2 + ds 1 + +wd735:: ; d735 + ds 1 wd736:: ; d736 ; bit 0: check if the player is standing on a door and make him walk down a step if so -- cgit v1.3.1-sl0p From f3f117cbf3be12adfaa0c3195266dfa9f6f8734b Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sat, 21 May 2016 22:54:46 -0400 Subject: Oh wait, there's predef_const declarations. Huh. --- engine/overworld/npc_movement.asm | 8 +- engine/predefs.asm | 199 +++++++++++++++++++------------------- 2 files changed, 101 insertions(+), 106 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index 5c86d94f..d7f2b1cd 100755 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -96,9 +96,7 @@ PalletMovementScript_PlayerMoveLeft: ; 1a597 (6:6597) ld a, [wNumStepsToTake] ld [wSimulatedJoypadStatesIndex], a ld [hNPCMovementDirections2Index], a - ; predef ConvertNPCMovementDirectionsToJoypadMasks - ld a, $23 - call Predef + predef ConvertNPCMovementDirectionsToJoypadMasks call StartSimulatingJoypadStates ld a, $2 ld [wNPCMovementScriptFunctionNum], a @@ -157,9 +155,7 @@ PalletMovementScript_Done: ; 1a606 (6:6606) ret nz ld a, $0 ld [wMissableObjectIndex], a - ; predef HideObject - ld a, $11 - call Predef + predef HideObject ld hl, wd730 res 7, [hl] ld hl, wd72e diff --git a/engine/predefs.asm b/engine/predefs.asm index fa6e29df..3ec98577 100755 --- a/engine/predefs.asm +++ b/engine/predefs.asm @@ -52,103 +52,102 @@ GetPredefPointer: ; f67ed (3d:67ed) PredefPointers:: ; f681d (3d:681d) ; these are pointers to ASM routines. ; they appear to be used in overworld map scripts. - dr $f681d,$f7000 - ;add_predef DrawPlayerHUDAndHPBar - ;add_predef CopyUncompressedPicToTilemap - ;add_predef Func_3f073 - ;add_predef ScaleSpriteByTwo - ;add_predef LoadMonBackPic - ;add_predef CopyDownscaledMonTiles - ;add_predef LoadMissableObjects - ;add_predef HealParty - ;add_predef MoveAnimation; 08 play move animation - ;add_predef DivideBCDPredef - ;add_predef DivideBCDPredef2 - ;add_predef AddBCDPredef - ;add_predef SubBCDPredef - ;add_predef DivideBCDPredef3 - ;add_predef DivideBCDPredef4 - ;add_predef InitPlayerData - ;add_predef FlagActionPredef - ;add_predef HideObject - ;add_predef IsObjectHidden - ;add_predef ApplyOutOfBattlePoisonDamage - ;add_predef AnyPartyAlive - ;add_predef ShowObject - ;add_predef ShowObject2 - ;add_predef ReplaceTileBlock - ;add_predef InitPlayerData2 - ;add_predef LoadTilesetHeader - ;add_predef LearnMoveFromLevelUp - ;add_predef LearnMove - ;add_predef IsItemInBag_ - ;dbw $03,CheckForHiddenObjectOrBookshelfOrCardKeyDoor ; for these two, the bank number is actually 0 - ;dbw $03,GiveItem - ;add_predef InvertBGPal_4Frames - ;add_predef FindPathToPlayer - ;add_predef Func_480ff - ;add_predef CalcPositionOfPlayerRelativeToNPC - ;add_predef ConvertNPCMovementDirectionsToJoypadMasks - ;add_predef Func_48125 - ;add_predef UpdateHPBar - ;add_predef HPBarLength - ;add_predef Diploma_TextBoxBorder - ;add_predef DoubleOrHalveSelectedStats - ;add_predef ShowPokedexMenu - ;add_predef EvolutionAfterBattle - ;add_predef SaveSAVtoSRAM0 - ;add_predef InitOpponent - ;add_predef CableClub_Run - ;add_predef DrawBadges - ;add_predef ExternalClockTradeAnim - ;add_predef BattleTransition - ;add_predef CopyTileIDsFromList - ;add_predef PlayIntro - ;add_predef Func_79869 - ;add_predef FlashScreen - ;add_predef GetTileAndCoordsInFrontOfPlayer - ;add_predef StatusScreen - ;add_predef StatusScreen2 - ;add_predef InternalClockTradeAnim - ;add_predef TrainerEngage - ;add_predef IndexToPokedex - ;add_predef DisplayPicCenteredOrUpperRight; 3B display pic? - ;add_predef UsedCut - ;add_predef ShowPokedexData - ;add_predef WriteMonMoves - ;add_predef SaveSAV - ;add_predef LoadSGB - ;add_predef MarkTownVisitedAndLoadMissableObjects - ;add_predef SetPartyMonTypes - ;add_predef CanLearnTM - ;add_predef TMToMove - ;add_predef Func_71ddf - ;add_predef StarterDex ; 46 - ;add_predef _AddPartyMon - ;add_predef UpdateHPBar2 - ;add_predef DrawEnemyHUDAndHPBar - ;add_predef LoadTownMap_Nest - ;add_predef PrintMonType - ;add_predef EmotionBubble; 4C player exclamation - ;add_predef EmptyFunc3; return immediately - ;add_predef AskName - ;add_predef PewterGuys - ;add_predef SaveSAVtoSRAM2 - ;add_predef LoadSAVCheckSum2 - ;add_predef LoadSAV - ;add_predef SaveSAVtoSRAM1 - ;add_predef DoInGameTradeDialogue ; 54 initiate trade - ;add_predef HallOfFamePC - ;add_predef DisplayDexRating - ;dbw $1E, _LeaveMapAnim ; wrong bank - ;dbw $1E, EnterMapAnim ; wrong bank - ;add_predef GetTileTwoStepsInFrontOfPlayer - ;add_predef CheckForCollisionWhenPushingBoulder - ;add_predef PrintStrengthTxt - ;add_predef PickupItem - ;add_predef PrintMoveType - ;add_predef LoadMovePPs - ;add_predef DrawHP ; 5F - ;add_predef DrawHP2 - ;add_predef Func_1c9c6 - ;add_predef OaksAideScript \ No newline at end of file + dbw BANK(DrawPlayerHUDAndHPBar), DrawPlayerHUDAndHPBar ; add_predef DrawPlayerHUDAndHPBar + dbw $3d, $61f9 ; add_predef CopyUncompressedPicToTilemap + dbw $3d, $61a6 ; add_predef Func_3f073 + dbw $0b, $7d79 ; add_predef ScaleSpriteByTwo + dbw $3d, $6178 ; add_predef LoadMonBackPic + dbw $1e, $5c16 ; add_predef CopyDownscaledMonTiles + dbw $03, $70a7 ; add_predef LoadMissableObjects + dbw $03, $752b ; add_predef HealParty + dbw $1e, $4d97 ; add_predef MoveAnimation; 08 play move animation + dbw $03, $75a4 ; add_predef DivideBCDPredef + dbw $03, $75a4 ; add_predef DivideBCDPredef2 + dbw $03, $76a3 ; add_predef AddBCDPredef + dbw $03, $76bc ; add_predef SubBCDPredef + dbw $03, $75a4 ; add_predef DivideBCDPredef3 + dbw $03, $75a4 ; add_predef DivideBCDPredef4 + dbw $03, $76d6 ; add_predef InitPlayerData + dbw $03, $74ec ; add_predef FlagActionPredef + dbw $03, $7053 ; add_predef HideObject + dbw $03, $7022 ; add_predef IsObjectHidden + dbw $03, $43de ; add_predef ApplyOutOfBattlePoisonDamage + dbw $0f, $4ae8 ; add_predef AnyPartyAlive + dbw $03, $7044 ; add_predef ShowObject + dbw $03, $7044 ; add_predef ShowObject2 + dbw $03, $6d1b ; add_predef ReplaceTileBlock + dbw $03, $76d6 ; add_predef InitPlayerData2 + dbw $03, $44f4 ; add_predef LoadTilesetHeader + dbw $0e, $700c ; add_predef LearnMoveFromLevelUp + dbw $01, $6bc8 ; add_predef LearnMove + dbw $03, $7735 ; add_predef IsItemInBag_ + dbw $03, $3ef9 ; dbw $03,CheckForHiddenObjectOrBookshelfOrCardKeyDoor ; for these two, the ba + dbw $03, $3e3f ; dbw $03,GiveItem + dbw $0a, $7d4c ; add_predef InvertBGPal_4Frames + dbw $03, $774a ; add_predef FindPathToPlayer + dbw $0a, $7d67 ; add_predef Func_480ff + dbw $03, $77b9 ; add_predef CalcPositionOfPlayerRelativeToNPC + dbw $03, $7830 ; add_predef ConvertNPCMovementDirectionsToJoypadMasks + dbw $0a, $7d8d ; add_predef Func_48125 + dbw $03, $78ad ; add_predef UpdateHPBar + dbw $03, $786c ; add_predef HPBarLength + dbw $01, $5b64 ; add_predef Diploma_TextBoxBorder + dbw $0f, $6e8e ; add_predef DoubleOrHalveSelectedStats + dbw $10, $4000 ; add_predef ShowPokedexMenu + dbw $0e, $6dc6 ; add_predef EvolutionAfterBattle + dbw $1c, $7ae5 ; add_predef SaveSAVtoSRAM0 + dbw $3d, $5ff8 ; add_predef InitOpponent + dbw $01, $5b13 ; add_predef CableClub_Run + dbw $03, $6880 ; add_predef DrawBadges + dbw $10, $53f6 ; add_predef ExternalClockTradeAnim + dbw $1c, $49d7 ; add_predef BattleTransition + dbw $1e, $5f7b ; add_predef CopyTileIDsFromList + dbw $10, $5997 ; add_predef PlayIntro + dbw $1e, $59c5 ; add_predef Func_79869 + dbw $1c, $4bd0 ; add_predef FlashScreen + dbw $03, $42d1 ; add_predef GetTileAndCoordsInFrontOfPlayer + dbw $04, $54cc ; add_predef StatusScreen + dbw $04, $56fb ; add_predef StatusScreen2 + dbw $10, $53e5 ; add_predef InternalClockTradeAnim + dbw $15, $685b ; add_predef TrainerEngage + dbw $10, $509d ; add_predef IndexToPokedex + dbw $01, $600d ; add_predef DisplayPicCenteredOrUpperRight; 3B display pic? + dbw $03, $6dd1 ; add_predef UsedCut + dbw $10, $4312 ; add_predef ShowPokedexData + dbw $0e, $713f ; add_predef WriteMonMoves + dbw $1c, $7a67 ; add_predef SaveSAV + dbw $1c, $61f8 ; add_predef LoadSGB + dbw $03, $6f93 ; add_predef MarkTownVisitedAndLoadMissableObjects + dbw $17, $5b93 ; add_predef SetPartyMonTypes + dbw $04, $62f0 ; add_predef CanLearnTM + dbw $04, $631d ; add_predef TMToMove + dbw $1c, $5eb3 ; add_predef Func_71ddf + dbw $17, $40d4 ; add_predef StarterDex ; 46 + dbw $03, $7161 ; add_predef _AddPartyMon + dbw $03, $78ad ; add_predef UpdateHPBar2 + dbw $0f, $4eb1 ; add_predef DrawEnemyHUDAndHPBar + dbw $1c, $4fe4 ; add_predef LoadTownMap_Nest + dbw $09, $7d20 ; add_predef PrintMonType + dbw $10, $516f ; add_predef EmotionBubble; 4C player exclamation + dbw $01, $5b63 ; add_predef EmptyFunc3; return immediately + dbw $01, $625d ; add_predef AskName + dbw $06, $66e5 ; add_predef PewterGuys + dbw $1c, $7b56 ; add_predef SaveSAVtoSRAM2 + dbw $1c, $7a24 ; add_predef LoadSAVCheckSum2 + dbw $1c, $7959 ; add_predef LoadSAV + dbw $1c, $7b32 ; add_predef SaveSAVtoSRAM1 + dbw $1c, $5b86 ; add_predef DoInGameTradeDialogue ; 54 initiate trade + dbw $3c, $4f26 ; add_predef HallOfFamePC + dbw $11, $4169 ; add_predef DisplayDexRating + dbw $1e, $4615 ; dbw $1E, _LeaveMapAnim ; wrong bank + dbw $1e, $4567 ; dbw $1E, EnterMapAnim ; wrong bank + dbw $03, $4309 ; add_predef GetTileTwoStepsInFrontOfPlayer + dbw $03, $4356 ; add_predef CheckForCollisionWhenPushingBoulder + dbw $3d, $5b06 ; add_predef PrintStrengthTxt + dbw $01, $4d55 ; add_predef PickupItem + dbw $09, $7d4d ; add_predef PrintMoveType + dbw $03, $72f9 ; add_predef LoadMovePPs + dbw $04, $5468 ; add_predef DrawHP ; 5F + dbw $04, $546f ; add_predef DrawHP2 + dbw $07, $4264 ; add_predef Func_1c9c6 + dbw $16, $4ecc ; add_predef OaksAideScript -- cgit v1.3.1-sl0p From 205fa4237b639b7dbf77cb36caead05f17e8de8c Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 09:43:27 -0400 Subject: Pewter gym guys (moved to bank 6, no longer a predef?) --- engine/overworld/npc_movement.asm | 112 ++++++++++++++++++++++++++++++++++++-- engine/overworld/pewter_guys.asm | 8 +-- 2 files changed, 112 insertions(+), 8 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index d7f2b1cd..f474a14c 100755 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -79,9 +79,9 @@ PalletMovementScript_OakMoveLeft: ; 1a556 (6:6556) ld a, $3 ld [wNPCMovementScriptFunctionNum], a .done - ld a, $2 + ld a, BANK(Music_MuseumGuy) ld c, a - ld a, SFX_BATTLE_34 + ld a, MUSIC_MUSEUM_GUY call PlayMusic ld hl, wFlags_D733 set 1, [hl] @@ -163,8 +163,112 @@ PalletMovementScript_Done: ; 1a606 (6:6606) jp EndNPCMovementScript PewterMuseumGuyMovementScriptPointerTable: ; 1a622 (6:6622) - dr $1a622,$1a685 + dw PewterMovementScript_WalkToMuseum + dw PewterMovementScript_Done + +PewterMovementScript_WalkToMuseum: ; 1a626 (6:6626) + ld a, BANK(Music_MuseumGuy) + ld c, a + ld a, MUSIC_MUSEUM_GUY + call PlayMusic + ld a, [wSpriteIndex] + swap a + ld [wNPCMovementScriptSpriteOffset], a + call StartSimulatingJoypadStates + ld hl, wSimulatedJoypadStatesEnd + ld de, RLEList_PewterMuseumPlayer + call DecodeRLEList + dec a + ld [wSimulatedJoypadStatesIndex], a + xor a + ld [wWhichPewterGuy], a + call PewterGuys + ld hl, wNPCMovementDirections2 + ld de, RLEList_PewterMuseumGuy + call DecodeRLEList + ld hl, wd72e + res 7, [hl] + ld a, $1 + ld [wNPCMovementScriptFunctionNum], a + ret + +RLEList_PewterMuseumPlayer: ; 1a661 (6:6661) + db 0, $01 + db D_UP, $03 + db D_LEFT, $0D + db D_UP, $06 + db $FF + +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: ; 1a673 (6:6673) + ld a, [wSimulatedJoypadStatesIndex] + and a + ret nz + ld hl, wd730 + res 7, [hl] + ld hl, wd72e + res 7, [hl] + jp EndNPCMovementScript + PewterGymGuyMovementScriptPointerTable: ; 1a685 (6:6685) - dr $1a685,$1a785 + dw PewterMovementScript_WalkToGym + dw PewterMovementScript_Done + +PewterMovementScript_WalkToGym: ; 1a689 (6:6689) + ld a, BANK(Music_MuseumGuy) + ld c, a + ld a, MUSIC_MUSEUM_GUY + call PlayMusic + ld a, [wSpriteIndex] + swap a + ld [wNPCMovementScriptSpriteOffset], a + xor a + ld [wSpriteStateData2 + $06], a + ld hl, wSimulatedJoypadStatesEnd + ld de, RLEList_PewterGymPlayer + call DecodeRLEList + dec a + ld [wSimulatedJoypadStatesIndex], a + ld a, 1 + ld [wWhichPewterGuy], a + call PewterGuys + ld hl, wNPCMovementDirections2 + ld de, RLEList_PewterGymGuy + call DecodeRLEList + ld hl, wd72e + res 7, [hl] + ld hl, wd730 + set 7, [hl] + ld a, $1 + ld [wNPCMovementScriptFunctionNum], a + ret + +RLEList_PewterGymPlayer: ; 1a6cb (6:66cb) + db 0, $01 + db D_RIGHT, $02 + db D_DOWN, $05 + db D_LEFT, $0B + db D_UP, $05 + db D_LEFT, $0F + db $FF + +RLEList_PewterGymGuy: ; 1a6cd8(6:66d8) + db NPC_MOVEMENT_DOWN, $02 + db NPC_MOVEMENT_LEFT, $0F + db NPC_MOVEMENT_UP, $05 + db NPC_MOVEMENT_LEFT, $0B + db NPC_MOVEMENT_DOWN, $05 + db NPC_MOVEMENT_RIGHT, $03 + db $FF + +INCLUDE "engine/overworld/pewter_guys.asm" +; PewterGuys: + ; dr $1a66e5,$1a785 IsPlayerStandingOnDoorTile: ; 1a785 (6:6785) dr $1a785,$1a7f4 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 -- cgit v1.3.1-sl0p From 084384fea927b64632ca0970624a1ee1f7f19ea0 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 10:48:27 -0400 Subject: Ledges --- engine/overworld/doors.asm | 55 ++++++++++++++++----------------------- engine/overworld/ledges.asm | 26 ++++++++++-------- engine/overworld/npc_movement.asm | 4 --- main.asm | 4 +-- 4 files changed, 40 insertions(+), 49 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index 6b0c0464..99e07174 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 f474a14c..58eb6a47 100755 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -268,7 +268,3 @@ RLEList_PewterGymGuy: ; 1a6cd8(6:66d8) db $FF INCLUDE "engine/overworld/pewter_guys.asm" -; PewterGuys: - ; dr $1a66e5,$1a785 -IsPlayerStandingOnDoorTile: ; 1a785 (6:6785) - dr $1a785,$1a7f4 diff --git a/main.asm b/main.asm index 2f08ff94..b8d32069 100755 --- a/main.asm +++ b/main.asm @@ -234,8 +234,8 @@ SECTION "bank06",ROMX,BANK[$06] dr $18000,$1a4ea INCLUDE "engine/overworld/npc_movement.asm" -HandleLedges: ; 1a7f4 (6:67f4) - dr $1a7f4,$1c000 +INCLUDE "engine/overworld/doors.asm" +INCLUDE "engine/overworld/ledges.asm" SECTION "bank07",ROMX,BANK[$07] -- cgit v1.3.1-sl0p From b62d6986d2ff79a27417441b2895a5b96053b157 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 11:41:09 -0400 Subject: Align door tile dbws --- engine/overworld/doors.asm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index 99e07174..8ec9772a 100755 --- a/engine/overworld/doors.asm +++ b/engine/overworld/doors.asm @@ -31,15 +31,15 @@ DoorTileIDPointers: ; 1a7a8 (6:67a8) 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 + 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) -- cgit v1.3.1-sl0p