diff options
| author | vulcandth <vulcandth@gmail.com> | 2023-07-13 20:27:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-13 21:27:56 -0400 |
| commit | d001ced41b53271373753de835a9c3b3413dc318 (patch) | |
| tree | ff2db7f403bddfcdeb12e50def8411cafedcdd5e /scripts/GameCorner.asm | |
| parent | Make wCurrentBoxNum a byte instead of word (#414) (diff) | |
| download | pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.tar.gz pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.tar.xz pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.zip | |
Add macros, constants, and labels for map scripts and text (#367)
This introduces `def_script_pointers`, `def_text_pointers`, and `object_const_def` macros, and applies them to all maps. Most other map labels have also been identified.
Diffstat (limited to 'scripts/GameCorner.asm')
| -rw-r--r-- | scripts/GameCorner.asm | 370 |
1 files changed, 190 insertions, 180 deletions
diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm index 04c8504e..3944a2f9 100644 --- a/scripts/GameCorner.asm +++ b/scripts/GameCorner.asm @@ -1,12 +1,12 @@ GameCorner_Script: - call CeladonGameCornerScript_48bcf - call CeladonGameCornerScript_48bec + call GameCornerSelectLuckySlotMachine + call GameCornerSetRocketHideoutDoorTile call EnableAutoTextBoxDrawing ld hl, GameCorner_ScriptPointers ld a, [wGameCornerCurScript] jp CallFunctionInTable -CeladonGameCornerScript_48bcf: +GameCornerSelectLuckySlotMachine: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -23,7 +23,7 @@ CeladonGameCornerScript_48bcf: ld [wLuckySlotHiddenObjectIndex], a ret -CeladonGameCornerScript_48bec: +GameCornerSetRocketHideoutDoorTile: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -35,53 +35,54 @@ CeladonGameCornerScript_48bec: lb bc, 2, 8 predef_jump ReplaceTileBlock -CeladonGameCornerScript_48c07: - xor a +GameCornerReenterMapAfterPlayerLoss: + xor a ; SCRIPT_GAMECORNER_DEFAULT ld [wJoyIgnore], a ld [wGameCornerCurScript], a ld [wCurMapScript], a ret GameCorner_ScriptPointers: - dw CeladonGameCornerScript0 - dw CeladonGameCornerScript1 - dw CeladonGameCornerScript2 + def_script_pointers + dw_const GameCornerDefaultScript, SCRIPT_GAMECORNER_DEFAULT + dw_const GameCornerRocketBattleScript, SCRIPT_GAMECORNER_ROCKET_BATTLE + dw_const GameCornerRocketExitScript, SCRIPT_GAMECORNER_ROCKET_EXIT -CeladonGameCornerScript0: +GameCornerDefaultScript: ret -CeladonGameCornerScript1: +GameCornerRocketBattleScript: ld a, [wIsInBattle] cp $ff - jp z, CeladonGameCornerScript_48c07 - ld a, $f0 + jp z, GameCornerReenterMapAfterPlayerLoss + ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a - ld a, $d + ld a, TEXT_GAMECORNER_ROCKET_AFTER_BATTLE ldh [hSpriteIndexOrTextID], a call DisplayTextID - ld a, $b + ld a, GAMECORNER_ROCKET ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF - ld de, MovementData_48c5a + ld de, GameCornerMovement_Grunt_WalkAroundPlayer ld a, [wYCoord] cp 6 jr nz, .asm_48c43 - ld de, MovementData_48c63 + ld de, GameCornerMovement_Grunt_WalkDirect jr .asm_48c4d .asm_48c43 ld a, [wXCoord] cp 8 jr nz, .asm_48c4d - ld de, MovementData_48c63 + ld de, GameCornerMovement_Grunt_WalkDirect .asm_48c4d - ld a, $b + ld a, GAMECORNER_ROCKET ldh [hSpriteIndex], a call MoveSprite - ld a, $2 + ld a, SCRIPT_GAMECORNER_ROCKET_EXIT ld [wGameCornerCurScript], a ret -MovementData_48c5a: +GameCornerMovement_Grunt_WalkAroundPlayer: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT @@ -92,7 +93,7 @@ MovementData_48c5a: db NPC_MOVEMENT_RIGHT db -1 ; end -MovementData_48c63: +GameCornerMovement_Grunt_WalkDirect: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT @@ -100,7 +101,7 @@ MovementData_48c63: db NPC_MOVEMENT_RIGHT db -1 ; end -CeladonGameCornerScript2: +GameCornerRocketExitScript: ld a, [wd730] bit 0, a ret nz @@ -112,53 +113,60 @@ CeladonGameCornerScript2: ld hl, wCurrentMapScriptFlags set 5, [hl] set 6, [hl] - ld a, $0 + ld a, SCRIPT_GAMECORNER_DEFAULT ld [wGameCornerCurScript], a ret GameCorner_TextPointers: - dw CeladonGameCornerText1 - dw CeladonGameCornerText2 - dw CeladonGameCornerText3 - dw CeladonGameCornerText4 - dw CeladonGameCornerText5 - dw CeladonGameCornerText6 - dw CeladonGameCornerText7 - dw CeladonGameCornerText8 - dw CeladonGameCornerText9 - dw CeladonGameCornerText10 - dw CeladonGameCornerText11 - dw CeladonGameCornerText12 - dw CeladonGameCornerText13 + def_text_pointers + dw_const GameCornerBeauty1Text, TEXT_GAMECORNER_BEAUTY1 + dw_const GameCornerClerk1Text, TEXT_GAMECORNER_CLERK1 + dw_const GameCornerMiddleAgedMan1Text, TEXT_GAMECORNER_MIDDLE_AGED_MAN1 + dw_const GameCornerBeauty2Text, TEXT_GAMECORNER_BEAUTY2 + dw_const GameCornerFishingGuruText, TEXT_GAMECORNER_FISHING_GURU + dw_const GameCornerMiddleAgedWomanText, TEXT_GAMECORNER_MIDDLE_AGED_WOMAN + dw_const GameCornerGymGuideText, TEXT_GAMECORNER_GYM_GUIDE + dw_const GameCornerGamblerText, TEXT_GAMECORNER_GAMBLER + dw_const GameCornerClerk2Text, TEXT_GAMECORNER_CLERK2 + dw_const GameCornerGentlemanText, TEXT_GAMECORNER_GENTLEMAN + dw_const GameCornerRocketText, TEXT_GAMECORNER_ROCKET + dw_const GameCornerPosterText, TEXT_GAMECORNER_POSTER + dw_const GameCornerRocketAfterBattleText, TEXT_GAMECORNER_ROCKET_AFTER_BATTLE -CeladonGameCornerText1: - text_far _CeladonGameCornerText1 +GameCornerBeauty1Text: + text_far _GameCornerBeauty1Text text_end -CeladonGameCornerText2: +GameCornerClerk1Text: text_asm - call CeladonGameCornerScript_48f1e - ld hl, CeladonGameCornerText_48d22 + ; Show player's coins + call GameCornerDrawCoinBox + ld hl, .DoYouNeedSomeGameCoins call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_48d0f + jr nz, .declined + ; Can only get more coins if you + ; - have the Coin Case ld b, COIN_CASE call IsItemInBag - jr z, .asm_48d19 + jr z, .no_coin_case + ; - have room in the Coin Case for at least 9 coins call Has9990Coins - jr nc, .asm_48d14 + jr nc, .coin_case_full + ; - have at least 1000 yen xor a ldh [hMoney], a ldh [hMoney + 2], a ld a, $10 ldh [hMoney + 1], a call HasEnoughMoney - jr nc, .asm_48cdb - ld hl, CeladonGameCornerText_48d31 - jr .asm_48d1c -.asm_48cdb + jr nc, .buy_coins + ld hl, .CantAffordTheCoins + jr .print_ret +.buy_coins + ; Spend 1000 yen xor a ldh [hMoney], a ldh [hMoney + 2], a @@ -168,6 +176,7 @@ CeladonGameCornerText2: ld de, wPlayerMoney + 2 ld c, $3 predef SubBCDPredef + ; Receive 50 coins xor a ldh [hUnusedCoinsByte], a ldh [hCoins], a @@ -177,64 +186,65 @@ CeladonGameCornerText2: ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - call CeladonGameCornerScript_48f1e - ld hl, CeladonGameCornerText_48d27 - jr .asm_48d1c -.asm_48d0f - ld hl, CeladonGameCornerText_48d2c - jr .asm_48d1c -.asm_48d14 - ld hl, CeladonGameCornerText_48d36 - jr .asm_48d1c -.asm_48d19 - ld hl, CeladonGameCornerText_48d3b -.asm_48d1c + ; Update display + call GameCornerDrawCoinBox + ld hl, .ThanksHereAre50Coins + jr .print_ret +.declined + ld hl, .PleaseComePlaySometime + jr .print_ret +.coin_case_full + ld hl, .CoinCaseIsFull + jr .print_ret +.no_coin_case + ld hl, .DontHaveCoinCase +.print_ret call PrintText jp TextScriptEnd -CeladonGameCornerText_48d22: - text_far _CeladonGameCornerText_48d22 +.DoYouNeedSomeGameCoins: + text_far _GameCornerClerk1DoYouNeedSomeGameCoinsText text_end -CeladonGameCornerText_48d27: - text_far _CeladonGameCornerText_48d27 +.ThanksHereAre50Coins: + text_far _GameCornerClerk1ThanksHereAre50CoinsText text_end -CeladonGameCornerText_48d2c: - text_far _CeladonGameCornerText_48d2c +.PleaseComePlaySometime: + text_far _GameCornerClerk1PleaseComePlaySometimeText text_end -CeladonGameCornerText_48d31: - text_far _CeladonGameCornerText_48d31 +.CantAffordTheCoins: + text_far _GameCornerClerk1CantAffordTheCoinsText text_end -CeladonGameCornerText_48d36: - text_far _CeladonGameCornerText_48d36 +.CoinCaseIsFull: + text_far _GameCornerClerk1CoinCaseIsFullText text_end -CeladonGameCornerText_48d3b: - text_far _CeladonGameCornerText_48d3b +.DontHaveCoinCase: + text_far _GameCornerClerk1DontHaveCoinCaseText text_end -CeladonGameCornerText3: - text_far _CeladonGameCornerText3 +GameCornerMiddleAgedMan1Text: + text_far _GameCornerMiddleAgedMan1Text text_end -CeladonGameCornerText4: - text_far _CeladonGameCornerText4 +GameCornerBeauty2Text: + text_far _GameCornerBeauty2Text text_end -CeladonGameCornerText5: +GameCornerFishingGuruText: text_asm CheckEvent EVENT_GOT_10_COINS - jr nz, .asm_48d89 - ld hl, CeladonGameCornerText_48d9c + jr nz, .alreadyGotNpcCoins + ld hl, .WantToPlayText call PrintText ld b, COIN_CASE call IsItemInBag - jr z, .asm_48d93 + jr z, .dontHaveCoinCase call Has9990Coins - jr nc, .asm_48d8e + jr nc, .coinCaseFull xor a ldh [hUnusedCoinsByte], a ldh [hCoins], a @@ -247,74 +257,74 @@ CeladonGameCornerText5: SetEvent EVENT_GOT_10_COINS ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, Received10CoinsText - jr .asm_48d96 -.asm_48d89 - ld hl, CeladonGameCornerText_48dac - jr .asm_48d96 -.asm_48d8e - ld hl, CeladonGameCornerText_48da7 - jr .asm_48d96 -.asm_48d93 - ld hl, CeladonGameCornerText_48f19 -.asm_48d96 + ld hl, .Received10CoinsText + jr .print_ret +.alreadyGotNpcCoins + ld hl, .WinsComeAndGoText + jr .print_ret +.coinCaseFull + ld hl, .DontNeedMyCoinsText + jr .print_ret +.dontHaveCoinCase + ld hl, GameCornerOopsForgotCoinCaseText +.print_ret call PrintText jp TextScriptEnd -CeladonGameCornerText_48d9c: - text_far _CeladonGameCornerText_48d9c +.WantToPlayText: + text_far _GameCornerFishingGuruWantToPlayText text_end -Received10CoinsText: - text_far _Received10CoinsText +.Received10CoinsText: + text_far _GameCornerFishingGuruReceived10CoinsText sound_get_item_1 text_end -CeladonGameCornerText_48da7: - text_far _CeladonGameCornerText_48da7 +.DontNeedMyCoinsText: + text_far _GameCornerFishingGuruDontNeedMyCoinsText text_end -CeladonGameCornerText_48dac: - text_far _CeladonGameCornerText_48dac +.WinsComeAndGoText: + text_far _GameCornerFishingGuruWinsComeAndGoText text_end -CeladonGameCornerText6: - text_far _CeladonGameCornerText6 +GameCornerMiddleAgedWomanText: + text_far _GameCornerMiddleAgedWomanText text_end -CeladonGameCornerText7: +GameCornerGymGuideText: text_asm CheckEvent EVENT_BEAT_ERIKA - ld hl, CeladonGameCornerText_48dca - jr z, .asm_48dc4 - ld hl, CeladonGameCornerText_48dcf -.asm_48dc4 + ld hl, GameCornerGymGuideChampInMakingText + jr z, .not_defeated + ld hl, GameCornerGymGuideTheyOfferRarePokemonText +.not_defeated call PrintText jp TextScriptEnd -CeladonGameCornerText_48dca: - text_far _CeladonGameCornerText_48dca +GameCornerGymGuideChampInMakingText: + text_far _GameCornerGymGuideChampInMakingText text_end -CeladonGameCornerText_48dcf: - text_far _CeladonGameCornerText_48dcf +GameCornerGymGuideTheyOfferRarePokemonText: + text_far _GameCornerGymGuideTheyOfferRarePokemonText text_end -CeladonGameCornerText8: - text_far _CeladonGameCornerText8 +GameCornerGamblerText: + text_far _GameCornerGamblerText text_end -CeladonGameCornerText9: +GameCornerClerk2Text: text_asm CheckEvent EVENT_GOT_20_COINS_2 - jr nz, .asm_48e13 - ld hl, CeladonGameCornerText_48e26 + jr nz, .alreadyGotNpcCoins + ld hl, .WantSomeCoinsText call PrintText ld b, COIN_CASE call IsItemInBag - jr z, .asm_48e1d + jr z, .dontHaveCoinCase call Has9990Coins - jr nc, .asm_48e18 + jr nc, .coinCaseFull xor a ldh [hUnusedCoinsByte], a ldh [hCoins], a @@ -325,48 +335,48 @@ CeladonGameCornerText9: ld c, $2 predef AddBCDPredef SetEvent EVENT_GOT_20_COINS_2 - ld hl, Received20CoinsText - jr .asm_48e20 -.asm_48e13 - ld hl, CeladonGameCornerText_48e36 - jr .asm_48e20 -.asm_48e18 - ld hl, CeladonGameCornerText_48e31 - jr .asm_48e20 -.asm_48e1d - ld hl, CeladonGameCornerText_48f19 -.asm_48e20 + ld hl, .Received20CoinsText + jr .print_ret +.alreadyGotNpcCoins + ld hl, .INeedMoreCoinsText + jr .print_ret +.coinCaseFull + ld hl, .YouHaveLotsOfCoinsText + jr .print_ret +.dontHaveCoinCase + ld hl, GameCornerOopsForgotCoinCaseText +.print_ret call PrintText jp TextScriptEnd -CeladonGameCornerText_48e26: - text_far _CeladonGameCornerText_48e26 +.WantSomeCoinsText: + text_far _GameCornerClerk2WantSomeCoinsText text_end -Received20CoinsText: - text_far _Received20CoinsText +.Received20CoinsText: + text_far _GameCornerClerk2Received20CoinsText sound_get_item_1 text_end -CeladonGameCornerText_48e31: - text_far _CeladonGameCornerText_48e31 +.YouHaveLotsOfCoinsText: + text_far _GameCornerClerk2YouHaveLotsOfCoinsText text_end -CeladonGameCornerText_48e36: - text_far _CeladonGameCornerText_48e36 +.INeedMoreCoinsText: + text_far _GameCornerClerk2INeedMoreCoinsText text_end -CeladonGameCornerText10: +GameCornerGentlemanText: text_asm CheckEvent EVENT_GOT_20_COINS - jr nz, .asm_48e75 - ld hl, CeladonGameCornerText_48e88 + jr nz, .alreadyGotNpcCoins + ld hl, .ThrowingMeOffText call PrintText ld b, COIN_CASE call IsItemInBag - jr z, .asm_48e7f + jr z, .dontHaveCoinCase call Has9990Coins - jr z, .asm_48e7a + jr z, .coinCaseFull xor a ldh [hUnusedCoinsByte], a ldh [hCoins], a @@ -377,46 +387,46 @@ CeladonGameCornerText10: ld c, $2 predef AddBCDPredef SetEvent EVENT_GOT_20_COINS - ld hl, CeladonGameCornerText_48e8d - jr .asm_48e82 -.asm_48e75 - ld hl, CeladonGameCornerText_48e98 - jr .asm_48e82 -.asm_48e7a - ld hl, CeladonGameCornerText_48e93 - jr .asm_48e82 -.asm_48e7f - ld hl, CeladonGameCornerText_48f19 -.asm_48e82 + ld hl, .Received20CoinsText + jr .print_ret +.alreadyGotNpcCoins + ld hl, .CloselyWatchTheReelsText + jr .print_ret +.coinCaseFull + ld hl, .YouGotYourOwnCoinsText + jr .print_ret +.dontHaveCoinCase + ld hl, GameCornerOopsForgotCoinCaseText +.print_ret call PrintText jp TextScriptEnd -CeladonGameCornerText_48e88: - text_far _CeladonGameCornerText_48e88 +.ThrowingMeOffText: + text_far _GameCornerGentlemanThrowingMeOffText text_end -CeladonGameCornerText_48e8d: - text_far _CeladonGameCornerText_48e8d +.Received20CoinsText: + text_far _GameCornerGentlemanReceived20CoinsText sound_get_item_1 text_end -CeladonGameCornerText_48e93: - text_far _CeladonGameCornerText_48e93 +.YouGotYourOwnCoinsText: + text_far _GameCornerGentlemanYouGotYourOwnCoinsText text_end -CeladonGameCornerText_48e98: - text_far _CeladonGameCornerText_48e98 +.CloselyWatchTheReelsText: + text_far _GameCornerGentlemanCloselyWatchTheReelsText text_end -CeladonGameCornerText11: +GameCornerRocketText: text_asm - ld hl, CeladonGameCornerText_48ece + ld hl, .ImGuardingThisPosterText call PrintText ld hl, wd72d set 6, [hl] set 7, [hl] - ld hl, CeladonGameCornerText_48ed3 - ld de, CeladonGameCornerText_48ed3 + ld hl, .BattleEndText + ld de, .BattleEndText call SaveEndBattleTextPointers ldh a, [hSpriteIndex] ld [wSpriteIndex], a @@ -426,27 +436,27 @@ CeladonGameCornerText11: ldh [hJoyHeld], a ldh [hJoyPressed], a ldh [hJoyReleased], a - ld a, $1 + ld a, SCRIPT_GAMECORNER_ROCKET_BATTLE ld [wGameCornerCurScript], a jp TextScriptEnd -CeladonGameCornerText_48ece: - text_far _CeladonGameCornerText_48ece +.ImGuardingThisPosterText: + text_far _GameCornerRocketImGuardingThisPosterText text_end -CeladonGameCornerText_48ed3: - text_far _CeladonGameCornerText_48ed3 +.BattleEndText: + text_far _GameCornerRocketBattleEndText text_end -CeladonGameCornerText13: - text_far _CeladonGameCornerText_48ed8 +GameCornerRocketAfterBattleText: + text_far _GameCornerRocketAfterBattleText text_end -CeladonGameCornerText12: +GameCornerPosterText: text_asm ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, CeladonGameCornerText_48f09 + ld hl, .SwitchBehindPosterText call PrintText call WaitForSoundToFinish ld a, SFX_GO_INSIDE @@ -459,19 +469,19 @@ CeladonGameCornerText12: predef ReplaceTileBlock jp TextScriptEnd -CeladonGameCornerText_48f09: - text_far _CeladonGameCornerText_48f09 +.SwitchBehindPosterText: + text_far _GameCornerPosterSwitchBehindPosterText text_asm ld a, SFX_SWITCH call PlaySound call WaitForSoundToFinish jp TextScriptEnd -CeladonGameCornerText_48f19: - text_far _CeladonGameCornerText_48f19 +GameCornerOopsForgotCoinCaseText: + text_far _GameCornerOopsForgotCoinCaseText text_end -CeladonGameCornerScript_48f1e: +GameCornerDrawCoinBox: ld hl, wd730 set 6, [hl] hlcoord 11, 0 |
