diff options
-rwxr-xr-x | engine/hidden_object_functions7.asm | 4 | ||||
-rwxr-xr-x | engine/menu/main_menu.asm | 4 | ||||
-rwxr-xr-x | engine/menu/pokedex.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/oaks_aide.asm | 34 | ||||
-rwxr-xr-x | engine/pokedex_rating.asm | 30 | ||||
-rw-r--r-- | home.asm | 4 | ||||
-rw-r--r-- | hram.asm | 13 | ||||
-rwxr-xr-x | scripts/celadonmansion3.asm | 2 | ||||
-rwxr-xr-x | scripts/oakslab.asm | 4 | ||||
-rwxr-xr-x | scripts/route11gateupstairs.asm | 8 | ||||
-rwxr-xr-x | scripts/route15gateupstairs.asm | 8 | ||||
-rwxr-xr-x | scripts/route2gate.asm | 8 | ||||
-rw-r--r-- | text.asm | 12 | ||||
-rw-r--r-- | text/maps/oaks_lab.asm | 4 | ||||
-rwxr-xr-x | wram.asm | 2 |
15 files changed, 78 insertions, 63 deletions
diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index e3c296ca..0753531e 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -19,8 +19,8 @@ DisplayOakLabRightPoster: ; 1e965 (7:6965) ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [wd11e] - cp $2 + ld a, [wNumSetBits] + cp 2 tx_pre_id SaveOptionText jr c, .ownThreeOrMoreMon tx_pre_id StrengthsAndWeaknessesText diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index f99e5b80..b8896d79 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -395,7 +395,7 @@ PrintNumBadges: ; 5e2f (1:5e2f) ld b, $1 call CountSetBits pop hl - ld de, wd11e + ld de, wNumSetBits lb bc, 1, 2 jp PrintNumber @@ -405,7 +405,7 @@ PrintNumOwnedMons: ; 5e42 (1:5e42) ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits pop hl - ld de, wd11e + ld de, wNumSetBits lb bc, 1, 3 jp PrintNumber diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index ead2c359..b5ebd83e 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -169,14 +169,14 @@ HandlePokedexListMenu: ; 40111 (10:4111) ld hl,wPokedexSeen ld b,wPokedexSeenEnd - wPokedexSeen call CountSetBits - ld de,wd11e + ld de, wNumSetBits coord hl, 16, 3 lb bc, 1, 3 call PrintNumber ; print number of seen pokemon ld hl,wPokedexOwned ld b,wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld de,wd11e + ld de, wNumSetBits coord hl, 16, 6 lb bc, 1, 3 call PrintNumber ; print number of owned pokemon diff --git a/engine/overworld/oaks_aide.asm b/engine/overworld/oaks_aide.asm index 00f6ea82..31832315 100755 --- a/engine/overworld/oaks_aide.asm +++ b/engine/overworld/oaks_aide.asm @@ -4,45 +4,45 @@ OaksAideScript: ; 0x59035 call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_59086 + jr nz, .choseNo ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [wd11e] - ld [$ffdd], a + ld a, [wNumSetBits] + ld [hOaksAideNumMonsOwned], a ld b, a - ld a, [$ffdb] + ld a, [hOaksAideRequirement] cp b - jr z, .asm_59059 - jr nc, .asm_5907c -.asm_59059 + jr z, .giveItem + jr nc, .notEnoughOwnedMons +.giveItem ld hl, OaksAideHereYouGoText call PrintText - ld a, [$ffdc] + ld a, [hOaksAideItemReward] ld b, a ld c, 1 call GiveItem - jr nc, .BagFull + jr nc, .bagFull ld hl, OaksAideGotItemText call PrintText ld a, $1 - jr .asm_5908e -.BagFull + jr .done +.bagFull ld hl, OaksAideNoRoomText call PrintText xor a - jr .asm_5908e -.asm_5907c + jr .done +.notEnoughOwnedMons ld hl, OaksAideUhOhText call PrintText ld a, $80 - jr .asm_5908e -.asm_59086 + jr .done +.choseNo ld hl, OaksAideComeBackText call PrintText ld a, $ff -.asm_5908e - ld [$ffdb], a +.done + ld [hOaksAideResult], a ret OaksAideHiText: ; 59091 (16:5091) diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm index ca88673f..265eff40 100755 --- a/engine/pokedex_rating.asm +++ b/engine/pokedex_rating.asm @@ -2,18 +2,18 @@ DisplayDexRating: ; 44169 (11:4169) ld hl, wPokedexSeen ld b, wPokedexSeenEnd - wPokedexSeen call CountSetBits - ld a, [wd11e] ; result of CountSetBits (seen count) - ld [$FFDB], a + ld a, [wNumSetBits] + ld [hDexRatingNumMonsSeen], a ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [wd11e] ; result of CountSetBits (own count) - ld [$FFDC], a + ld a, [wNumSetBits] + ld [hDexRatingNumMonsOwned], a ld hl, DexRatingsTable .findRating ld a, [hli] ld b, a - ld a, [$FFDC] ; number of pokemon owned + ld a, [hDexRatingNumMonsOwned] cp b jr c, .foundRating inc hl @@ -24,30 +24,30 @@ DisplayDexRating: ; 44169 (11:4169) ld h, [hl] ld l, a ; load text pointer into hl CheckAndResetEventA EVENT_HALL_OF_FAME_DEX_RATING - jr nz, .label3 + jr nz, .hallOfFame push hl ld hl, PokedexRatingText_441cc call PrintText pop hl call PrintText callba PlayPokedexRatingSfx - jp WaitForTextScrollButtonPress ; wait for button press -.label3 + jp WaitForTextScrollButtonPress +.hallOfFame ld de, wcc5b - ld a, [$FFDB] + ld a, [hDexRatingNumMonsSeen] ld [de], a inc de - ld a, [$FFDC] + ld a, [hDexRatingNumMonsOwned] ld [de], a inc de -.label4 +.copyRatingTextLoop ld a, [hli] - cp a, $50 - jr z, .label5 + cp a, "@" + jr z, .doneCopying ld [de], a inc de - jr .label4 -.label5 + jr .copyRatingTextLoop +.doneCopying ld [de], a ret @@ -1292,7 +1292,7 @@ INCLUDE "engine/menu/start_menu.asm" ; hl = address of string of bytes ; b = length of string of bytes ; OUTPUT: -; [wd11e] = number of set bits +; [wNumSetBits] = number of set bits CountSetBits:: ; 2b7f (0:2b7f) ld c,0 .loop @@ -1309,7 +1309,7 @@ CountSetBits:: ; 2b7f (0:2b7f) dec b jr nz,.loop ld a,c - ld [wd11e],a ; store number of set bits + ld [wNumSetBits],a ret ; subtracts the amount the player paid from their money @@ -273,6 +273,19 @@ hGymGateIndex EQU $FFDB hGymTrashCanRandNumMask EQU $FFDB +hDexRatingNumMonsSeen EQU $FFDB +hDexRatingNumMonsOwned EQU $FFDC + +; $00 = bag full +; $01 = got item +; $80 = didn't meet required number of owned mons +; $FF = player cancelled +hOaksAideResult EQU $FFDB + +hOaksAideRequirement EQU $FFDB ; required number of owned mons +hOaksAideItemReward EQU $FFDC +hOaksAideNumMonsOwned EQU $FFDD + hItemToRemoveID EQU $FFDB hItemToRemoveIndex EQU $FFDC diff --git a/scripts/celadonmansion3.asm b/scripts/celadonmansion3.asm index 0dadd20a..11a8646d 100755 --- a/scripts/celadonmansion3.asm +++ b/scripts/celadonmansion3.asm @@ -30,7 +30,7 @@ DirectorText: ; 487b2 (12:47b2) ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [wd11e] + ld a, [wNumSetBits] cp 150 jr nc, .CompletedDex ld hl, .GameDesigner diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 996ab754..c52f00cf 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -969,8 +969,8 @@ OaksLabText5: ; 1d248 (7:5248) ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [wd11e] - cp $2 + ld a, [wNumSetBits] + cp 2 jr c, .asm_1d279 CheckEvent EVENT_GOT_POKEDEX jr z, .asm_1d279 diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index 9bae1398..a1906c5d 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -20,9 +20,9 @@ Route11GateUpstairsText2: ; 4946c (12:546c) CheckEvent EVENT_GOT_ITEMFINDER, 1 jr c, .asm_4949b ld a, 30 ; pokemon needed - ld [$ffdb], a + ld [hOaksAideRequirement], a ld a, ITEMFINDER ; oak's aide reward - ld [$ffdc], a + ld [hOaksAideItemReward], a ld [wd11e], a call GetItemName ld h, d @@ -30,8 +30,8 @@ Route11GateUpstairsText2: ; 4946c (12:546c) ld de, wcc5b ld bc, $000d call CopyData - predef OaksAideScript ; call oak's aide script - ld a, [$ffdb] + predef OaksAideScript + ld a, [hOaksAideResult] dec a jr nz, .asm_494a1 SetEvent EVENT_GOT_ITEMFINDER diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index cedabdc0..0fc806da 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -10,17 +10,17 @@ Route15GateUpstairsText1: ; 49651 (12:5651) CheckEvent EVENT_GOT_EXP_ALL jr nz, .asm_49683 ld a, 50 ; pokemon needed - ld [$ffdb], a + ld [hOaksAideRequirement], a ld a, EXP__ALL ; oak's aide reward - ld [$ffdc], a + ld [hOaksAideItemReward], a ld [wd11e], a call GetItemName ld hl, wcd6d ld de, wcc5b ld bc, $000d call CopyData - predef OaksAideScript ; call oak's aide script - ld a, [$ffdb] + predef OaksAideScript + ld a, [hOaksAideResult] cp $1 jr nz, .asm_49689 SetEvent EVENT_GOT_EXP_ALL diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index 789482dc..65d53bc7 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -10,17 +10,17 @@ Route2GateText1: ; 5d5db (17:55db) CheckEvent EVENT_GOT_HM05 jr nz, .asm_5d60d ld a, 10 ; pokemon needed - ld [$ffdb], a + ld [hOaksAideRequirement], a ld a, HM_05 ; oak's aide reward - ld [$ffdc], a + ld [hOaksAideItemReward], a ld [wd11e], a call GetItemName ld hl, wcd6d ld de, wcc5b ld bc, $000d call CopyData - predef OaksAideScript ; call oak's aide script - ld a, [$ffdb] + predef OaksAideScript + ld a, [hOaksAideResult] cp $1 jr nz, .asm_5d613 SetEvent EVENT_GOT_HM05 @@ -94,7 +94,7 @@ _OaksAideHiText:: ; 80143 (20:4143) cont "AIDE!" para "If you caught @" - TX_NUM $ffdb, 1, 3 + TX_NUM hOaksAideRequirement, 1, 3 db $0 line "kinds of #MON," cont "I'm supposed to" @@ -106,7 +106,7 @@ _OaksAideHiText:: ; 80143 (20:4143) para "So, ", $52, "! Have" line "you caught at" cont "least @" - TX_NUM $ffdb, 1, 3 + TX_NUM hOaksAideRequirement, 1, 3 text " kinds of" cont "#MON?" done @@ -115,12 +115,12 @@ _OaksAideUhOhText:: ; 801e4 (20:41e4) text "Let's see..." line "Uh-oh! You have" cont "caught only @" - TX_NUM $ffdd, 1, 3 + TX_NUM hOaksAideNumMonsOwned, 1, 3 db $0 cont "kinds of #MON!" para "You need @" - TX_NUM $ffdb, 1, 3 + TX_NUM hOaksAideRequirement, 1, 3 text " kinds" line "if you want the" cont "@" @@ -132,7 +132,7 @@ _OaksAideComeBackText:: ; 80250 (20:4250) text "Oh. I see." para "When you get @" - TX_NUM $ffdb, 1, 3 + TX_NUM hOaksAideRequirement, 1, 3 db $0 line "kinds, come back" cont "for @" @@ -143,7 +143,7 @@ _OaksAideComeBackText:: ; 80250 (20:4250) _OaksAideHereYouGoText:: ; 8028c (20:428c) text "Great! You have" line "caught @" - TX_NUM $ffdd, 1, 3 + TX_NUM hOaksAideNumMonsOwned, 1, 3 text " kinds " cont "of #MON!" cont "Congratulations!" diff --git a/text/maps/oaks_lab.asm b/text/maps/oaks_lab.asm index 58f55b85..6a3c6da6 100644 --- a/text/maps/oaks_lab.asm +++ b/text/maps/oaks_lab.asm @@ -547,10 +547,10 @@ _OaksLabText_441cc:: ; 9580c (25:580c) line "letion is:" para "@" - TX_NUM $ffdb, 1, 3 + TX_NUM hDexRatingNumMonsSeen, 1, 3 text " #MON seen" line "@" - TX_NUM $ffdc, 1, 3 + TX_NUM hDexRatingNumMonsOwned, 1, 3 text " #MON owned" para "PROF.OAK's" @@ -1882,6 +1882,8 @@ wFirstMonsNotOutYet:: ; d11d ; which will be the first mon sent out. ds 1 +wNumSetBits:: ; d11e + wd11e:: ds 1 ; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits wForcePlayerToChooseMon:: ; d11f |