diff --git a/constants/ram_constants.asm b/constants/ram_constants.asm index bde7bd5b0..2a6ca750c 100644 --- a/constants/ram_constants.asm +++ b/constants/ram_constants.asm @@ -21,6 +21,11 @@ DEF AUTO_INPUT EQU $ff const TEMPMON ; 3 const WILDMON ; 4 +; wJumptableIndex:: +DEF JUMPTABLE_INDEX_MASK EQU %01111111 + const_def 7 + shift_const JUMPTABLE_EXIT + ; wGameTimerPaused:: DEF GAME_TIMER_COUNTING_F EQU 0 diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index 7836d55e4..8881f89a0 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -4,7 +4,6 @@ DEF BATTLETRANSITION_CAVE_STRONGER EQU $09 DEF BATTLETRANSITION_NO_CAVE EQU $10 DEF BATTLETRANSITION_NO_CAVE_STRONGER EQU $18 DEF BATTLETRANSITION_FINISH EQU $20 -DEF BATTLETRANSITION_END EQU $80 DEF BATTLETRANSITION_SQUARE EQU "8" ; $fe DEF BATTLETRANSITION_BLACK EQU "9" ; $ff @@ -26,7 +25,7 @@ DoBattleTransition: .loop ld a, [wJumptableIndex] - bit 7, a ; BATTLETRANSITION_END? + bit JUMPTABLE_EXIT_F, a jr nz, .done call BattleTransitionJumptable call DelayFrame @@ -197,7 +196,7 @@ StartTrainerBattle_DetermineWhichAnimation: StartTrainerBattle_Finish: call ClearSprites - ld a, BATTLETRANSITION_END + ld a, JUMPTABLE_EXIT ld [wJumptableIndex], a ret diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index 0c54bd0fc..a820c597b 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -62,7 +62,7 @@ DebugColorPicker: ; unreferenced ld [wDebugColorIsShiny], a .loop ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .exit call DebugColorMain call DebugColor_PlaceCursor @@ -704,7 +704,7 @@ DebugColor_TMHMJoypad: .exit ; unreferenced ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .scroll: diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index aa174a346..937334916 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -120,7 +120,7 @@ OWCutAnimation: call PlaySFX .loop ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .finish ld a, 36 * SPRITEOAMSTRUCT_LENGTH ld [wCurSpriteOAMAddr], a @@ -208,7 +208,7 @@ Cut_WaitAnimSFX: .finished ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret Cut_SpawnLeaf: @@ -317,7 +317,7 @@ FlyFromAnim: ld [wFrameCounter], a .loop ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .exit ld a, 0 * SPRITEOAMSTRUCT_LENGTH ld [wCurSpriteOAMAddr], a @@ -354,7 +354,7 @@ FlyToAnim: ld [wFrameCounter], a .loop ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .exit ld a, 0 * SPRITEOAMSTRUCT_LENGTH ld [wCurSpriteOAMAddr], a @@ -423,7 +423,7 @@ FlyFunction_FrameTimer: .exit ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .SpawnLeaf: diff --git a/engine/events/magnet_train.asm b/engine/events/magnet_train.asm index f2d660e7d..325a70092 100644 --- a/engine/events/magnet_train.asm +++ b/engine/events/magnet_train.asm @@ -34,7 +34,7 @@ MagnetTrain: ld [hl], VBLANK_CUTSCENE .loop ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done callfar PlaySpriteAnimations call MagnetTrain_Jumptable @@ -366,7 +366,7 @@ MagnetTrain_Jumptable: ret .TrainArrived: - ld a, $80 + ld a, JUMPTABLE_EXIT ld [wJumptableIndex], a ld de, SFX_TRAIN_ARRIVED call PlaySFX diff --git a/engine/events/mom.asm b/engine/events/mom.asm index 5c2b234a9..507d13a40 100644 --- a/engine/events/mom.asm +++ b/engine/events/mom.asm @@ -7,7 +7,7 @@ BankOfMom: ld [wJumptableIndex], a .loop ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done call .RunJumptable jr .loop @@ -278,7 +278,7 @@ BankOfMom: .AskDST: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret DSTChecks: diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 43ced752d..8b022d7b5 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -9,13 +9,13 @@ FieldMoveJumptable: ld a, [wFieldMoveJumptableIndex] rst JumpTable ld [wFieldMoveJumptableIndex], a - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .okay and a ret .okay - and $7f + and JUMPTABLE_INDEX_MASK scf ret @@ -120,7 +120,7 @@ CutFunction: ld hl, .Jumptable call FieldMoveJumptable jr nc, .loop - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -139,7 +139,7 @@ CutFunction: ret .nohivebadge - ld a, $80 + ld a, JUMPTABLE_EXIT ret .nothingtocut @@ -149,13 +149,13 @@ CutFunction: .DoCut: ld hl, Script_CutFromMenu call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FailCut: ld hl, CutNothingText call MenuTextboxBackup - ld a, $80 + ld a, JUMPTABLE_EXIT ret UseCutText: @@ -270,7 +270,7 @@ INCLUDE "data/collision/field_move_blocks.asm" FlashFunction: call .CheckUseFlash - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -282,16 +282,16 @@ FlashFunction: cp DARKNESS_PALSET jr nz, .notadarkcave call UseFlash - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .notadarkcave call FieldMoveFailed - ld a, $80 + ld a, JUMPTABLE_EXIT ret .nozephyrbadge - ld a, $80 + ld a, JUMPTABLE_EXIT ret UseFlash: @@ -325,7 +325,7 @@ SurfFunction: ld hl, .Jumptable call FieldMoveJumptable jr nc, .loop - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -357,7 +357,7 @@ SurfFunction: ld a, $1 ret .nofogbadge - ld a, $80 + ld a, JUMPTABLE_EXIT ret .alreadyfail ld a, $3 @@ -372,19 +372,19 @@ SurfFunction: call GetPartyNickname ld hl, SurfFromMenuScript call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FailSurf: ld hl, CantSurfText call MenuTextboxBackup - ld a, $80 + ld a, JUMPTABLE_EXIT ret .AlreadySurfing: ld hl, AlreadySurfingText call MenuTextboxBackup - ld a, $80 + ld a, JUMPTABLE_EXIT ret SurfFromMenuScript: @@ -532,7 +532,7 @@ FlyFunction: ld hl, .Jumptable call FieldMoveJumptable jr nc, .loop - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -568,7 +568,7 @@ FlyFunction: ret .nostormbadge - ld a, $82 + ld a, JUMPTABLE_EXIT | $2 ret .indoors @@ -578,18 +578,18 @@ FlyFunction: .illegal call CloseWindow call WaitBGMap - ld a, $80 + ld a, JUMPTABLE_EXIT ret .DoFly: ld hl, .FlyScript call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FailFly: call FieldMoveFailed - ld a, $82 + ld a, JUMPTABLE_EXIT | $2 ret .FlyScript: @@ -610,25 +610,25 @@ FlyFunction: WaterfallFunction: call .TryWaterfall - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret .TryWaterfall: ld de, ENGINE_RISINGBADGE farcall CheckBadge - ld a, $80 + ld a, JUMPTABLE_EXIT ret c call CheckMapCanWaterfall jr c, .failed ld hl, Script_WaterfallFromMenu call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .failed call FieldMoveFailed - ld a, $80 + ld a, JUMPTABLE_EXIT ret CheckMapCanWaterfall: @@ -736,7 +736,7 @@ EscapeRopeOrDig: ld hl, .DigTable call FieldMoveJumptable jr nc, .loop - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -780,13 +780,13 @@ EscapeRopeOrDig: jr nz, .escaperope ld hl, .UsedDigScript call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .escaperope ld hl, .UsedEscapeRopeScript call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FailDig: @@ -799,7 +799,7 @@ EscapeRopeOrDig: call CloseWindow .failescaperope - ld a, $80 + ld a, JUMPTABLE_EXIT ret .UseDigText: @@ -854,7 +854,7 @@ TeleportFunction: ld hl, .Jumptable call FieldMoveJumptable jr nc, .loop - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -889,13 +889,13 @@ TeleportFunction: call GetPartyNickname ld hl, .TeleportScript call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FailTeleport: ld hl, .CantUseTeleportText call MenuTextboxBackup - ld a, $80 + ld a, JUMPTABLE_EXIT ret .TeleportReturnText: @@ -933,7 +933,7 @@ TeleportFunction: StrengthFunction: call .TryStrength - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -946,7 +946,7 @@ StrengthFunction: .AlreadyUsingStrength: ; unreferenced ld hl, .AlreadyUsingStrengthText call MenuTextboxBackup - ld a, $80 + ld a, JUMPTABLE_EXIT ret .AlreadyUsingStrengthText: @@ -954,13 +954,13 @@ StrengthFunction: text_end .Failed: - ld a, $80 + ld a, JUMPTABLE_EXIT ret .UseStrength: ld hl, Script_StrengthFromMenu call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret SetStrengthFlag: @@ -1064,7 +1064,7 @@ WhirlpoolFunction: ld hl, .Jumptable call FieldMoveJumptable jr nc, .loop - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -1087,18 +1087,18 @@ WhirlpoolFunction: ret .noglacierbadge - ld a, $80 + ld a, JUMPTABLE_EXIT ret .DoWhirlpool: ld hl, Script_WhirlpoolFromMenu call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FailWhirlpool: call FieldMoveFailed - ld a, $80 + ld a, JUMPTABLE_EXIT ret UseWhirlpoolText: @@ -1207,7 +1207,7 @@ AskWhirlpoolText: HeadbuttFunction: call TryHeadbuttFromMenu - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -1218,12 +1218,12 @@ TryHeadbuttFromMenu: ld hl, HeadbuttFromMenuScript call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .no_tree call FieldMoveFailed - ld a, $80 + ld a, JUMPTABLE_EXIT ret UseHeadbuttText: @@ -1288,7 +1288,7 @@ AskHeadbuttText: RockSmashFunction: call TryRockSmashFromMenu - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -1301,12 +1301,12 @@ TryRockSmashFromMenu: ld hl, RockSmashFromMenuScript call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .no_rock call FieldMoveFailed - ld a, $80 + ld a, JUMPTABLE_EXIT ret GetFacingObject: @@ -1407,7 +1407,7 @@ FishFunction: ld hl, .FishTable call FieldMoveJumptable jr nc, .loop - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret @@ -1461,7 +1461,7 @@ FishFunction: ret .FailFish: - ld a, $80 + ld a, JUMPTABLE_EXIT ret .FishGotSomething: @@ -1469,7 +1469,7 @@ FishFunction: ld [wFishingResult], a ld hl, Script_GotABite call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FishNoBite: @@ -1477,7 +1477,7 @@ FishFunction: ld [wFishingResult], a ld hl, Script_NotEvenANibble call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret .FishNoFish: @@ -1485,7 +1485,7 @@ FishFunction: ld [wFishingResult], a ld hl, Script_NotEvenANibble2 call QueueScript - ld a, $81 + ld a, JUMPTABLE_EXIT | $1 ret Script_NotEvenANibble: @@ -1599,7 +1599,7 @@ UnusedNothingHereText: ; unreferenced BikeFunction: call .TryBike - and $7f + and JUMPTABLE_INDEX_MASK ld [wFieldMoveSucceeded], a ret diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm index 74e3fbe57..8927fcc50 100644 --- a/engine/games/card_flip.asm +++ b/engine/games/card_flip.asm @@ -60,7 +60,7 @@ _CardFlip: call PlayMusic .MasterLoop: ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .leavethegame call .CardFlip jr .MasterLoop @@ -322,7 +322,7 @@ _CardFlip: .Quit: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret CardFlip_ShuffleDeck: diff --git a/engine/games/memory_game.asm b/engine/games/memory_game.asm index ee0653c96..2652c32c5 100644 --- a/engine/games/memory_game.asm +++ b/engine/games/memory_game.asm @@ -44,7 +44,7 @@ _MemoryGame: .JumptableLoop: ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .quit call .ExecuteJumptable callfar PlaySpriteAnimations @@ -80,7 +80,7 @@ _MemoryGame: call UnusedCursor_InterpretJoypad_AnimateCursor jr nc, .proceed ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .proceed @@ -235,7 +235,7 @@ endr call UnusedCursor_InterpretJoypad_AnimateCursor jr nc, .restart ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .restart diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm index 5d422a81f..56af8bb7c 100644 --- a/engine/games/unown_puzzle.asm +++ b/engine/games/unown_puzzle.asm @@ -60,7 +60,7 @@ _UnownPuzzle: .loop call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .quit call UnownPuzzleJumptable ld a, [wHoldingUnownPuzzlePiece] @@ -332,7 +332,7 @@ UnownPuzzle_A: ld [wSolvedUnownPuzzle], a UnownPuzzle_Quit: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret UnownPuzzle_InvalidAction: diff --git a/engine/items/pack.asm b/engine/items/pack.asm index 5b67dca15..7b8b361ed 100644 --- a/engine/items/pack.asm +++ b/engine/items/pack.asm @@ -19,7 +19,7 @@ Pack: .loop call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done call .RunJumptable call DelayFrame @@ -631,7 +631,7 @@ BattlePack: .loop call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .end call .RunJumptable call DelayFrame @@ -1186,14 +1186,14 @@ Pack_GetJumptablePointer: Pack_QuitNoScript: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] xor a ; FALSE ld [wPackUsedItem], a ret Pack_QuitRunScript: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ld a, TRUE ld [wPackUsedItem], a ret diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm index c5d5a738f..df6d91722 100644 --- a/engine/menus/intro_menu.asm +++ b/engine/menus/intro_menu.asm @@ -901,7 +901,7 @@ INCLUDE "engine/movie/title.asm" RunTitleScreen: call ScrollTitleScreenClouds ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done_title call TitleScreenScene ld a, $1 @@ -1016,7 +1016,7 @@ TitleScreenMain: ; Return to the intro sequence. ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .end @@ -1041,7 +1041,7 @@ TitleScreenMain: ; Return to the intro sequence. ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret TitleScreenEnd: @@ -1059,7 +1059,7 @@ TitleScreenEnd: ; Back to the intro. ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret DeleteSaveData: diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index c904f58bb..ba54bd1ab 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -300,7 +300,7 @@ NamingScreen_ApplyTextInputMode: NamingScreenJoypadLoop: call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .quit call .RunJumptable farcall PlaySpriteAnimationsAndDelayFrame @@ -422,7 +422,7 @@ NamingScreenJoypadLoop: .end call NamingScreen_StoreEntry ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .select @@ -993,7 +993,7 @@ INCBIN "gfx/naming_screen/mail.2bpp" .DoMailEntry: call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .exit_mail call .DoJumptable farcall PlaySpriteAnimationsAndDelayFrame @@ -1119,7 +1119,7 @@ INCBIN "gfx/naming_screen/mail.2bpp" .finished call NamingScreen_StoreEntry ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .select diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index d9d8a9f9a..60224e981 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -22,7 +22,7 @@ TrainerCard: call UpdateTime call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .quit ldh a, [hJoyLast] and B_BUTTON @@ -96,7 +96,7 @@ TrainerCard_IncrementJumptable: TrainerCard_Quit: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret TrainerCard_Page1_LoadGFX: diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index 5c555028c..c03d037ee 100644 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -109,7 +109,7 @@ Credits_HandleAButton: and A_BUTTON ret z ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a ret Credits_HandleBButton: @@ -222,7 +222,7 @@ Credits_LYOverride: ParseCredits: ld hl, wJumptableIndex - bit 7, [hl] + bit JUMPTABLE_EXIT_F, [hl] jp nz, .done ; Wait until the timer has run out to parse the next command. @@ -357,7 +357,7 @@ ParseCredits: .end ; Stop execution. ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ld a, 32 ld [wMusicFade], a ld a, LOW(MUSIC_POST_CREDITS) diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index a6c8dc413..9bc482de0 100644 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -20,7 +20,7 @@ GoldSilverIntro: ; check done flag ld a, [wIntroJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .Finish farcall PlaySpriteAnimations @@ -241,7 +241,7 @@ IntroScene17: jr nz, .loop ; set done flag ld hl, wIntroJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret IntroScene3_ScrollToSurface: diff --git a/engine/movie/splash.asm b/engine/movie/splash.asm index 827ae4c01..0a815cf90 100644 --- a/engine/movie/splash.asm +++ b/engine/movie/splash.asm @@ -94,7 +94,7 @@ GameFreakPresentsFrame: ; high bits of wJumptableIndex are recycled for some flags ; this is set when the sequence finished ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .finish farcall PlaySpriteAnimations @@ -234,7 +234,7 @@ GameFreakPresents_SetDoneFlag: ; Tell GameFreakPresents_PlayFrame and TitleScreenFrame that we're finished. ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret GameFreakPresents_WaitForTimer: diff --git a/engine/movie/trade_animation.asm b/engine/movie/trade_animation.asm index 7d3d8f171..e08d88e90 100644 --- a/engine/movie/trade_animation.asm +++ b/engine/movie/trade_animation.asm @@ -208,7 +208,7 @@ RunTradeAnimScript: DoTradeAnimation: ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .finished call .DoTradeAnimCommand callfar PlaySpriteAnimations @@ -291,7 +291,7 @@ TradeAnim_AdvanceScriptPointer: TradeAnim_End: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret TradeAnim_TubeToOT1: diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index 787de2699..47949483e 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -47,7 +47,7 @@ Pokedex: .main call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .exit call Pokedex_RunJumptable call DelayFrame @@ -211,7 +211,7 @@ Pokedex_IncrementDexPointer: Pokedex_Exit: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret Pokedex_InitMainScreen: diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index d1717c2de..e51e58848 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -43,7 +43,7 @@ PokeGear: call UpdateTime call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done call PokegearJumptable farcall PlaySpriteAnimations @@ -487,7 +487,7 @@ PokegearClock_Joypad: .quit ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .UpdateClock: @@ -598,7 +598,7 @@ PokegearMap_ContinueMap: .cancel ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .DPad: @@ -779,7 +779,7 @@ PokegearRadio_Joypad: .cancel ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret PokegearPhone_Init: @@ -838,7 +838,7 @@ PokegearPhone_Joypad: .b ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret .a diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 6d4887ee0..4c2accaa2 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -20,7 +20,7 @@ _DepositPKMN: .loop call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done call .RunJumptable call DelayFrame @@ -261,7 +261,7 @@ _WithdrawPKMN: .loop call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done call .RunJumptable call DelayFrame @@ -501,7 +501,7 @@ _MovePKMNWithoutMail: .loop call JoyTextDelay ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done call .RunJumptable call DelayFrame @@ -781,7 +781,7 @@ BillsPC_IncrementJumptableIndex: BillsPC_EndJumptableLoop: ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret _StatsScreenDPad: diff --git a/engine/printer/printer.asm b/engine/printer/printer.asm index 32f618b37..61a5f2a55 100644 --- a/engine/printer/printer.asm +++ b/engine/printer/printer.asm @@ -4,7 +4,7 @@ SendScreenToPrinter: call CheckCancelPrint jr c, .cancel ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .finished call PrinterJumptableIteration call CheckPrinterStatus @@ -245,7 +245,7 @@ PrintUnownStamp: call CheckCancelPrint jr c, .done ld a, [wJumptableIndex] - bit 7, a + bit JUMPTABLE_EXIT_F, a jr nz, .done call PrinterJumptableIteration ld a, [wJumptableIndex] diff --git a/engine/printer/printer_serial.asm b/engine/printer/printer_serial.asm index a0c8d1e46..c086df001 100644 --- a/engine/printer/printer_serial.asm +++ b/engine/printer/printer_serial.asm @@ -56,7 +56,7 @@ Printer_Quit: xor a ld [wPrinterStatusFlags], a ld hl, wJumptableIndex - set 7, [hl] + set JUMPTABLE_EXIT_F, [hl] ret Printer_NextSection: diff --git a/home/decompress.asm b/home/decompress.asm index 15e31f5c2..b13515067 100644 --- a/home/decompress.asm +++ b/home/decompress.asm @@ -309,7 +309,7 @@ DEF LZ_LONG_HI EQU %00000011 .donerw pop hl - bit 7, [hl] + bit 7, [hl] ; sign jr nz, .next inc hl ; positive offset is two bytes .next