diff options
Diffstat (limited to 'engine')
-rwxr-xr-x | engine/hidden_object_functions17.asm | 48 | ||||
-rwxr-xr-x | engine/hidden_object_functions7.asm | 24 | ||||
-rwxr-xr-x | engine/learn_move.asm | 14 | ||||
-rwxr-xr-x | engine/menu/main_menu.asm | 5 | ||||
-rwxr-xr-x | engine/menu/pokedex.asm | 3 | ||||
-rwxr-xr-x | engine/menu/prize_menu.asm | 2 | ||||
-rwxr-xr-x | engine/menu/start_sub_menus.asm | 4 | ||||
-rwxr-xr-x | engine/oak_speech2.asm | 2 | ||||
-rwxr-xr-x | engine/save.asm | 2 |
9 files changed, 55 insertions, 49 deletions
diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index a2167b54..77f3eeb9 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -98,7 +98,7 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld [W_ANIMATIONID], a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld a, $3 + ld a, A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a ld a, $3 ld [wMaxMenuItem], a @@ -106,7 +106,7 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld [wTopMenuItemY], a ld a, $1 ld [wTopMenuItemX], a -.asm_5c51 +.linkHelpLoop ld hl, wd730 set 6, [hl] coord hl, 0, 0 @@ -119,11 +119,11 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld hl, LinkCableHelpText2 call PrintText call HandleMenuInput - bit 1, a - jr nz, .asm_5dc93 + bit 1, a ; pressed b + jr nz, .exit ld a, [wCurrentMenuItem] - cp $3 - jr z, .asm_5dc93 + cp $3 ; pressed a on "STOP READING" + jr z, .exit ld hl, wd730 res 6, [hl] ld hl, LinkCableInfoTexts @@ -135,8 +135,8 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld h, [hl] ld l, a call PrintText - jp .asm_5c51 -.asm_5dc93 + jp .linkHelpLoop +.exit ld hl, wd730 res 6, [hl] call LoadScreenTilesFromBuffer1 @@ -182,7 +182,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [W_ANIMATIONID], a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld a, $33 + ld a, D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a ld a, $2 ld [wMaxMenuItem], a @@ -190,7 +190,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [wTopMenuItemY], a ld a, $1 ld [wTopMenuItemX], a -.asm_5dd15 +.blackboardLoop ld hl, wd730 set 6, [hl] coord hl, 0, 0 @@ -204,11 +204,12 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) call PlaceString ld hl, ViridianSchoolBlackboardText2 call PrintText - call HandleMenuInput - bit 1, a + call HandleMenuInput ; pressing up and down is handled in here + bit 1, a ; pressed b jr nz, .exitBlackboard - bit 4, a - jr z, .asm_5dd5c + bit 4, a ; pressed right + jr z, .didNotPressRight + ; move cursor to right column ld a, $2 ld [wMaxMenuItem], a ld a, $2 @@ -217,10 +218,11 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [wTopMenuItemX], a ld a, $3 ld [W_ANIMATIONID], a - jr .asm_5dd15 -.asm_5dd5c - bit 5, a - jr z, .asm_5dd75 + jr .blackboardLoop +.didNotPressRight + bit 5, a ; pressed left + jr z, .didNotPressLeftOrRight + ; move cursor to left column ld a, $2 ld [wMaxMenuItem], a ld a, $2 @@ -229,14 +231,16 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [wTopMenuItemX], a xor a ld [W_ANIMATIONID], a - jr .asm_5dd15 -.asm_5dd75 + jr .blackboardLoop +.didNotPressLeftOrRight ld a, [wCurrentMenuItem] ld b, a ld a, [W_ANIMATIONID] add b - cp $5 + cp $5 ; cursor is pointing to "QUIT" jr z, .exitBlackboard + ; we must have pressed a on a status condition + ; so print the text ld hl, wd730 res 6, [hl] ld hl, ViridianBlackboardStatusPointers @@ -248,7 +252,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld h, [hl] ld l, a call PrintText - jp .asm_5dd15 + jp .blackboardLoop .exitBlackboard ld hl, wd730 res 6, [hl] diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 67e75301..02d3928a 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -394,7 +394,7 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) ld [W_ANIMATIONID], a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld a, $3 + ld a, A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a ld a, $4 ld [wMaxMenuItem], a @@ -402,7 +402,7 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) ld [wTopMenuItemY], a ld a, $1 ld [wTopMenuItemX], a -.asm_1ec2d +.billsPokemonLoop ld hl, wd730 set 6, [hl] coord hl, 0, 0 @@ -416,24 +416,24 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) call PrintText call SaveScreenTilesToBuffer2 call HandleMenuInput - bit 1, a - jr nz, .asm_1ec74 + bit 1, a ; pressed b + jr nz, .cancel ld a, [wCurrentMenuItem] add EEVEE cp EEVEE - jr z, .asm_1ec6c + jr z, .displayPokedex cp FLAREON - jr z, .asm_1ec6c + jr z, .displayPokedex cp JOLTEON - jr z, .asm_1ec6c + jr z, .displayPokedex cp VAPOREON - jr z, .asm_1ec6c - jr .asm_1ec74 -.asm_1ec6c + jr z, .displayPokedex + jr .cancel +.displayPokedex call DisplayPokedex call LoadScreenTilesFromBuffer2 - jr .asm_1ec2d -.asm_1ec74 + jr .billsPokemonLoop +.cancel ld hl, wd730 res 6, [hl] call LoadScreenTilesFromBuffer2 diff --git a/engine/learn_move.asm b/engine/learn_move.asm index aeb7d23d..46d30bd9 100755 --- a/engine/learn_move.asm +++ b/engine/learn_move.asm @@ -116,7 +116,7 @@ TryingToLearn: ; 6f07 (1:6f07) call CopyData callab FormatMovesString pop hl -.asm_6f39 +.loop push hl ld hl, WhichMoveToForgetText call PrintText @@ -155,8 +155,8 @@ TryingToLearn: ; 6f07 (1:6f07) call LoadScreenTilesFromBuffer1 pop af pop hl - bit 1, a - jr nz, .asm_6fab + bit 1, a ; pressed b + jr nz, .cancel push hl ld a, [wCurrentMenuItem] ld c, a @@ -169,17 +169,17 @@ TryingToLearn: ; 6f07 (1:6f07) pop bc pop de ld a, d - jr c, .asm_6fa2 + jr c, .hm pop hl add hl, bc and a ret -.asm_6fa2 +.hm ld hl, HMCantDeleteText call PrintText pop hl - jr .asm_6f39 -.asm_6fab + jr .loop +.cancel scf ret diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index 5e853aae..24302c46 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -61,7 +61,7 @@ MainMenu: ; 5af2 (1:5af2) ld [wTopMenuItemX],a inc a ld [wTopMenuItemY],a - ld a,$B + ld a,A_BUTTON | B_BUTTON | START ld [wMenuWatchedKeys],a ld a,[wSaveFileStatus] ld [wMaxMenuItem],a @@ -163,7 +163,8 @@ LinkMenu: ; 5c0a (1:5c0a) ld a, $2 ld [hli], a inc a - ld [hli], a + ; ld a, A_BUTTON | B_BUTTON + ld [hli], a ; wMenuWatchedKeys xor a ld [hl], a .waitForInputLoop diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index fd8a928d..8e69329a 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -27,7 +27,7 @@ ShowPokedexMenu: ; 40000 (10:4000) inc hl ld a,6 ld [hli],a ; max menu item ID - ld [hl],%00110011 ; menu watched keys (Left, Right, B button, A button) + ld [hl],D_LEFT | D_RIGHT | B_BUTTON | A_BUTTON call HandlePokedexListMenu jr c,.goToSideMenu ; if the player chose a pokemon from the list .exitPokedex @@ -88,6 +88,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) inc hl ld a,3 ld [hli],a ; max menu item ID + ;ld a, A_BUTTON | B_BUTTON ld [hli],a ; menu watched keys (A button and B button) xor a ld [hli],a ; old menu item ID diff --git a/engine/menu/prize_menu.asm b/engine/menu/prize_menu.asm index 2bf932ba..409f0bdb 100755 --- a/engine/menu/prize_menu.asm +++ b/engine/menu/prize_menu.asm @@ -13,7 +13,7 @@ CeladonPrizeMenu: ; 5271b (14:671b) xor a ld [wCurrentMenuItem],a ld [wLastMenuItem],a - ld a,$03 + ld a,A_BUTTON | B_BUTTON ld [wMenuWatchedKeys],a ld a,$03 ld [wMaxMenuItem],a diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index 4dc84d06..f726f128 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -57,7 +57,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) inc hl ld a,b ld [hli],a ; max menu item ID - ld a,%00000011 ; A button, B button + ld a,A_BUTTON | B_BUTTON ld [hli],a ; menu watched keys xor a ld [hl],a @@ -354,7 +354,7 @@ StartMenu_Item: ; 13302 (4:7302) inc hl inc a ; a = 1 ld [hli],a ; max menu item ID - ld a,%00000011 ; A button, B button + ld a,A_BUTTON | B_BUTTON ld [hli],a ; menu watched keys xor a ld [hl],a ; old menu item id diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm index 23f39fd5..673c13ad 100755 --- a/engine/oak_speech2.asm +++ b/engine/oak_speech2.asm @@ -177,7 +177,7 @@ DisplayIntroNameTextBox: ; 6a6c (1:6a6c) ld [wLastMenuItem], a inc a ld [wTopMenuItemX], a - ld [wMenuWatchedKeys], a + ld [wMenuWatchedKeys], a ; A_BUTTON inc a ld [wTopMenuItemY], a inc a diff --git a/engine/save.asm b/engine/save.asm index 26f9507f..ae895d96 100755 --- a/engine/save.asm +++ b/engine/save.asm @@ -356,7 +356,7 @@ ChangeBox:: ; 738a1 (1c:78a1) call HandleMenuInput ld hl, hFlags_0xFFF6 res 1, [hl] - bit 1, a + bit 1, a ; pressed b ret nz call GetBoxSRAMLocation ld e, l |