diff options
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/bank01.asm | 26 | ||||
-rw-r--r-- | src/engine/bank02.asm | 31 | ||||
-rw-r--r-- | src/engine/bank03.asm | 652 | ||||
-rw-r--r-- | src/engine/bank04.asm | 6 | ||||
-rw-r--r-- | src/engine/bank05.asm | 6 | ||||
-rw-r--r-- | src/engine/bank06.asm | 68 | ||||
-rw-r--r-- | src/engine/bank07.asm | 5 | ||||
-rw-r--r-- | src/engine/bank1c.asm | 6 | ||||
-rw-r--r-- | src/engine/booster_packs.asm | 16 | ||||
-rw-r--r-- | src/engine/effect_functions.asm | 4 | ||||
-rw-r--r-- | src/engine/home.asm | 290 |
11 files changed, 530 insertions, 580 deletions
diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index b74340a..556f2cd 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -1019,7 +1019,7 @@ HandleEnergyDiscardMenuInput: ; 46b7 (1:46b7) scf ret -EnergyDiscardCardListParameters: +EnergyDiscardCardListParameters: ; 46f3 (1:46f3) db 1, 5 ; cursor x, cursor y db 4 ; item x db 14 ; maximum length, in tiles, occupied by the name and level string of each card in the list @@ -1161,7 +1161,7 @@ OpenMovePage: ; 478b (1:478b) jr z, .loop ret -AttackMenuParameters: +AttackMenuParameters: ; 47e4 (1:47e4) db 1, 13 ; cursor x, cursor y db 2 ; y displacement between items db 2 ; number of items @@ -1561,7 +1561,7 @@ PrintNumberOfHandAndDeckCards: ; 49ed (1:49ed) jr nz, PrintOpponentNumberOfHandAndDeckCards ; fallthrough -PrintPlayerNumberOfHandAndDeckCards: +PrintPlayerNumberOfHandAndDeckCards: ; 49f3 (1:49f3) ld a, [wPlayerNumberOfCardsInHand] ld hl, wNumCardsBeingDrawn add [hl] @@ -1579,7 +1579,7 @@ PrintPlayerNumberOfHandAndDeckCards: lb bc, 10, 10 jp WriteTwoDigitNumberInTxSymbolFormat -PrintOpponentNumberOfHandAndDeckCards: +PrintOpponentNumberOfHandAndDeckCards: ; 4a14 (1:4a14) ld a, [wOpponentNumberOfCardsInHand] ld hl, wNumCardsBeingDrawn add [hl] @@ -1597,7 +1597,7 @@ PrintOpponentNumberOfHandAndDeckCards: lb bc, 11, 3 jp WriteTwoDigitNumberInTxSymbolFormat -DeckAndHandIconsTileData: +DeckAndHandIconsTileData: ; 4a35 (1:4a35) ; x, y, tiles[], 0 db 4, 3, SYM_CROSS, 0 ; x for opponent's hand db 10, 3, SYM_CROSS, 0 ; x for opponent's deck @@ -1613,7 +1613,7 @@ DeckAndHandIconsTileData: db 13, 10, $fa, $fb, 0 ; player's hand icon db $ff -DeckAndHandIconsCGBPalData: +DeckAndHandIconsCGBPalData: ; 4a6e (1:4a6e) ; x, y, pals[], 0 db 8, 2, $02, $02, 0 db 8, 3, $02, $02, 0 @@ -2141,7 +2141,7 @@ DisplayNoBasicPokemonInHandScreen: ; 4e06 (1:4e06) call WaitForWideTextBoxInput ret -NoBasicPokemonCardListParameters: +NoBasicPokemonCardListParameters: ; 4e37 (1:4e37) db 1, 3 ; cursor x, cursor y db 4 ; item x db 14 ; maximum length, in tiles, occupied by the name and level string of each card in the list @@ -3068,7 +3068,7 @@ PracticeDuelVerify_Turn7Or8: ; 54b7 (1:54b7) jr nz, ReturnWrongAction ret -ReturnWrongAction: +ReturnWrongAction: ; 54c6 (1:54c6) scf ret @@ -3237,7 +3237,7 @@ InitAndDrawCardListScreenLayout: ; 559a (1:559a) ; same as InitAndDrawCardListScreenLayout, except that variables like wSelectedDuelSubMenuItem, ; wNoItemSelectionMenuKeys, wCardListInfoBoxText, wCardListHeaderText, etc already set by caller. -DrawCardListScreenLayout: +DrawCardListScreenLayout: ; 55be (1:55be) call ZeroObjectPositionsAndToggleOAMCopy call EmptyScreen call LoadSymbolsFont @@ -5184,7 +5184,7 @@ Func_6137: ; 6137 (1:6137) call EraseCursor ; fallthrough -Func_615c: +Func_615c: ; 615c (1:615c) ld a, [wCurrentDuelMenuItem] ld d, a add a @@ -5208,7 +5208,7 @@ Func_616e: ; 616e (1:616e) call EnableLCD ; fallthrough -Func_6186: +Func_6186: ; 6186 (1:6186) ld hl, wCurPlayAreaSlot ldh a, [hTempPlayAreaLocation_ff9d] ld [hli], a @@ -6959,7 +6959,6 @@ Func_6cfa: ; 6cfa (1:6cfa) pop hl call WaitForWideTextBoxInput ret -; 0x6d3f Func_6d3f: ; 6d3f (1:6d3f) or a @@ -6999,7 +6998,6 @@ Func_6d3f: ; 6d3f (1:6d3f) pop af pop hl ret -; 0x6d84 ; given the deck index of a turn holder's card in register a, ; and a pointer in hl to the wLoadedCard* buffer where the card data is loaded, @@ -8199,7 +8197,6 @@ PlayMoveAnimation: ; 7494 (1:7494) Func_7571: ; 7571 (1:7571) farcall Func_19c20 ret -; 0x7576 Func_7576: ; 7576 (1:7576) farcall Func_1991f @@ -8211,7 +8208,6 @@ Func_7576: ; 7576 (1:7576) Func_758f: ; 758f (1:758f) farcall Func_1a4cf ret -; 0x7594 Func_7594: ; 7594 (1:7594) farcall Func_1a61f diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index eefd707..1e6179b 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -105,7 +105,7 @@ OpenYourOrOppPlayAreaScreen_TurnHolderPlayArea: ; 809e (2:409e) ldh [hWhoseTurn], a ret -OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea: +OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea: ; 80a8 (2:40a8) ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderPlayAreaScreen @@ -113,7 +113,7 @@ OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea: ldh [hWhoseTurn], a ret -OpenYourOrOppPlayAreaScreen_TurnHolderHand: +OpenYourOrOppPlayAreaScreen_TurnHolderHand: ; 80b2 (2:40b2) ldh a, [hWhoseTurn] push af bank1call OpenTurnHolderHandScreen_Simple @@ -121,7 +121,7 @@ OpenYourOrOppPlayAreaScreen_TurnHolderHand: ldh [hWhoseTurn], a ret -OpenYourOrOppPlayAreaScreen_NonTurnHolderHand: +OpenYourOrOppPlayAreaScreen_NonTurnHolderHand: ; 80bc (2:40bc) ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderHandScreen_Simple @@ -129,7 +129,7 @@ OpenYourOrOppPlayAreaScreen_NonTurnHolderHand: ldh [hWhoseTurn], a ret -OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile: +OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile: ; 80c6 (2:40c6) ldh a, [hWhoseTurn] push af bank1call OpenTurnHolderDiscardPileScreen @@ -137,7 +137,7 @@ OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile: ldh [hWhoseTurn], a ret -OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile: +OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile: ; 80d0 (2:40d0) ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderDiscardPileScreen @@ -191,7 +191,6 @@ DuelCheckMenu_OppPlayArea: ; 80da (2:40da) call DrawYourOrOppPlayArea_DrawArrows call DrawWideTextBox - ; reset cursor blink xor a ld [wCheckMenuCursorBlinkCounter], a @@ -234,25 +233,25 @@ DuelCheckMenu_OppPlayArea: ; 80da (2:40da) dw OpenYourOrOppPlayAreaScreen_NonTurnHolderHand dw OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile -CheckMenuData: ; (2:4158) +CheckMenuData: ; 8158 (2:4158) textitem 2, 14, InPlayAreaText textitem 2, 16, YourPlayAreaText textitem 12, 14, GlossaryText textitem 12, 16, OppPlayAreaText db $ff -YourPlayAreaMenuData: ; (2:4169) +YourPlayAreaMenuData: ; 8169 (2:4169) textitem 2, 14, YourPokemonText textitem 12, 14, YourHandText textitem 2, 16, YourDiscardPileText2 db $ff -OppPlayAreaMenuData: ; (2:4176) +OppPlayAreaMenuData: ; 8176 (2:4176) textitem 2, 14, OpponentsPokemonText textitem 2, 16, OpponentsDiscardPileText2 db $ff -OppPlayAreaMenuData_WithClairvoyance: ; (2:4176) +OppPlayAreaMenuData_WithClairvoyance: ; 8176 (2:4176) textitem 2, 14, OpponentsPokemonText textitem 12, 14, OpponentsHandText textitem 2, 16, OpponentsDiscardPileText2 @@ -1288,7 +1287,7 @@ HandleCheckMenuInput_YourOrOppPlayArea: ; 86ac (2:46ac) call EraseCheckMenuCursor_YourOrOppPlayArea pop de -;update x and y cursor positions +; update x and y cursor positions ld a, d ld [wCheckMenuCursorXPosition], a ld a, e @@ -1513,7 +1512,7 @@ Func_8819: ; 8819 (2:4819) call GetTurnDuelistVariable jr Func_8855 -Func_883c: +Func_883c: ; 883c (2:483c) call CreateHandCardList ret c ld hl, wDuelTempList @@ -1521,7 +1520,7 @@ Func_883c: ld a, [hl] jr Func_8855 -Func_8849: +Func_8849: ; 8849 (2:4849) call CreateDeckCardList ret c ld a, %01111111 @@ -1534,7 +1533,7 @@ Func_8849: ; output: ; a = ce5c ; with upper bit set if turn was swapped -Func_8855: +Func_8855: ; 8855 (2:4855) ld b, a ld a, [$ce5c] or a @@ -2308,7 +2307,7 @@ HandleCheckMenuInput: ; 9065 (2:5065) call EraseCheckMenuCursor pop de -;update x and y cursor positions +; update x and y cursor positions ld a, d ld [wCheckMenuCursorXPosition], a ld a, e @@ -2360,7 +2359,7 @@ EraseCheckMenuCursor: ; 90d8 (2:50d8) ; draws in the cursor position ; input: ; a = tile byte to draw -DrawCheckMenuCursor: +DrawCheckMenuCursor: ; 90da (2:50da) ld e, a ld a, 10 ld l, a diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index 4e53dfd..37e09c2 100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -2107,7 +2107,7 @@ ScriptCommand_MoveWramNPC: ; ce52 (3:4e52) ; Executes movement on an arbitrary NPC using values in a and on the stack ; Changes and fixes Temp NPC using stack values -ExecuteArbitraryNPCMovementFromStack: +ExecuteArbitraryNPCMovementFromStack: ; ce5d (3:4e5d) ld [wTempNPC], a call FindLoadedNPC call ExecuteNPCMovement @@ -3153,7 +3153,7 @@ ScriptCommand_JumpIfFlagNonzero2: ; d4ca (3:54ca) .noJumpArgs jp IncreaseScriptPointerBy4 -ScriptCommand_JumpIfFlagZero2: +ScriptCommand_JumpIfFlagZero2: ; d4df (3:54df) ld a, c call GetEventFlagValue or a @@ -3488,77 +3488,74 @@ Script_d827: ; d827 (3:5827) ; 0xd82d INCROM $d82d, $d834 - + AfterTutorialBattleScript: ; d834 (3:5834) - start_script - run_command ScriptCommand_PrintTextString - tx Text05eb - run_command ScriptCommand_PrintTextString - tx Text05ef - run_command ScriptCommand_CloseTextBox - run_command ScriptCommand_MoveActiveNPC - dw NPCMovement_d896 - run_command ScriptCommand_SetPlayerDirection - db NORTH - run_command ScriptCommand_MovePlayer - db NORTH - db $01 - run_command ScriptCommand_MovePlayer - db NORTH - db $01 - run_command ScriptCommand_MovePlayer - db NORTH - db $01 - run_command ScriptCommand_SetPlayerDirection - db EAST - run_command ScriptCommand_MovePlayer - db EAST - db $01 - run_command ScriptCommand_MovePlayer - db EAST - db $01 - run_command ScriptCommand_SetPlayerDirection - db NORTH - run_command ScriptCommand_PrintTextString - tx Text05f0 - run_command ScriptCommand_CloseTextBox - run_command Func_ccdc - tx Text05f1 - run_command ScriptCommand_CloseTextBox - run_command ScriptCommand_PrintTextString - tx Text05f2 + start_script + run_command ScriptCommand_PrintTextString + tx Text05eb + run_command ScriptCommand_PrintTextString + tx Text05ef + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_MoveActiveNPC + dw NPCMovement_d896 + run_command ScriptCommand_SetPlayerDirection + db NORTH + run_command ScriptCommand_MovePlayer + db NORTH + db $01 + run_command ScriptCommand_MovePlayer + db NORTH + db $01 + run_command ScriptCommand_MovePlayer + db NORTH + db $01 + run_command ScriptCommand_SetPlayerDirection + db EAST + run_command ScriptCommand_MovePlayer + db EAST + db $01 + run_command ScriptCommand_MovePlayer + db EAST + db $01 + run_command ScriptCommand_SetPlayerDirection + db NORTH + run_command ScriptCommand_PrintTextString + tx Text05f0 + run_command ScriptCommand_CloseTextBox + run_command Func_ccdc + tx Text05f1 + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_PrintTextString + tx Text05f2 .ows_d85f - run_command ScriptCommand_ShowMultichoiceTextbox_ChooseStarterDeck - run_command ScriptCommand_CloseTextBox - run_command ScriptCommand_AskQuestionJump - tx Text05f3 - dw .ows_d869 - run_command ScriptCommand_Jump - dw .ows_d85f -; 0xd869 + run_command ScriptCommand_ShowMultichoiceTextbox_ChooseStarterDeck + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_AskQuestionJump + tx Text05f3 + dw .ows_d869 + run_command ScriptCommand_Jump + dw .ows_d85f .ows_d869 - run_command ScriptCommand_PrintTextString - tx Text05f4 - run_command ScriptCommand_CloseTextBox - run_command ScriptCommand_PauseSong - run_command Func_d40f - run_command ScriptCommand_TryGiveMedalPCPacks - run_command Func_ccdc - tx Text05f5 - run_command ScriptCommand_WaitForSongToFinish - run_command ScriptCommand_ResumeSong - run_command ScriptCommand_CloseTextBox - run_command ScriptCommand_SetFlagValue - db EVENT_FLAG_3E - db $03 - run_command Func_d3d4 - run_command ScriptCommand_PrintTextString - tx Text05f6 - run_command Func_d396 - db $00 - run_command ScriptCommand_QuitScriptFully -; 0xd880 - + run_command ScriptCommand_PrintTextString + tx Text05f4 + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_PauseSong + run_command Func_d40f + run_command ScriptCommand_TryGiveMedalPCPacks + run_command Func_ccdc + tx Text05f5 + run_command ScriptCommand_WaitForSongToFinish + run_command ScriptCommand_ResumeSong + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_SetFlagValue + db EVENT_FLAG_3E + db $03 + run_command Func_d3d4 + run_command ScriptCommand_PrintTextString + tx Text05f6 + run_command Func_d396 + db $00 + run_command ScriptCommand_QuitScriptFully NPCMovement_d880: ; d880 (3:5880) db EAST @@ -3589,7 +3586,7 @@ NPCMovement_d88b: ; d88b (3:588b) NPCMovement_d894: ; d894 (4:5894) db SOUTH | NO_MOVE db $ff - + NPCMovement_d896: ; d896 (3:5896) db NORTH db NORTH @@ -3924,6 +3921,7 @@ FightingClubLobbyAfterDuel: ; dc68 (3:5c68) ld hl, .after_duel_table call FindEndOfBattleScript ret + .after_duel_table db NPC_IMAKUNI db NPC_IMAKUNI @@ -4061,13 +4059,10 @@ Script_Butch: ; dd8d (3:5d8d) Script_Granny1: ; dd9f (3:5d9f) INCROM $dd9f, $dda3 - - FightingClubAfterDuel: ; dda3 (3:5da3) - ld hl, .after_duel_table - call FindEndOfBattleScript - ret -; 0xddaa + ld hl, .after_duel_table + call FindEndOfBattleScript + ret .after_duel_table db NPC_CHRIS @@ -4094,149 +4089,135 @@ FightingClubAfterDuel: ; dda3 (3:5da3) ; ddc3 Script_Mitch: ; ddc3 (3:5dc3) - start_script - run_command ScriptCommand_TryGivePCPack - db $02 - run_command ScriptCommand_JumpIfFlagNonzero2 - db EVENT_FLAG_0F - dw Script_Mitch_AlreadyHaveMedal - run_command ScriptCommand_JumpBasedOnFightingClubPupilStatus - dw .first_interaction - dw .three_pupils_remaining - dw .two_pupils_remaining - dw .one_pupil_remaining - dw .all_pupils_defeated + start_script + run_command ScriptCommand_TryGivePCPack + db $02 + run_command ScriptCommand_JumpIfFlagNonzero2 + db EVENT_FLAG_0F + dw Script_Mitch_AlreadyHaveMedal + run_command ScriptCommand_JumpBasedOnFightingClubPupilStatus + dw .first_interaction + dw .three_pupils_remaining + dw .two_pupils_remaining + dw .one_pupil_remaining + dw .all_pupils_defeated .first_interaction - run_command ScriptCommand_PrintTextString - tx Text0477 - run_command ScriptCommand_SetFlagValue - db EVENT_FLAG_11 - db $01 - run_command ScriptCommand_SetFlagValue - db EVENT_FLAG_17 - db $01 - run_command ScriptCommand_SetFlagValue - db EVENT_FLAG_20 - db $01 - run_command ScriptCommand_QuitScriptFully -; 0xdde2 + run_command ScriptCommand_PrintTextString + tx Text0477 + run_command ScriptCommand_SetFlagValue + db EVENT_FLAG_11 + db $01 + run_command ScriptCommand_SetFlagValue + db EVENT_FLAG_17 + db $01 + run_command ScriptCommand_SetFlagValue + db EVENT_FLAG_20 + db $01 + run_command ScriptCommand_QuitScriptFully .three_pupils_remaining - run_command ScriptCommand_PrintTextQuitFully - tx Text0478 -; 0xdde5 + run_command ScriptCommand_PrintTextQuitFully + tx Text0478 .two_pupils_remaining - run_command ScriptCommand_PrintTextQuitFully - tx Text0479 -; 0xdde8 + run_command ScriptCommand_PrintTextQuitFully + tx Text0479 .one_pupil_remaining - run_command ScriptCommand_PrintTextQuitFully - tx Text047a -; 0xddeb + run_command ScriptCommand_PrintTextQuitFully + tx Text047a .all_pupils_defeated - run_command ScriptCommand_PrintTextString - tx Text047b - run_command ScriptCommand_AskQuestionJump - tx Text047c - dw .do_battle - run_command ScriptCommand_PrintTextString - tx Text047d - run_command ScriptCommand_QuitScriptFully -; 0xddf7 + run_command ScriptCommand_PrintTextString + tx Text047b + run_command ScriptCommand_AskQuestionJump + tx Text047c + dw .do_battle + run_command ScriptCommand_PrintTextString + tx Text047d + run_command ScriptCommand_QuitScriptFully .do_battle - run_command ScriptCommand_PrintTextString - tx Text047e - run_command ScriptCommand_StartBattle - db PRIZES_6 - db FIRST_STRIKE_DECK_ID - db MUSIC_DUEL_THEME_2 - run_command ScriptCommand_QuitScriptFully -; 0xddff + run_command ScriptCommand_PrintTextString + tx Text047e + run_command ScriptCommand_StartBattle + db PRIZES_6 + db FIRST_STRIKE_DECK_ID + db MUSIC_DUEL_THEME_2 + run_command ScriptCommand_QuitScriptFully Script_BeatMitch: ; ddff (3:5dff) - start_script - run_command ScriptCommand_JumpIfFlagNonzero2 - db EVENT_FLAG_0F - dw Script_Mitch_GiveBoosters - run_command ScriptCommand_PrintTextString - tx Text047f - run_command ScriptCommand_MaxOutFlagValue - db EVENT_FLAG_0F - run_command ScriptCommand_TryGiveMedalPCPacks - run_command Func_d125 - db $0f - run_command Func_d435 - db $01 - run_command ScriptCommand_PrintTextString - tx Text0480 - run_command ScriptCommand_GiveBoosterPacks - db BOOSTER_LABORATORY_NEUTRAL - db BOOSTER_LABORATORY_NEUTRAL - db NO_BOOSTER - run_command ScriptCommand_PrintTextString - tx Text0481 - run_command ScriptCommand_QuitScriptFully -; 0xde19 + start_script + run_command ScriptCommand_JumpIfFlagNonzero2 + db EVENT_FLAG_0F + dw Script_Mitch_GiveBoosters + run_command ScriptCommand_PrintTextString + tx Text047f + run_command ScriptCommand_MaxOutFlagValue + db EVENT_FLAG_0F + run_command ScriptCommand_TryGiveMedalPCPacks + run_command Func_d125 + db $0f + run_command Func_d435 + db $01 + run_command ScriptCommand_PrintTextString + tx Text0480 + run_command ScriptCommand_GiveBoosterPacks + db BOOSTER_LABORATORY_NEUTRAL + db BOOSTER_LABORATORY_NEUTRAL + db NO_BOOSTER + run_command ScriptCommand_PrintTextString + tx Text0481 + run_command ScriptCommand_QuitScriptFully Script_LoseToMitch: ; de19 (3:5e19) - start_script - run_command ScriptCommand_JumpIfFlagNonzero2 - db EVENT_FLAG_0F - dw Script_Mitch_PrintTrainHarderText - run_command ScriptCommand_PrintTextQuitFully - tx Text0482 -; 0xde21 - -Script_Mitch_AlreadyHaveMedal: ; 0xde21 - run_command ScriptCommand_PrintTextString - tx Text0483 - run_command ScriptCommand_AskQuestionJump - tx Text047c - dw .do_battle - run_command ScriptCommand_PrintTextString - tx Text0484 - run_command ScriptCommand_QuitScriptFully -; 0xde2d + start_script + run_command ScriptCommand_JumpIfFlagNonzero2 + db EVENT_FLAG_0F + dw Script_Mitch_PrintTrainHarderText + run_command ScriptCommand_PrintTextQuitFully + tx Text0482 + +Script_Mitch_AlreadyHaveMedal: ; de21 (3:5e21) + run_command ScriptCommand_PrintTextString + tx Text0483 + run_command ScriptCommand_AskQuestionJump + tx Text047c + dw .do_battle + run_command ScriptCommand_PrintTextString + tx Text0484 + run_command ScriptCommand_QuitScriptFully .do_battle - run_command ScriptCommand_PrintTextString - tx Text0485 - run_command ScriptCommand_StartBattle - db PRIZES_6 - db FIRST_STRIKE_DECK_ID - db MUSIC_DUEL_THEME_2 - run_command ScriptCommand_QuitScriptFully -; 0xde35 - -Script_Mitch_GiveBoosters: - run_command ScriptCommand_PrintTextString - tx Text0486 - run_command ScriptCommand_GiveBoosterPacks - db BOOSTER_LABORATORY_NEUTRAL - db BOOSTER_LABORATORY_NEUTRAL - db NO_BOOSTER - run_command ScriptCommand_PrintTextString - tx Text0487 - run_command ScriptCommand_QuitScriptFully -; 0xde40 - -Script_Mitch_PrintTrainHarderText: - run_command ScriptCommand_PrintTextQuitFully - tx Text0488 + run_command ScriptCommand_PrintTextString + tx Text0485 + run_command ScriptCommand_StartBattle + db PRIZES_6 + db FIRST_STRIKE_DECK_ID + db MUSIC_DUEL_THEME_2 + run_command ScriptCommand_QuitScriptFully + +Script_Mitch_GiveBoosters: ; de35 (3:5e35) + run_command ScriptCommand_PrintTextString + tx Text0486 + run_command ScriptCommand_GiveBoosterPacks + db BOOSTER_LABORATORY_NEUTRAL + db BOOSTER_LABORATORY_NEUTRAL + db NO_BOOSTER + run_command ScriptCommand_PrintTextString + tx Text0487 + run_command ScriptCommand_QuitScriptFully + +Script_Mitch_PrintTrainHarderText: ; de40 (3:5e40) + run_command ScriptCommand_PrintTextQuitFully + tx Text0488 ; 0xde43 INCROM $de43, $ded1 - + Script_Clerk2: ; ded1 (3:5ed1) INCROM $ded1, $ded5 - RockClubLobbyAfterDuel: ; ded5 (3:5ed5) - ld hl, .after_duel_table - call FindEndOfBattleScript - ret -; 0xdedc + ld hl, .after_duel_table + call FindEndOfBattleScript + ret .after_duel_table - db NPC_CHRIS db NPC_CHRIS dw $5f0c @@ -4250,7 +4231,7 @@ RockClubLobbyAfterDuel: ; ded5 (3:5ed5) ; 0xdee9 INCROM $dee9, $def2 - + Script_Chris: ; def2 (3:5ef2) INCROM $def2, $df39 @@ -4278,12 +4259,10 @@ Script_Gene: ; e03e (3:603e) Script_Clerk3: ; e09e (3:609e) INCROM $e09e, $e0a2 - WaterClubLobbyAfterDuel: ; e0a2 (3:60a2) - ld hl, .after_duel_table - call FindEndOfBattleScript - ret -; 0xe0a9 + ld hl, .after_duel_table + call FindEndOfBattleScript + ret .after_duel_table db NPC_IMAKUNI @@ -4291,8 +4270,6 @@ WaterClubLobbyAfterDuel: ; e0a2 (3:60a2) dw Script_BeatImakuni dw Script_LostToImakuni db $00 -; 0xe0b0 - Preload_ImakuniInWaterClubLobby: ; e0b0 (3:60b0) get_flag_value EVENT_IMAKUNI_STATE @@ -4431,7 +4408,7 @@ WaterClubMovePlayer: ; e13f (3:613f) ld bc, Script_NotReadyToSeeAmy jp SetNextNPCAndScript -WaterClubAfterDuel: ;e157 (3:6157) +WaterClubAfterDuel: ; e157 (3:6157) ld hl, .after_duel_table call FindEndOfBattleScript ret @@ -4926,16 +4903,14 @@ ScriptJump_TalkToAmyAgain: ; e356 (3:6356) db GO_GO_RAIN_DANCE_DECK_ID db MUSIC_DUEL_THEME_2 run_command ScriptCommand_QuitScriptFully -; 0xe369 Script_Clerk4: ; e369 (3:6369) INCROM $e369, $e36d LightningClubLobbyAfterDuel: ; e36d (3:636d) - ld hl, .after_duel_table - call FindEndOfBattleScript - ret -; 0xe374 + ld hl, .after_duel_table + call FindEndOfBattleScript + ret .after_duel_table db NPC_IMAKUNI @@ -5274,7 +5249,6 @@ Script_Lass2: ; e61f (3:661f) db BLASTOISE run_command ScriptCommand_PrintTextQuitFully tx Text06f3 -; 0xe6d8 Script_Granny2: ; e6d8 (3:66d8) INCROM $e6d8, $e6e3 @@ -5344,7 +5318,6 @@ TrySecondRonaldFight: ; e837 (3:6837) ret nz ld bc, ScriptSecondRonaldFight jp SetNextNPCAndScript -; 0xe84c Script_Clerk6: ; e84c (3:684c) INCROM $e84c, $e850 @@ -5464,7 +5437,7 @@ Script_LostToFirstRonaldFight: ; e8f7 (3:68f7) run_command ScriptCommand_PrintTextString tx Text064e -ScriptJump_FinishedFirstRonaldFight: +ScriptJump_FinishedFirstRonaldFight: ; e8fb (3:68fb) run_command ScriptCommand_SetFlagValue db EVENT_FLAG_4C db $02 @@ -5567,17 +5540,13 @@ ScriptJump_FinishedSecondRonaldFight: ; e959 (3:6959) run_command Func_cdcb run_command Func_d41d run_command ScriptCommand_QuitScriptFully -; 0xe963 - PsychicClubLobbyAfterDuel: ; e963 (3:6963) - ld hl, .after_duel_table - call FindEndOfBattleScript - ret -; 0xe96a + ld hl, .after_duel_table + call FindEndOfBattleScript + ret .after_duel_table - db NPC_ROBERT db NPC_ROBERT dw $6995 @@ -5585,16 +5554,16 @@ PsychicClubLobbyAfterDuel: ; e963 (3:6963) db $00 INCROM $e971, $e980 - + Script_Robert: ; e980 (3:6980) INCROM $e980, $e9a5 - + Script_Pappy1: ; e9a5 (3:69a5) INCROM $e9a5, $ea30 Script_Gal3: ; ea30 (3:6a30) INCROM $ea30, $ea3b - + Script_Chap4: ; ea3b (3:6a3b) INCROM $ea3b, $ea60 @@ -5603,25 +5572,22 @@ Script_Daniel: ; ea60 (3:6a60) Script_Stephanie: ; eaa2 (3:6aa2) INCROM $eaa2, $eadf - + Script_Murray2: ; eadf (3:6adf) INCROM $eadf, $eadf Script_Murray1: ; eadf (3:6adf) INCROM $eadf, $eb53 - + Script_Clerk7: ; eb53 (3:6b53) INCROM $eb53, $eb57 - -ScienceClubLobbyAfterDuel:; eb57 (3:6b57) - ld hl, .after_duel_table - call FindEndOfBattleScript - ret -; 0xeb5e +ScienceClubLobbyAfterDuel: ; eb57 (3:6b57) + ld hl, .after_duel_table + call FindEndOfBattleScript + ret .after_duel_table - db NPC_IMAKUNI db NPC_IMAKUNI dw Script_BeatImakuni @@ -5630,7 +5596,7 @@ ScienceClubLobbyAfterDuel:; eb57 (3:6b57) ; 0xeb65 INCROM $eb65, $eb84 - + Script_Lad1: ; eb84 (3:6b84) INCROM $eb84, $ebc1 @@ -5659,10 +5625,9 @@ Script_Clerk8: ; ed45 (3:6d45) INCROM $ed45, $ed49 FireClubLobbyAfterDuel: ; ed49 (3:6d49) - ld hl, .after_duel_table - call FindEndOfBattleScript - ret -; 0xed50 + ld hl, .after_duel_table + call FindEndOfBattleScript + ret .after_duel_table db NPC_JESSICA @@ -5671,8 +5636,6 @@ FireClubLobbyAfterDuel: ; ed49 (3:6d49) dw $6dce db $00 -; 0xed57 - FireClubPressedA: ; ed57 (3:6d57) ld hl, SlowpokePaintingObjectTable call FindExtraInteractableObjects @@ -5749,13 +5712,11 @@ Script_ee76: ; ee76 (3:6e76) run_command ScriptCommand_ShowCardReceivedScreen db SLOWPOKE1 run_command ScriptCommand_QuitScriptFully -; 0xee88 Script_Mania: ; ee88 (3:6e88) INCROM $ee88, $ee93 - -FireClubAfterDuel: ;ee93 (3:6e93) +FireClubAfterDuel: ; ee93 (3:6e93) ld hl, .after_duel_table call FindEndOfBattleScript ret @@ -5763,18 +5724,18 @@ FireClubAfterDuel: ;ee93 (3:6e93) .after_duel_table db NPC_JOHN db NPC_JOHN - dw $6ec8 + dw $6ec8 dw $6ed4 - + db NPC_ADAM db NPC_ADAM - dw $6eed - dw $6ef9 + dw $6eed + dw $6ef9 db NPC_JONATHAN db NPC_JONATHAN - dw $6f12 - dw $6f1e + dw $6f12 + dw $6f1e db NPC_KEN db NPC_KEN @@ -5782,7 +5743,6 @@ FireClubAfterDuel: ;ee93 (3:6e93) dw Script_LoseToKen db $00 -; 0xeeb3 Script_John: ; eeb3 (3:6eb3) INCROM $eeb3, $eed8 @@ -5794,112 +5754,106 @@ Script_Jonathan: ; eefd (3:6efd) INCROM $eefd, $ef22 Script_Ken: ; ef22 (3:6f22) - start_script - run_command ScriptCommand_TryGivePCPack - db $09 - run_command ScriptCommand_JumpIfFlagNonzero2 - db EVENT_FLAG_23 - dw .have_300_cards - run_command ScriptCommand_CheckRawAmountOfCardsOwned - dw 300 - dw .have_300_cards - run_command ScriptCommand_JumpIfFlagZero1 - db EVENT_FLAG_24 - dw NO_JUMP - run_command ScriptCommand_PrintVariableText - tx Text06ba - tx Text06bb - run_command ScriptCommand_SetFlagValue - db EVENT_FLAG_24 - db $01 - run_command ScriptCommand_QuitScriptFully + start_script + run_command ScriptCommand_TryGivePCPack + db $09 + run_command ScriptCommand_JumpIfFlagNonzero2 + db EVENT_FLAG_23 + dw .have_300_cards + run_command ScriptCommand_CheckRawAmountOfCardsOwned + dw 300 + dw .have_300_cards + run_command ScriptCommand_JumpIfFlagZero1 + db EVENT_FLAG_24 + dw NO_JUMP + run_command ScriptCommand_PrintVariableText + tx Text06ba + tx Text06bb + run_command ScriptCommand_SetFlagValue + db EVENT_FLAG_24 + db $01 + run_command ScriptCommand_QuitScriptFully .have_300_cards - run_command ScriptCommand_MaxOutFlagValue - db EVENT_FLAG_23 - run_command ScriptCommand_JumpIfFlagNonzero2 - db EVENT_FLAG_0A - dw Script_KenBattle_AlreadyHaveMedal - run_command ScriptCommand_JumpIfFlagZero1 - db EVENT_FLAG_24 - dw NO_JUMP - run_command ScriptCommand_PrintVariableText - tx Text06bc - tx Text06bd - run_command ScriptCommand_SetFlagValue - db EVENT_FLAG_24 - db $01 - run_command ScriptCommand_AskQuestionJump - tx Text06be - dw .do_battle - run_command ScriptCommand_PrintTextString - tx Text06bf - run_command ScriptCommand_QuitScriptFully + run_command ScriptCommand_MaxOutFlagValue + db EVENT_FLAG_23 + run_command ScriptCommand_JumpIfFlagNonzero2 + db EVENT_FLAG_0A + dw Script_KenBattle_AlreadyHaveMedal + run_command ScriptCommand_JumpIfFlagZero1 + db EVENT_FLAG_24 + dw NO_JUMP + run_command ScriptCommand_PrintVariableText + tx Text06bc + tx Text06bd + run_command ScriptCommand_SetFlagValue + db EVENT_FLAG_24 + db $01 + run_command ScriptCommand_AskQuestionJump + tx Text06be + dw .do_battle + run_command ScriptCommand_PrintTextString + tx Text06bf + run_command ScriptCommand_QuitScriptFully .do_battle - run_command ScriptCommand_PrintTextString - tx Text06c0 - run_command ScriptCommand_StartBattle - db PRIZES_6 - db FIRE_CHARGE_DECK_ID - db MUSIC_DUEL_THEME_2 - run_command ScriptCommand_QuitScriptFully -; 0xef5e + run_command ScriptCommand_PrintTextString + tx Text06c0 + run_command ScriptCommand_StartBattle + db PRIZES_6 + db FIRE_CHARGE_DECK_ID + db MUSIC_DUEL_THEME_2 + run_command ScriptCommand_QuitScriptFully Script_BeatKen: ; ef5e (3:6f5e) - start_script - run_command ScriptCommand_PrintTextString - tx Text06c1 - run_command ScriptCommand_JumpIfFlagNonzero2 - db EVENT_FLAG_0A - dw .give_booster_packs - run_command ScriptCommand_MaxOutFlagValue - db EVENT_FLAG_0A - run_command ScriptCommand_TryGiveMedalPCPacks - run_command Func_d125 - db $0a - run_command Func_d435 - db $08 - run_command ScriptCommand_PrintTextString - tx Text06c2 + start_script + run_command ScriptCommand_PrintTextString + tx Text06c1 + run_command ScriptCommand_JumpIfFlagNonzero2 + db EVENT_FLAG_0A + dw .give_booster_packs + run_command ScriptCommand_MaxOutFlagValue + db EVENT_FLAG_0A + run_command ScriptCommand_TryGiveMedalPCPacks + run_command Func_d125 + db $0a + run_command Func_d435 + db $08 + run_command ScriptCommand_PrintTextString + tx Text06c2 .give_booster_packs - run_command ScriptCommand_GiveBoosterPacks - db BOOSTER_MYSTERY_NEUTRAL - db BOOSTER_MYSTERY_NEUTRAL - db NO_BOOSTER - run_command ScriptCommand_PrintTextString - tx Text06c3 - run_command ScriptCommand_QuitScriptFully -; 0xef78 - - + run_command ScriptCommand_GiveBoosterPacks + db BOOSTER_MYSTERY_NEUTRAL + db BOOSTER_MYSTERY_NEUTRAL + db NO_BOOSTER + run_command ScriptCommand_PrintTextString + tx Text06c3 + run_command ScriptCommand_QuitScriptFully Script_LoseToKen: ; ef78 (3:6f78) - start_script - run_command ScriptCommand_JumpIfFlagZero2 - db EVENT_FLAG_0A - dw NO_JUMP - run_command ScriptCommand_PrintVariableText - tx Text06c4 - tx Text06c5 - run_command ScriptCommand_QuitScriptFully -; 0xef83 + start_script + run_command ScriptCommand_JumpIfFlagZero2 + db EVENT_FLAG_0A + dw NO_JUMP + run_command ScriptCommand_PrintVariableText + tx Text06c4 + tx Text06c5 + run_command ScriptCommand_QuitScriptFully Script_KenBattle_AlreadyHaveMedal: ; ef83 (3:6f83) - run_command ScriptCommand_PrintTextString - tx Text06c6 - run_command ScriptCommand_AskQuestionJump - tx Text06be - dw .do_battle - run_command ScriptCommand_PrintTextQuitFully - tx Text06bf + run_command ScriptCommand_PrintTextString + tx Text06c6 + run_command ScriptCommand_AskQuestionJump + tx Text06be + dw .do_battle + run_command ScriptCommand_PrintTextQuitFully + tx Text06bf .do_battle - run_command ScriptCommand_PrintTextString - tx Text06c7 - run_command ScriptCommand_StartBattle - db PRIZES_6 - db FIRE_CHARGE_DECK_ID - db MUSIC_DUEL_THEME_2 - run_command ScriptCommand_QuitScriptFully -; 0xef96 + run_command ScriptCommand_PrintTextString + tx Text06c7 + run_command ScriptCommand_StartBattle + db PRIZES_6 + db FIRE_CHARGE_DECK_ID + db MUSIC_DUEL_THEME_2 + run_command ScriptCommand_QuitScriptFully Preload_Clerk9: ; ef96 (3:6f96) call TryGiveMedalPCPacks diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm index 8e62188..7d84d19 100644 --- a/src/engine/bank04.asm +++ b/src/engine/bank04.asm @@ -13,8 +13,8 @@ Func_10000: ; 10000 (4:4000) bit LCDC_ENABLE_F, a jr nz, .asm_10025 xor a - ld [rSCX], a - ld [rSCY], a + ldh [rSCX], a + ldh [rSCY], a .asm_10025 call Func_1288c @@ -1164,7 +1164,7 @@ _GameLoop: ; 126d1 (4:66d1) scf ret -MainMenuFunctionTable: +MainMenuFunctionTable: ; 126fc (4:66fc) dw MainMenu_CardPop dw MainMenu_ContinueFromDiary dw MainMenu_NewGame diff --git a/src/engine/bank05.asm b/src/engine/bank05.asm index 901f7c5..79c168f 100644 --- a/src/engine/bank05.asm +++ b/src/engine/bank05.asm @@ -5736,7 +5736,7 @@ HandleSpecialAIMoves: ; 16dcd (5:6dcd) ; if any of card ID in a is found in deck, ; return a score of $80 + slots available in bench. -HandleCallForFamily: +HandleCallForFamily: ; 16e3e (5:6e3e) ld a, CARD_LOCATION_DECK call CheckIfAnyCardIDinLocation jr nc, HandleSpecialAIMoves.zero @@ -5752,7 +5752,7 @@ HandleCallForFamily: ; if any of NidoranM or NidoranF is found in deck, ; return a score of $80 + slots available in bench. -HandleNidoranFCallForFamily: +HandleNidoranFCallForFamily: ; 16e55 (5:6e55) ld e, NIDORANM ld a, CARD_LOCATION_DECK call CheckIfAnyCardIDinLocation @@ -5775,7 +5775,7 @@ HandleNidoranFCallForFamily: ; checks for certain card IDs of Fighting color in deck. ; if any of them are found, return a score of ; $80 + slots available in bench. -HandleMarowak1CallForFriend: +HandleMarowak1CallForFriend: ; 16e77 (5:6e77) ld e, GEODUDE ld a, CARD_LOCATION_DECK call CheckIfAnyCardIDinLocation diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm index ef8b699..9c8d24f 100644 --- a/src/engine/bank06.asm +++ b/src/engine/bank06.asm @@ -90,7 +90,7 @@ _CopyCardNameAndLevel: ; 18000 (6:4000) ret ; the name starts with TX_HALFWIDTH -_CopyCardNameAndLevel_HalfwidthText: +_CopyCardNameAndLevel_HalfwidthText: ; 18086 (6:4086) ld a, [wcd9b] inc a add a @@ -382,7 +382,7 @@ OpenInPlayAreaScreen: ; 180d5 (6:40d5) dw OpenInPlayAreaScreen_NonTurnHolderPlayArea ; 0x0e: INPLAYAREA_OPP_BENCH_4 dw OpenInPlayAreaScreen_NonTurnHolderPlayArea ; 0x0f: INPLAYAREA_OPP_BENCH_5 -OpenInPlayAreaScreen_TurnHolderPlayArea: +OpenInPlayAreaScreen_TurnHolderPlayArea: ; 18248 (6:4248) ; wInPlayAreaCurPosition constants conveniently map to (PLAY_AREA_* constants - 1) ; for bench locations. this mapping is taken for granted in the following code. ld a, [wInPlayAreaCurPosition] @@ -403,7 +403,7 @@ OpenInPlayAreaScreen_TurnHolderPlayArea: bank1call OpenCardPage_FromCheckPlayArea ret -OpenInPlayAreaScreen_NonTurnHolderPlayArea: +OpenInPlayAreaScreen_NonTurnHolderPlayArea: ; 1826a (6:426a) ld a, [wInPlayAreaCurPosition] sub INPLAYAREA_OPP_ACTIVE or a @@ -425,7 +425,7 @@ OpenInPlayAreaScreen_NonTurnHolderPlayArea: call SwapTurn ret -OpenInPlayAreaScreen_TurnHolderHand: +OpenInPlayAreaScreen_TurnHolderHand: ; 18293 (6:4293) ldh a, [hWhoseTurn] push af bank1call OpenTurnHolderHandScreen_Simple @@ -433,7 +433,7 @@ OpenInPlayAreaScreen_TurnHolderHand: ldh [hWhoseTurn], a ret -OpenInPlayAreaScreen_NonTurnHolderHand: +OpenInPlayAreaScreen_NonTurnHolderHand: ; 1829d (6:429d) ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderHandScreen_Simple @@ -441,7 +441,7 @@ OpenInPlayAreaScreen_NonTurnHolderHand: ldh [hWhoseTurn], a ret -OpenInPlayAreaScreen_TurnHolderDiscardPile: +OpenInPlayAreaScreen_TurnHolderDiscardPile: ; 182a7 (6:42a7) ldh a, [hWhoseTurn] push af bank1call OpenTurnHolderDiscardPileScreen @@ -449,7 +449,7 @@ OpenInPlayAreaScreen_TurnHolderDiscardPile: ldh [hWhoseTurn], a ret -OpenInPlayAreaScreen_NonTurnHolderDiscardPile: +OpenInPlayAreaScreen_NonTurnHolderDiscardPile: ; 182b1 (6:42b1) ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderDiscardPileScreen @@ -1197,7 +1197,7 @@ Func_19079: ; 19079 (6:5079) call Func_3b6a jp Func_18f9c.asm_4fd4 -PointerTable_006_508f: ; (6:508f) +PointerTable_006_508f: ; 1908f (6:508f) dw Func_18fdc dw Func_19014 dw Func_18fdd @@ -1523,10 +1523,10 @@ Func_19a12: ; 19a12 (6:5a12) ; 0x19a1f INCROM $19a1f, $19c20 - + Func_19c20: ; 19c20 (6:5c20) - INCROM $19c20, $1a4cf - + INCROM $19c20, $1a4cf + Func_1a4cf: ; 1a4cf (6:64cf) INCROM $1a4cf, $1a61f @@ -1715,32 +1715,32 @@ Func_1a73a: ; 1a73a (6:673a) pop hl ret -WhatIsYourNameData: ; (6:675e) +WhatIsYourNameData: ; 1a75e (6:675e) textitem 1, 1, WhatIsYourNameText db $ff ; [Deck1Data ~ Deck4Data] ; These are directed from around (2:4f05), ; without any bank description. ; That is, the developers hard-coded it. -_-;; -Deck1Data: ; (6:6763) +Deck1Data: ; 1a763 (6:6763) textitem 2, 1, Text022b textitem 14, 1, Text0219 db $ff -Deck2Data: ; (6:676c) +Deck2Data: ; 1a76c (6:676c) textitem 2, 1, Text022c textitem 14, 1, Text0219 db $ff -Deck3Data: ; (6:6775) +Deck3Data: ; 1a775 (6:6775) textitem 2, 1, Text022d textitem 14, 1, Text0219 db $ff -Deck4Data: ; (6:677e) +Deck4Data: ; 1a77e (6:677e) textitem 2, 1, Text022e textitem 14, 1, Text0219 db $ff ; set each byte zero from hl for b bytes. -ClearMemory: ; (6:6787) +ClearMemory: ; 1a787 (6:6787) push af push bc push hl @@ -1758,7 +1758,7 @@ ClearMemory: ; (6:6787) ; play different sfx by a. ; if a is 0xff play SFX_03 (usually following a B press), ; else play SFX_02 (usually following an A press). -PlayAcceptOrDeclineSFX: ; (6:6794) +PlayAcceptOrDeclineSFX: ; 1a794 (6:6794) push af inc a jr z, .sfx_decline @@ -1773,7 +1773,7 @@ PlayAcceptOrDeclineSFX: ; (6:6794) ; get player name from the user ; into hl -InputPlayerName: ; (6:67a3) +InputPlayerName: ; 1a7a3 (6:67a3) ld e, l ld d, h ld a, MAX_PLAYER_NAME_LENGTH @@ -1858,7 +1858,7 @@ InputPlayerName: ; (6:67a3) ; bc: position of name. ; de: dest. pointer. ; hl: pointer to text item of the question. -InitializeInputName: +InitializeInputName: ; 1a846 (6:6846) ld [wNamingScreenBufferMaxLength], a push hl ld hl, wNamingScreenNamePosition @@ -1900,7 +1900,7 @@ InitializeInputName: ld [wNamingScreenBufferLength], a ret -FinalizeInputName: +FinalizeInputName: ; 1a880 (6:6880) ld hl, wNamingScreenDestPointer ld e, [hl] inc hl @@ -1915,7 +1915,7 @@ FinalizeInputName: ; draws the keyboard frame ; and the question if it exists. -DrawNamingScreenBG: +DrawNamingScreenBG: ; 1a892 (6:6892) call DrawTextboxForKeyboard call PrintPlayerNameFromInput ld hl, wNamingScreenQuestionPointer @@ -1943,13 +1943,13 @@ DrawNamingScreenBG: textitem $0f, $10, EndText ; "End" db $ff -DrawTextboxForKeyboard: +DrawTextboxForKeyboard: ; 1a8c1 (6:68c1) lb de, 0, 3 ; x, y lb bc, 20, 15 ; w, h call DrawRegularTextBox ret -PrintPlayerNameFromInput: +PrintPlayerNameFromInput: ; 1a8cb (6:68cb) ld hl, wNamingScreenNamePosition ld d, [hl] inc hl @@ -1983,7 +1983,7 @@ endr ; check if button pressed. ; if pressed, set the carry bit on. -NamingScreen_CheckButtonState: +NamingScreen_CheckButtonState: ; 1a908 (6:6908) xor a ld [wPlaysSfx], a ldh a, [hDPadHeld] @@ -2232,7 +2232,7 @@ Func_1aa28: ; 1aa28 (6:6a28) ; load, to the first tile of v0Tiles0, the graphics for the ; blinking black square used in name input screens. ; for inputting full width text. -LoadTextCursorTile: +LoadTextCursorTile: ; 1aa65 (6:6a65) ld hl, v0Tiles0 + $00 tiles ld de, .data ld b, 0 @@ -2253,7 +2253,7 @@ endr ; set the carry bit on, ; if "End" was selected. -NamingScreen_ProcessInput: +NamingScreen_ProcessInput: ; 1aa87 (6:6a87) ld a, [wNamingScreenCursorX] ld h, a ld a, [wNamingScreenCursorY] @@ -2416,7 +2416,7 @@ NamingScreen_ProcessInput: ; it seems to have been deprecated as the game was translated into english. ; but it can still be applied to english, such as upper-lower case transition. ; hl: info. pointer. -TransformCharacter: +TransformCharacter: ; 1ab61 (6:6b61) ld a, [wNamingScreenBufferLength] or a jr z, .return ; if the length is zero, just return. @@ -2468,7 +2468,7 @@ TransformCharacter: ; it returns the pointer to the proper information. ; h: position x. ; l: position y. -GetCharInfoFromPos_Player: +GetCharInfoFromPos_Player: ; 1ab93 (6:6b93) push de ; (information index) = (x) * (height) + (y) ; (height) = 0x05(Deck) or 0x06(Player) @@ -2510,7 +2510,7 @@ else endc ENDM -KeyboardData_Player: ; (6:6baf) +KeyboardData_Player: ; 1abaf (6:6baf) kbitem $04, $02, $11, $00, TX_FULLWIDTH3, "A" kbitem $06, $02, $12, $00, TX_FULLWIDTH3, "J" kbitem $08, $02, $13, $00, TX_FULLWIDTH3, "S" @@ -2737,7 +2737,7 @@ InputDeckName: ; 1ad89 (6:6d89) ; load, to the first tile of v0Tiles0, the graphics for the ; blinking black square used in name input screens. ; for inputting half width text. -LoadHalfWidthTextCursorTile: +LoadHalfWidthTextCursorTile: ; 1ae37 (6:6e37) ld hl, v0Tiles0 + $00 tiles ld de, .data ld b, 0 @@ -2757,7 +2757,7 @@ rept TILE_SIZE endr ; it's only for naming the deck. -ProcessTextWithUnderbar: +ProcessTextWithUnderbar: ; 1ae59 (6:6e59) ld hl, wNamingScreenNamePosition ld d, [hl] inc hl @@ -3036,7 +3036,7 @@ Func_1afc2: ; 1afc2 (6:6fc2) ; its unit size is 3, and player's is 6. ; h: x ; l: y -GetCharInfoFromPos_Deck: +GetCharInfoFromPos_Deck: ; 1b000 (6:7000) push de ld e, l ld d, h @@ -3058,7 +3058,7 @@ GetCharInfoFromPos_Deck: jr nz, .loop ret -KeyboardData_Deck: ; (6:7019) +KeyboardData_Deck: ; 1b019 (6:7019) db $04, $02, "A" db $06, $02, "J" db $08, $02, "S" diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm index a4aa5f8..375a161 100644 --- a/src/engine/bank07.asm +++ b/src/engine/bank07.asm @@ -653,7 +653,7 @@ Func_1c8ef: ; 1c8ef (7:48ef) .address dw Func_1c94a -Func_1c94a: +Func_1c94a: ; 1c94a (7:494a) ld e, l ld d, h ld c, 3 @@ -805,6 +805,7 @@ macro_1ca04: MACRO dw \1 db \2 ENDM + Data_1ca04: ; value(2), flag(1) macro_1ca04 $5858, $08 @@ -823,7 +824,7 @@ Data_1ca04: macro_1ca04 $2838, $00 macro_1ca04 $2818, $00 -Func_1ca31: +Func_1ca31: ; 1ca31 (7:4a6b) push hl push bc ld a, [wd4ac] diff --git a/src/engine/bank1c.asm b/src/engine/bank1c.asm index cff0a96..b8ac4fb 100644 --- a/src/engine/bank1c.asm +++ b/src/engine/bank1c.asm @@ -176,13 +176,13 @@ Func_70136: ; 70136 (1c:4136) or LCDC_BGON ld [wLCDC], a ld a, %11100100 - ld [rBGP], a + ldh [rBGP], a call SetBGP xor a ldh [hSCX], a - ld [rSCX], a + ldh [rSCX], a ldh [hSCY], a - ld [rSCY], a + ldh [rSCY], a pop de pop bc pop hl diff --git a/src/engine/booster_packs.asm b/src/engine/booster_packs.asm index 8e7d0c2..238a8b2 100644 --- a/src/engine/booster_packs.asm +++ b/src/engine/booster_packs.asm @@ -164,7 +164,7 @@ GetBoosterCardType: ; 1e2a0 (7:62a0) pop hl ret -CardTypeTable: ; 1e2b1 (7:62b1) +CardTypeTable: ; 1e2b1 (7:62b1) db BOOSTER_CARD_TYPE_FIRE ; TYPE_PKMN_FIRE db BOOSTER_CARD_TYPE_GRASS ; TYPE_PKMN_GRASS db BOOSTER_CARD_TYPE_LIGHTNING ; TYPE_PKMN_LIGHTNING @@ -344,7 +344,7 @@ GenerateRandomEnergy: ; 1e387 (7:6387) jr AddBoosterEnergyToDrawnEnergies ; generates a booster with 10 random energies -GenerateRandomEnergyBooster: ; 1e390 (7:6390) +GenerateRandomEnergyBooster: ; 1e390 (7:6390) ld a, NUM_CARDS_IN_BOOSTER .generate_energy_loop push af @@ -355,22 +355,22 @@ GenerateRandomEnergyBooster: ; 1e390 (7:6390) jr ZeroBoosterRarityData ; generates a booster with 5 Lightning energies and 5 Fire energies -GenerateEnergyBoosterLightningFire: ; 1e39c (7:639c) +GenerateEnergyBoosterLightningFire: ; 1e39c (7:639c) ld hl, EnergyBoosterLightningFireData jr GenerateTwoTypesEnergyBooster ; generates a booster with 5 Water energies and 5 Fighting energies -GenerateEnergyBoosterWaterFighting: ; 1e3a1 (7:63a1) +GenerateEnergyBoosterWaterFighting: ; 1e3a1 (7:63a1) ld hl, EnergyBoosterWaterFightingData jr GenerateTwoTypesEnergyBooster ; generates a booster with 5 Grass energies and 5 Psychic energies -GenerateEnergyBoosterGrassPsychic: ; 1e3a6 (7:63a6) +GenerateEnergyBoosterGrassPsychic: ; 1e3a6 (7:63a6) ld hl, EnergyBoosterGrassPsychicData jr GenerateTwoTypesEnergyBooster ; generates a booster with 5 energies of 2 different types each -GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab) +GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab) ld b, $02 .add_two_energies_to_booster_loop ld c, NUM_CARDS_IN_BOOSTER / 2 @@ -388,7 +388,7 @@ GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab) jr nz, .add_two_energies_to_booster_loop ; fallthrough -ZeroBoosterRarityData: +ZeroBoosterRarityData: ; 1e3be (7:63be) xor a ld [wBoosterData_CommonAmount], a ld [wBoosterData_UncommonAmount], a @@ -453,7 +453,7 @@ PutEnergiesAndNonEnergiesTogether: ; 1e3f3 (7:63f3) ret ; add the final cards drawn from the booster pack to the player's colection (sCardCollection) -AddBoosterCardsToCollection:; 1e40a (7:640a) +AddBoosterCardsToCollection: ; 1e40a (7:640a) push hl ld hl, wBoosterCardsDrawn .add_cards_loop diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm index 2e7c40b..77c0375 100644 --- a/src/engine/effect_functions.asm +++ b/src/engine/effect_functions.asm @@ -38,7 +38,7 @@ SleepEffect: ; 2c030 (b:4030) lb bc, PSN_DBLPSN, ASLEEP jr ApplyStatusEffect -ApplyStatusEffect: +ApplyStatusEffect: ; 2c035 (b:4035) ldh a, [hWhoseTurn] ld hl, wWhoseTurn cp [hl] @@ -105,7 +105,7 @@ Func_2c087: ; 2c087 (b:4087) Func_2c08a: ; 2c08a (b:408a) ld a, $1 -Func_2c08c: +Func_2c08c: ; 2c08c (b:408c) push de push af ld a, OPPACTION_TOSS_COIN_A_TIMES diff --git a/src/engine/home.asm b/src/engine/home.asm index 11a7c37..140fcc9 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -39,8 +39,8 @@ Start: ; 0150 (0:0150) ld sp, $fffe push af xor a - ld [rIF], a - ld [rIE], a + ldh [rIF], a + ldh [rIE], a call ZeroRAM ld a, $1 call BankswitchROM @@ -87,16 +87,16 @@ VBlankHandler: ; 019b (0:019b) .no_oam_copy ; flush scaling/windowing parameters ldh a, [hSCX] - ld [rSCX], a + ldh [rSCX], a ldh a, [hSCY] - ld [rSCY], a + ldh [rSCY], a ldh a, [hWX] - ld [rWX], a + ldh [rWX], a ldh a, [hWY] - ld [rWY], a + ldh [rWY], a ; flush LCDC ld a, [wLCDC] - ld [rLCDC], a + ldh [rLCDC], a ei call wVBlankFunctionTrampoline call FlushPalettesIfRequested @@ -186,17 +186,17 @@ SetupTimer: ; 0241 (0:0241) ld b, -68 ; Value for Normal Speed call CheckForCGB jr c, .set_timer - ld a, [rKEY1] + ldh a, [rKEY1] and $80 jr z, .set_timer ld b, $100 - 2 * 68 ; Value for CGB Double Speed .set_timer ld a, b - ld [rTMA], a + ldh [rTMA], a ld a, TAC_16384_HZ - ld [rTAC], a + ldh [rTAC], a ld a, TAC_START | TAC_16384_HZ - ld [rTAC], a + ldh [rTAC], a ret ; return carry if not CGB @@ -231,36 +231,36 @@ EnableLCD: ; 0277 (0:0277) ret nz ; assert that LCD is off or LCDC_ON ; ld [wLCDC], a ; - ld [rLCDC], a ; turn LCD on + ldh [rLCDC], a ; turn LCD on ld a, FLUSH_ALL_PALS ld [wFlushPaletteFlags], a ret ; wait for vblank, then turn LCD off DisableLCD: ; 028a (0:028a) - ld a, [rLCDC] ; + ldh a, [rLCDC] ; bit LCDC_ENABLE_F, a ; ret z ; assert that LCD is on - ld a, [rIE] + ldh a, [rIE] ld [wIE], a res INT_VBLANK, a ; - ld [rIE], a ; disable vblank interrupt + ldh [rIE], a ; disable vblank interrupt .wait_vblank - ld a, [rLY] ; + ldh a, [rLY] ; cp LY_VBLANK ; jr nz, .wait_vblank ; wait for vblank - ld a, [rLCDC] ; + ldh a, [rLCDC] ; and LCDC_OFF ; - ld [rLCDC], a ; + ldh [rLCDC], a ; ld a, [wLCDC] ; and LCDC_OFF ; ld [wLCDC], a ; turn LCD off xor a - ld [rBGP], a - ld [rOBP0], a - ld [rOBP1], a + ldh [rBGP], a + ldh [rOBP0], a + ldh [rOBP1], a ld a, [wIE] - ld [rIE], a + ldh [rIE], a ret ; set OBJ size: 8x8 @@ -293,50 +293,50 @@ Set_WD_off: ; 02d4 (0:02d4) ; enable timer interrupt EnableInt_Timer: ; 02dd (0:02dd) - ld a, [rIE] + ldh a, [rIE] or 1 << INT_TIMER - ld [rIE], a + ldh [rIE], a ret ; enable vblank interrupt EnableInt_VBlank: ; 02e4 (0:02e4) - ld a, [rIE] + ldh a, [rIE] or 1 << INT_VBLANK - ld [rIE], a + ldh [rIE], a ret ; enable lcdc interrupt on hblank mode EnableInt_HBlank: ; 02eb (0:02eb) - ld a, [rSTAT] + ldh a, [rSTAT] or 1 << STAT_MODE_HBLANK - ld [rSTAT], a + ldh [rSTAT], a xor a - ld [rIF], a - ld a, [rIE] + ldh [rIF], a + ldh a, [rIE] or 1 << INT_LCD_STAT - ld [rIE], a + ldh [rIE], a ret ; disable lcdc interrupt and the hblank mode trigger DisableInt_HBlank: ; 02fb (0:02fb) - ld a, [rSTAT] + ldh a, [rSTAT] and ~(1 << STAT_MODE_HBLANK) - ld [rSTAT], a + ldh [rSTAT], a xor a - ld [rIF], a - ld a, [rIE] + ldh [rIF], a + ldh a, [rIE] and ~(1 << INT_LCD_STAT) - ld [rIE], a + ldh [rIE], a ret ; initialize scroll, window, and lcdc registers, set trampoline functions ; for the lcdc and vblank interrupts, latch clock data, and enable SRAM/RTC SetupRegisters: ; 030b (0:030b) xor a - ld [rSCY], a - ld [rSCX], a - ld [rWY], a - ld [rWX], a + ldh [rSCY], a + ldh [rSCX], a + ldh [rWY], a + ldh [rWX], a ld [wcab0], a ld [wcab1], a ld [wcab2], a @@ -378,7 +378,7 @@ DetectConsole: ; 0349 (0:0349) cp CONSOLE_CGB ret nz ld a, $01 - ld [rSVBK], a + ldh [rSVBK], a call SwitchToCGBDoubleSpeed ret @@ -386,10 +386,10 @@ DetectConsole: ; 0349 (0:0349) SetupPalettes: ; 036a (0:036a) ld hl, wBGP ld a, %11100100 - ld [rBGP], a + ldh [rBGP], a ld [hli], a ; wBGP - ld [rOBP0], a - ld [rOBP1], a + ldh [rOBP0], a + ldh [rOBP1], a ld [hli], a ; wOBP0 ld [hl], a ; wOBP1 xor a @@ -505,11 +505,11 @@ SetBGP: ; 040c (0:040c) ; fallthrough ; Flush non-CGB palettes and the first CGB palette -FlushPalette0: +FlushPalette0: ; 040f (0:040f) ld a, FLUSH_ONE_PAL ; fallthrough -FlushPalettes: +FlushPalettes: ; 0411 (0:0411) ld [wFlushPaletteFlags], a ld a, [wLCDC] rla @@ -545,11 +545,11 @@ FlushPalettesIfRequested: ; 042d (0:042d) ; flush grayscale (non-CGB) palettes ld hl, wBGP ld a, [hli] - ld [rBGP], a + ldh [rBGP], a ld a, [hli] - ld [rOBP0], a + ldh [rOBP0], a ld a, [hl] - ld [rOBP1], a + ldh [rOBP1], a ld a, [wConsole] cp CONSOLE_CGB jr z, .CGB @@ -600,7 +600,7 @@ CopyCGBPalettes: ; 0467 (0:0467) ld [$ff00+c], a inc c .wait - ld a, [rSTAT] + ldh a, [rSTAT] and 1 << STAT_BUSY ; wait until hblank or vblank jr nz, .wait ld a, [hl] @@ -653,7 +653,7 @@ EmptyScreen: ; 04a2 (0:04a2) AttrBlkPacket_EmptyScreen: ; 04bf (0:04bf) sgb ATTR_BLK, 1 ; sgb_command, length db 1 ; number of data sets - ; Control Code, Color Palette Designation, X1, Y1, X2, Y2 + ; Control Code, Color Palette Designation, X1, Y1, X2, Y2 db ATTR_BLK_CTRL_INSIDE + ATTR_BLK_CTRL_LINE, 0 << 0 + 0 << 2, 0, 0, 19, 17 ; data set 1 ds 6 ; data set 2 ds 2 ; data set 3 @@ -679,21 +679,21 @@ BCCoordToBGMap0Address: ; 04cf (0:04cf) ; the A + B + Start + Select combination resets the game ReadJoypad: ; 04de (0:04de) ld a, JOY_BTNS_SELECT - ld [rJOYP], a - ld a, [rJOYP] - ld a, [rJOYP] + ldh [rJOYP], a + ldh a, [rJOYP] + ldh a, [rJOYP] cpl and JOY_INPUT_MASK swap a ld b, a ; buttons data ld a, JOY_DPAD_SELECT - ld [rJOYP], a - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] + ldh [rJOYP], a + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] cpl and JOY_INPUT_MASK or b @@ -722,11 +722,11 @@ Reset: ; 051b (0:051b) di jp Start -SaveButtonsHeld: +SaveButtonsHeld: ; 0522 (0:0522) ld a, c ldh [hKeysHeld], a ld a, JOY_BTNS_SELECT | JOY_DPAD_SELECT - ld [rJOYP], a + ldh [rJOYP], a ret ; clear joypad hmem data @@ -824,7 +824,7 @@ CopyDMAFunction: ; 0593 (0:0593) ; CopyDMAFunction copies this function to hDMAFunction ($ff83) DMA: ; 05a1 (0:05a1) ld a, HIGH(wOAM) - ld [rDMA], a + ldh [rDMA], a ld a, $28 .wait dec a @@ -939,7 +939,7 @@ WriteBCDNumberInTextFormat: ; 0614 (0:0614) ; given a BCD digit in the (lower nybble) of register a, write it in text (ascii) ; format to hl. numbers above 9 end up converted to half-width font tiles. -WriteBCDDigitInTextFormat: +WriteBCDDigitInTextFormat: ; 061b (0:061b) and $0f add "0" cp "9" + 1 @@ -1322,7 +1322,7 @@ BankswitchVRAM0: ; 07c5 (0:07c5) push af xor a ldh [hBankVRAM], a - ld [rVBK], a + ldh [rVBK], a pop af ret @@ -1331,14 +1331,14 @@ BankswitchVRAM1: ; 07cd (0:07cd) push af ld a, $1 ldh [hBankVRAM], a - ld [rVBK], a + ldh [rVBK], a pop af ret ; set current dest VRAM bank to a BankswitchVRAM: ; 07d6 (0:07d6) ldh [hBankVRAM], a - ld [rVBK], a + ldh [rVBK], a ret ; switch to CGB Normal Speed Mode if playing on CGB and current mode is Double Speed Mode @@ -1361,20 +1361,20 @@ SwitchToCGBDoubleSpeed: ; 07e7 (0:07e7) ; switch between CGB Double Speed Mode and Normal Speed Mode CGBSpeedSwitch: ; 07f1 (0:07f1) - ld a, [rIE] + ldh a, [rIE] push af xor a - ld [rIE], a + ldh [rIE], a set 0, [hl] xor a - ld [rIF], a - ld [rIE], a + ldh [rIF], a + ldh [rIE], a ld a, $30 - ld [rJOYP], a + ldh [rJOYP], a stop call SetupTimer pop af - ld [rIE], a + ldh [rIE], a ret ; validate the saved data in SRAM @@ -1928,7 +1928,7 @@ Pal23Packet_0b00: ; 0b00 (0:0b00) AttrBlkPacket_0b10: ; 0b10 (0:0b10) sgb ATTR_BLK, 1 ; sgb_command, length db 1 ; number of data sets - ; Control Code, Color Palette Designation, X1, Y1, X2, Y2 + ; Control Code, Color Palette Designation, X1, Y1, X2, Y2 db ATTR_BLK_CTRL_INSIDE + ATTR_BLK_CTRL_LINE, 1 << 0 + 2 << 2, 5, 5, 10, 10 ; data set 1 ds 6 ; data set 2 ds 2 ; data set 3 @@ -1983,30 +1983,30 @@ DetectSGB: ; 0b59 (0:0b59) call Wait ld hl, MltReq2Packet call SendSGB - ld a, [rJOYP] + ldh a, [rJOYP] and %11 cp SNES_JOYPAD1 jr nz, .sgb ld a, P15 - ld [rJOYP], a - ld a, [rJOYP] - ld a, [rJOYP] + ldh [rJOYP], a + ldh a, [rJOYP] + ldh a, [rJOYP] ld a, P15 | P14 - ld [rJOYP], a + ldh [rJOYP], a ld a, P14 - ld [rJOYP], a - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] + ldh [rJOYP], a + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] ld a, P15 | P14 - ld [rJOYP], a - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] + ldh [rJOYP], a + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] + ldh a, [rJOYP] and %11 cp SNES_JOYPAD1 jr nz, .sgb @@ -2037,13 +2037,13 @@ Func_0bcb: ; 0bcb (0:0bcb) di push de .wait_vbalnk - ld a, [rLY] + ldh a, [rLY] cp LY_VBLANK + 3 jr nz, .wait_vbalnk ld a, LCDC_BGON | LCDC_OBJON | LCDC_WIN9C00 - ld [rLCDC], a + ldh [rLCDC], a ld a, %11100100 - ld [rBGP], a + ldh [rBGP], a ld de, v0Tiles1 ld bc, v0BGMap0 - v0Tiles1 .tiles_loop @@ -2069,7 +2069,7 @@ Func_0bcb: ; 0bcb (0:0bcb) dec c jr nz, .bgmap_outer_loop ld a, LCDC_BGON | LCDC_OBJON | LCDC_WIN9C00 | LCDC_ON - ld [rLCDC], a + ldh [rLCDC], a pop hl call SendSGB ei @@ -2098,12 +2098,12 @@ HblankCopyDataHLtoDE: ; 0c19 (0:0c19) .loop ei di - ld a, [rSTAT] ; + ldh a, [rSTAT] ; and STAT_LCDC_STATUS ; jr nz, .loop ; assert hblank ld a, [hl] ld [de], a - ld a, [rSTAT] ; + ldh a, [rSTAT] ; and STAT_LCDC_STATUS ; jr nz, .loop ; assert still in hblank ei @@ -2120,12 +2120,12 @@ HblankCopyDataDEtoHL: ; 0c32 (0:0c32) .loop ei di - ld a, [rSTAT] ; + ldh a, [rSTAT] ; and STAT_LCDC_STATUS ; jr nz, .loop ; assert hblank ld a, [de] ld [hl], a - ld a, [rSTAT] ; + ldh a, [rSTAT] ; and STAT_LCDC_STATUS ; jr nz, .loop ; assert still in hblank ei @@ -2228,13 +2228,13 @@ SerialTimerHandler: ; 0c91 (0:0c91) jr z, .check_for_timeout ret .begin_transfer - ld a, [rSC] ; + ldh a, [rSC] ; add a ; make sure that no serial transfer is active ret c ; ld a, SC_INTERNAL - ld [rSC], a ; use internal clock + ldh [rSC], a ; use internal clock ld a, SC_START | SC_INTERNAL - ld [rSC], a ; use internal clock, set transfer start flag + ldh [rSC], a ; use internal clock, set transfer start flag ret .check_for_timeout ; sets bit7 of [wSerialFlags] if the serial interrupt hasn't triggered @@ -2273,11 +2273,11 @@ Func_0cc5: ; 0cc5 (0:0cc5) ret .asm_cdc ld a, $29 - ld [rSB], a + ldh [rSB], a ld a, SC_INTERNAL - ld [rSC], a + ldh [rSC], a ld a, SC_START | SC_INTERNAL - ld [rSC], a + ldh [rSC], a .asm_ce8 ld a, [hl] or a @@ -2330,17 +2330,17 @@ SerialHandler: ; 0d26 (0:0d26) or a ; jr z, .asm_d55 ; skip ahead if [wSerialOp] zero ; send/receive a byte - ld a, [rSB] + ldh a, [rSB] call SerialHandleRecv call SerialHandleSend ; returns byte to actually send push af .wait_for_completion - ld a, [rSC] + ldh a, [rSC] add a jr c, .wait_for_completion pop af ; end send/receive - ld [rSB], a ; prepare sending byte (from Func_0dc8?) + ldh [rSB], a ; prepare sending byte (from Func_0dc8?) ld a, [wSerialOp] cp $29 jr z, .done ; if [wSerialOp] != $29, use external clock @@ -2348,16 +2348,16 @@ SerialHandler: ; 0d26 (0:0d26) .asm_d55 ld a, $1 ld [wSerialRecvCounter], a - ld a, [rSB] + ldh a, [rSB] ld [wSerialRecvBuf], a ld a, $ac - ld [rSB], a + ldh [rSB], a ld a, [wSerialRecvBuf] cp $12 ; if [wSerialRecvBuf] != $12, use external clock jr z, .done ; and prepare for next byte. either way, return .asm_d6a ld a, SC_START | SC_EXTERNAL - ld [rSC], a ; transfer start, use external clock + ldh [rSC], a ; transfer start, use external clock .done ld hl, wSerialCounter inc [hl] @@ -2592,25 +2592,25 @@ SerialExchangeBytes: ; 0e63 (0:0e63) Func_0e8e: ; 0e8e (0:0e8e) call ClearSerialData ld a, $12 - ld [rSB], a ; send $12 + ldh [rSB], a ; send $12 ld a, SC_START | SC_EXTERNAL - ld [rSC], a ; use external clock, set transfer start flag - ld a, [rIF] + ldh [rSC], a ; use external clock, set transfer start flag + ldh a, [rIF] and ~(1 << INT_SERIAL) - ld [rIF], a ; clear serial interrupt flag - ld a, [rIE] + ldh [rIF], a ; clear serial interrupt flag + ldh a, [rIE] or 1 << INT_SERIAL ; enable serial interrupt - ld [rIE], a + ldh [rIE], a ret ; disable serial interrupt, and clear rSB, rSC, and serial registers in WRAM ResetSerial: ; 0ea6 (0:0ea6) - ld a, [rIE] + ldh a, [rIE] and ~(1 << INT_SERIAL) - ld [rIE], a + ldh [rIE], a xor a - ld [rSB], a - ld [rSC], a + ldh [rSB], a + ldh [rSC], a ; fallthrough ; zero serial registers in WRAM @@ -4334,7 +4334,7 @@ CopyMoveDataAndDamage_FromDeckIndex: ; 16c0 (0:16c0) call LoadCardDataToBuffer1_FromDeckIndex ; fallthrough -CopyMoveDataAndDamage: +CopyMoveDataAndDamage: ; 16ca (0:16ca) ld a, [wLoadedCard1ID] ld [wTempCardID_ccc2], a ld hl, wLoadedCard1Move1 @@ -5691,7 +5691,7 @@ DrawRegularTextBoxDMG: ; 1e88 (0:1e88) ; continue drawing a labeled or regular textbox on DMG or SGB: ; body and bottom line of either type of textbox -ContinueDrawingTextBoxDMGorSGB: +ContinueDrawingTextBoxDMGorSGB: ; 1e93 (0:1e93) dec c dec c .draw_text_box_body_loop @@ -5742,7 +5742,7 @@ CopyLine: ; 1ea5 (0:1ea5) ret ; DrawRegularTextBox branches here on CGB console -DrawRegularTextBoxCGB: +DrawRegularTextBoxCGB: ; 1ec9 (0:1ec9) call DECoordToBGMap0Address ; top line (border) of the text box ld a, SYM_BOX_TOP @@ -5752,7 +5752,7 @@ DrawRegularTextBoxCGB: ; continue drawing a labeled or regular textbox on CGB: ; body and bottom line of either type of textbox -ContinueDrawingTextBoxCGB: +ContinueDrawingTextBoxCGB: ; 1ed4 (0:1ed4) dec c dec c .draw_text_box_body_loop @@ -5786,7 +5786,7 @@ CopyCurrentLineTilesAndAttrCGB: ; 1efb (0:1efb) pop hl ; fallthrough -CopyCurrentLineAttrCGB: +CopyCurrentLineAttrCGB: ; 1f00 (0:1f00) call BankswitchVRAM1 ld a, [wTextBoxFrameType] ; on CGB, wTextBoxFrameType determines the palette and the other attributes ld e, a @@ -5807,7 +5807,7 @@ DrawRegularTextBoxSGB: ; 1f0f (0:1f0f) ret z ; fallthrough -ColorizeTextBoxSGB: +ColorizeTextBoxSGB: ; 1f1b (0:1f1b) push bc push de ld hl, wTempSGBPacket @@ -5852,7 +5852,7 @@ ColorizeTextBoxSGB: AttrBlkPacket_TextBox: ; 1f4f (0:1f4f) sgb ATTR_BLK, 1 ; sgb_command, length db 1 ; number of data sets - ; Control Code, Color Palette Designation, X1, Y1, X2, Y2 + ; Control Code, Color Palette Designation, X1, Y1, X2, Y2 db ATTR_BLK_CTRL_INSIDE + ATTR_BLK_CTRL_LINE, 0 << 0 + 1 << 2, 0, 0, 0, 0 ; data set 1 ds 6 ; data set 2 ds 2 ; data set 3 @@ -6204,7 +6204,7 @@ LoadSymbolsFont: ; 2119 (0:2119) ; if $4000 ≤ hl ≤ $7fff ; copy b tiles from Gfx2:hl to de CopyFontsOrDuelGraphicsTiles: ; 2121 (0:2121) - ld a, BANK(Fonts); BANK(DuelGraphics) + ld a, BANK(Fonts) ; BANK(DuelGraphics) call BankpushROM ld c, TILE_SIZE call CopyGfxData @@ -6259,10 +6259,10 @@ DrawDuelBoxMessage: ; 2167 (0:2167) jp FillRectangle ; load the tiles for the latin, katakana, and hiragana fonts into VRAM -; from gfx/fonts/full_width/3.1bpp and gfx/fonts/full_width/4.t3.1bpp +; from gfx/fonts/full_width/3.1bpp and gfx/fonts/full_width/4.1bpp LoadFullWidthFontTiles: ; 2189 (0:2189) ld hl, FullWidthFonts + $3cc tiles_1bpp - $4000 - ld a, BANK(Fonts); BANK(DuelGraphics) + ld a, BANK(Fonts) ; BANK(DuelGraphics) call BankpushROM push hl ld e, l @@ -7021,7 +7021,7 @@ ConvertTileNumberToTileDataAddress: ; 2518 (0:2518) ; create, at wTextTileBuffer, a full-width font tile given its ; within the full-width font graphics (FullWidthFonts) in hl CreateFullWidthFontTile: ; 252e (0:252e) - ld a, BANK(Fonts); BANK(DuelGraphics) + ld a, BANK(Fonts) ; BANK(DuelGraphics) call BankpushROM ld de, wTextTileBuffer push de @@ -7487,7 +7487,7 @@ PrintCardListItems: ; 2799 (0:2799) ; like PrintCardListItems, except more parameters are already initialized ; called instead of PrintCardListItems to reload the list after moving up or down -ReloadCardListItems: +ReloadCardListItems: ; 27af (0:27af) ld e, SYM_SPACE ld a, [wListScrollOffset] or a @@ -8064,7 +8064,7 @@ YesOrNoMenuWithText_LeftAligned: ; 2afe (0:2afe) lb de, 2, 16 ; x, y ; fallthrough -HandleYesOrNoMenu: +HandleYesOrNoMenu: ; 2b0a (0:2b0a) ld a, d ld [wLeftmostItemCursorX], a lb bc, SYM_CURSOR_R, SYM_SPACE ; cursor tile, tile behind cursor @@ -8999,7 +8999,7 @@ LoadCardGfx: ; 2fa0 (0:2fa0) ; identical to CopyFontsOrDuelGraphicsTiles CopyFontsOrDuelGraphicsTiles2: ; 2fcb (0:2fcb) - ld a, BANK(Fonts); BANK(DuelGraphics) + ld a, BANK(Fonts) ; BANK(DuelGraphics) call BankpushROM ld c, TILE_SIZE call CopyGfxData @@ -9422,14 +9422,14 @@ Func_31e5: ; 31e5 (0:31e5) jr Func_31e0 Func_31ea: ; 31ea (0:31ea) - ld a, [rSB] + ldh a, [rSB] ld [wce6e], a Func_31ef: ; 31ef (0:31ef) xor a jr Func_31e0 Func_31f2: ; 31f2 (0:31f2) - ld a, [rSB] + ldh a, [rSB] ld [wce6f], a xor a ld [wce63], a @@ -9456,11 +9456,11 @@ Func_31fc: ; 31fc (0:31fc) ; fallthrough Func_3212: ; 3212 (0:3212) - ld [rSB], a + ldh [rSB], a ld a, SC_INTERNAL - ld [rSC], a + ldh [rSC], a ld a, SC_START | SC_INTERNAL - ld [rSC], a + ldh [rSC], a ret ; doubles the damage at de if swords dance or focus energy was used @@ -10365,7 +10365,7 @@ GetArenaCardWeakness: ; 3730 (0:3730) ld a, DUELVARS_ARENA_CARD ; fallthrough -GetCardWeakness: +GetCardWeakness: ; 3739 (0:3739) call GetTurnDuelistVariable call LoadCardDataToBuffer2_FromDeckIndex ld a, [wLoadedCard2Weakness] @@ -10390,7 +10390,7 @@ GetArenaCardResistance: ; 374a (0:374a) ld a, DUELVARS_ARENA_CARD ; fallthrough -GetCardResistance: +GetCardResistance: ; 3753 (0:3753) call GetTurnDuelistVariable call LoadCardDataToBuffer2_FromDeckIndex ld a, [wLoadedCard2Resistance] @@ -11278,7 +11278,7 @@ CallBC: ; 3c46 (0:3c46) DoFrameIfLCDEnabled: ; 3c48 (0:3c48) push af - ld a, [rLCDC] + ldh a, [rLCDC] bit LCDC_ENABLE_F, a jr z, .done push bc @@ -11548,7 +11548,7 @@ GetSpriteAnimBufferProperty: ; 3dbf (0:3dbf) ld a, [wWhichSprite] ; fallthrough -GetSpriteAnimBufferProperty_SpriteInA: +GetSpriteAnimBufferProperty_SpriteInA: ; 3dc2 (0:3dc2) cp SPRITE_ANIM_BUFFER_CAPACITY jr c, .got_sprite debug_ret |