From f160a1eb8d281c90b1b41c44c5c20270ac19e737 Mon Sep 17 00:00:00 2001 From: Nayru62 Date: Tue, 26 Sep 2023 21:14:04 -0400 Subject: [PATCH] Nayru's Pokedex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bundled: Idain's Custom Dex Colors and Toggle Shiny Palettes, doesnt impact you if you dont want it. REQUIRED: Replace StatExp with EVs, Expanded Tilesets to 255, Unique Mon Icons (or at least adapt to the new Bank structure, actual icons used are irrelevant) and my Gen3 Type/Status/Cat Tiles. Pokedex portion must be implemented. Other parts, optional. FEATURES: Base stats and info, Move Info, Detailed area info, Evoulation chart, and sprite page showing animated sprites (reflects shiny toggle too). Move Information: Lvl-Up Moves -> Field Moves (plus lvl learned and/or TM/HM/Move Tutor) -> Egg Moves -> TMs. I have fully functional code commented out to include HMs. But I decided not to since Field Moves serve the same purpse. But, if you've messed with adding or deleting Field Moves, I reccomend scrapping the Field Moves code and restoring the HM code. Please feel free to DM about this if it's an issue. I'm working on better solutions at some point. Move Page Future Ideas: Full Page toggle option, to show additional details about the moves, Type, power, category, accuracy, effects, etc AREA Pages: Currently supports Johto/Kanto Walking/grass/surfing encounters plus their swarms. Fishing Rods information is also included. Right now, all it will show you is the relevant Fishing Group Name. In the near future, it will print Route information like the other pages. To check your local Fishing Group, check your PokeGear. POKEGEAR: Now shows the detailed name of map you're currently in (based on Map Group & Map Number) and it also reads the map's attribute to see it's fishing group, if it has one. COMING SOON: AREA support for Headbutt Trees and Rock Smash Rocks and the Bug contest. Roaming Support for the dogs and any custom roamers. I also have an idea to have a python script scrape all information about special event pokemon (like Celebi, Ho-oh, Lugia, Starters, Casinos, Gift pokemon like Eevee) and NPC trades and displaying that. The script should be run if you ever make edits to these and will recompile the list. I should probably do this for Field Moves too, since people can and do have custom Field Moves... Feel Free to DM me any suggestions and feedback. If you want to help me design Tiles/GFX to help make everything easier to look at, I would be eternally grateful. Commit Notes: newest to oldest. I'm still not happy with field moves, having to maintain a seperate data table about the moves and if they're TM/HM/MT goes against the spirit of the project. but for now, it works, and will display the field move twice if can learn via lvl up & TM/HM/MT pokedexpart1 need to get mon icons pokedexpart2 Mon Icons are broken, Evo Page is borked, Sprite Page isnt animating Customizable Pokédex Color https://github.com/pret/pokecrystal/wiki/Customizable-Pok%C3%A9dex-Color Plus changing _CGB_PokedexSearchOption: in engine/gfx/cgb_layouts.asm, ld a, PREDEFPAL_POKEDEX -> call CheckPokedexColor pokedex Restore EV code Pokedex, fixed animations reflected the latest commit that changed sprite stuff, copied the relevant old funcs from lilikoi and updated to the new Constants https://github.com/pret/pokecrystal/pull/1055 Pokedex: PokeGear shows fish group, cards wrap In the Pokedex, Press start to bring up the Vanilla AREA option, and Kanto is enabled regardless of HoF Card icons: Test w/: - Only clock + phone - clock, map, phone Need to test w/ Radio Pokegear: forgot a few things forgot to add check for radio when going left on clock screen added print local fishing group name. It's ugly. Soooo much space for tiles on the pokegear! Pokedex BETA pokegear fish str fix just forgot the @ vanilla merged fonts charmap for evopage Vanilla Dex changes Vanilla complete, short text version cleanup Pokedex Choose Theme Color fix https://github.com/pret/pokecrystal/wiki/Customizable-Pok%C3%A9dex-Color Type GFX Vanilla GFX SETup Battle enemy hud fix Remember to check hall of fame for NO. tile weirdness Minor Sync fixes with Type tiles GFX Dex Tweaks 1 & minor tweaks pokegear more readable, search mode and unown mode applies custom color Added Dex Info Page also removes the mewtwo color Nayru's Dex 2.0 Developed originally on Crystal Legacy 1.2, rebased here for vanilla crystal with rgbasm 6.1 Fixing page counter bug for Surfing Area Dex same fix as the walking/grass one, thanks Craig EV code Sorting out the EV/StatExp Handling for Stats page Dex Area Map UI updates wont affect pokegear and fly map pokegear part of dex area map UI UI Moved Type on Entry page, EVO arrows and added up/down arrows to EVO, Current mon arrow, moved caught ball up by 1 on EVO page too Pics page UI updates Main UI updates UI misc Part 1 UI Overhaul Part 1 UI Overhaul UI Overhaul part 2 Moved Caught Ball Icon next to Dex # top button banner comments misc edits celebi event ready no nayru sprite misc clean up --- constants/charmap.asm | 17 +- constants/event_flags.asm | 2 +- data/wild/bug_contest_mons.asm | 2 +- data/wild/fish.asm | 28 +- data/wild/non_wildmon_locations.asm | 64 +- data/wild/treemon_maps.asm | 2 +- data/wild/treemons.asm | 13 +- engine/events/treemons.asm | 26 +- engine/gfx/cgb_layouts.asm | 26 +- engine/gfx/color.asm | 42 +- engine/pokedex/new_pokedex_entry.asm | 4 + engine/pokedex/pokedex.asm | 177 +++--- engine/pokedex/pokedex_2.asm | 138 +++-- engine/pokedex/pokedex_area_page.asm | 74 +-- engine/pokedex/pokedex_area_page_fishing.asm | 585 +++++++++++++++++++ engine/pokedex/pokedex_evolution_page.asm | 46 +- engine/pokedex/pokedex_stats_page.asm | 217 ++----- engine/pokegear/pokegear.asm | 44 +- engine/pokemon/mon_stats.asm | 5 - gfx/pokegear/dex_johto.bin | Bin 0 -> 361 bytes gfx/pokegear/dex_kanto.bin | Bin 0 -> 361 bytes gfx/pokegear/town_map.png | Bin 441 -> 4694 bytes main.asm | 19 +- maps/CeladonGameCornerPrizeRoom.asm | 4 + maps/GoldenrodGameCorner.asm | 4 + maps/IlexForest.asm | 1 + 26 files changed, 1107 insertions(+), 433 deletions(-) create mode 100644 engine/pokedex/pokedex_area_page_fishing.asm create mode 100644 gfx/pokegear/dex_johto.bin create mode 100644 gfx/pokegear/dex_kanto.bin diff --git a/constants/charmap.asm b/constants/charmap.asm index ade2ddb26..5618bad16 100644 --- a/constants/charmap.asm +++ b/constants/charmap.asm @@ -62,16 +62,7 @@ ; needed for StatsScreen_PlaceShinyIcon and PrintPartyMonPage1 charmap "⁂", $3f ; gfx/stats/stats_tiles.png, tile 14 - charmap "", $64 ; gfx/stats/stats_tiles.png, tile 14, VRAM0 - charmap "", $eb; gfx/pokedex/inversed_rightarrow.1bpp - ; at the moment, this arrow is in the same slot as the non-inversed right arrow, but in VRAM 1. - ; since people could theoretically load it wherever they choose, I am keeping this charmap - - charmap ">", $bb - charmap "<", $bc - charmap "=", $bd - charmap "+", $be - charmap "<%>", $bf + charmap "", $64 ; gfx/stats/stats_tiles.png, tile 14 ; Actual characters (from gfx/font/font.png) @@ -135,6 +126,12 @@ charmap "x", $b7 charmap "y", $b8 charmap "z", $b9 + + charmap ">", $c0 + charmap "<", $c1 + charmap "=", $c2 + charmap "+", $c3 + charmap "<%>", $c4 charmap "┌", $ba charmap "─", $bb diff --git a/constants/event_flags.asm b/constants/event_flags.asm index 5b68fc1a4..0e9d3cca5 100644 --- a/constants/event_flags.asm +++ b/constants/event_flags.asm @@ -46,7 +46,7 @@ const EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER const EVENT_REFUSED_TO_HELP_LANCE_AT_LAKE_OF_RAGE const EVENT_GOT_BERRY_FROM_ROUTE_30_HOUSE - const_skip ; EVENT_MADE_WHITNEY_CRY + const EVENT_CELEBI_FATEFUL_ENCOUNTER ; EVENT_MADE_WHITNEY_CRY const EVENT_HERDED_FARFETCHD const EVENT_FOUGHT_SUDOWOODO const EVENT_CLEARED_SLOWPOKE_WELL diff --git a/data/wild/bug_contest_mons.asm b/data/wild/bug_contest_mons.asm index 797127038..d5f05ec2a 100644 --- a/data/wild/bug_contest_mons.asm +++ b/data/wild/bug_contest_mons.asm @@ -1,4 +1,4 @@ -ContestMons: +ContestMons:: ; %, species, min, max db 20, CATERPIE, 7, 18 db 20, WEEDLE, 7, 18 diff --git a/data/wild/fish.asm b/data/wild/fish.asm index 117cdbb42..597536ab1 100644 --- a/data/wild/fish.asm +++ b/data/wild/fish.asm @@ -250,31 +250,33 @@ FishGroups_Names:: assert_table_length NUM_FISHGROUPS ; (13, NONE is not included in the count) Group1_Name: - db "SHORE@" + db " SHORE@" Group2_Name: - db "OCEAN@" + db " OCEAN@" Group3_Name: - db "LAKE@" + db " LAKE@" Group4_Name: - db "POND@" + db " POND@" Group5_Name: - db "DRATINI@" + db " DRATINI@" Group6_Name: - db "QWILFISH S@" + db " SWARM 1@" Group7_Name: - db "REMORAID S@" + db " SWARM 2@" Group8_Name: - db "GYARADOS@" + db " GYARADOS@" Group9_Name: - db "DRATINI 2@" + db " ROUTE 45@" + ; db " DRATINI 2@" Group10_Name: - db "WHIRL@" + db " WHIRL@" Group11_Name: - db "QWILFISH@" + db " QWILFISH@" Group12_Name: - db "REMORAID@" + db " REMORAID@" Group13_Name: - db "QWILFISH 2@" + db " ROUTE 12@" + ; db " QWILFISH 2@" GetFishGroupName: ; given fishing group num in 'a' diff --git a/data/wild/non_wildmon_locations.asm b/data/wild/non_wildmon_locations.asm index ad0e82130..8e7e8afe3 100644 --- a/data/wild/non_wildmon_locations.asm +++ b/data/wild/non_wildmon_locations.asm @@ -54,11 +54,11 @@ EventWildMons:: specialencounter CELEBI, EVENT_CELEBI_FATEFUL_ENCOUNTER, ILEX_FOREST, CelebiEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant specialencounter LUGIA, EVENT_FOUGHT_LUGIA, WHIRL_ISLAND_LUGIA_CHAMBER, LugiaEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant specialencounter HO_OH, EVENT_FOUGHT_HO_OH, TIN_TOWER_ROOF, HoOhEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant - ; specialencounter ARTICUNO, EVENT_CAUGHT_ARTICUNO, ROUTE_20, ArticunoEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant - ; specialencounter ZAPDOS, EVENT_CAUGHT_ZAPDOS, ROUTE_10_NORTH, ZapdosEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant - ; specialencounter MOLTRES, EVENT_CAUGHT_MOLTRES, VICTORY_ROAD, MoltresEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant - ; specialencounter MEWTWO, EVENT_CERULEAN_CAVE_B1F_MEWTWO, SILVER_CAVE_ROOM_3, MewtwoEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant - ; specialencounter MEW, EVENT_ROUTE_24_MEW_CAUGHT, ROUTE_24, MewEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant + specialencounter ARTICUNO, EVENT_FOUGHT_ARTICUNO, ROUTE_20, ArticunoEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant + specialencounter ZAPDOS, EVENT_FOUGFT_ZAPDOS, ROUTE_10_NORTH, ZapdosEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant + specialencounter MOLTRES, EVENT_FOUGHT_MOLTRES, VICTORY_ROAD, MoltresEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant + specialencounter MEWTWO, EVENT_FOUGHT_MEWTWO, CERULEAN_CAVE_B1F, MewtwoEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant + specialencounter MEW, EVENT_FOUGHT_MEW, VERMILION_PORT, MewEvent_Str ; will not normally be seen by player w/o Dex Splash Page, may need new EVENT constant db -1 ; LoadWildMon Dex Hints, max 18 chars per line @@ -89,35 +89,35 @@ SuicuneEvent_Str: CelebiEvent_Str: db "GS BALL, deeply" next "buried in RUINS." - next "Offer to SHRINE.@" + next "LVL 5.@" LugiaEvent_Str: - db "SILVER WING, dull" - next "PEWTER sheen. Mis-" - next "placed as memento.@" + db "Slumbering deep in" + next "WHIRL ISLANDS." + next "LVL. 40.@" HoOhEvent_Str: - db "RAINBOW WING best-" - next "owed to Trainers" - next "after FOUR trials.@" -; ArticunoEvent_Str: -; db "Waiting surrounded" -; next "by waves." -; next "LVL 60.@" -; ZapdosEvent_Str: -; db "Waiting above" -; next "electric renewal." -; next "LVL 60.@" -; MoltresEvent_Str: -; db "Waiting in the" -; next "long dark of" -; next "VICTORY. LVL 60.@" -; MewtwoEvent_Str: -; db "Not CERULEAN, but" -; next "RED and SILVER" -; next "ice. LVL 75.@" -; MewEvent_Str: -; db "Meet at nugget" -; next "bridge, with 251." -; next "LVL 60.@" + db "Reigning on top of" + next "TIN TOWER." + next "LVL. 40.@" + ArticunoEvent_Str: + db "Waiting surrounded" + next "by waves." + next "LVL 50.@" + ZapdosEvent_Str: + db "Waiting above" + next "electric renewal." + next "LVL 50.@" + MoltresEvent_Str: + db "Waiting in the" + next "long dark of" + next "VICTORY. LVL 50.@" + MewtwoEvent_Str: + db "Has fled to" + next "CERULEAN CAVE." + next "LVL 70.@" + MewEvent_Str: + db "Hiding behind" + next "a truck." + next "LVL 5.@" GiftMons:: ; replace map_id with -1 to hide location but keep hint diff --git a/data/wild/treemon_maps.asm b/data/wild/treemon_maps.asm index 01df0f2b4..618934202 100644 --- a/data/wild/treemon_maps.asm +++ b/data/wild/treemon_maps.asm @@ -66,7 +66,7 @@ TreeMonMaps: treemon_map ILEX_FOREST, TREEMON_SET_FOREST db -1 -RockMonMaps: +RockMonMaps:: treemon_map CIANWOOD_CITY, TREEMON_SET_ROCK treemon_map ROUTE_40, TREEMON_SET_ROCK treemon_map DARK_CAVE_VIOLET_ENTRANCE, TREEMON_SET_ROCK diff --git a/data/wild/treemons.asm b/data/wild/treemons.asm index ca3623f92..59a4035cd 100644 --- a/data/wild/treemons.asm +++ b/data/wild/treemons.asm @@ -1,4 +1,4 @@ -TreeMons: +TreeMons:: ; entries correspond to TREEMON_SET_* constants table_width 2, TreeMons dw TreeMonSet_Unused @@ -8,10 +8,16 @@ TreeMons: dw TreeMonSet_Kanto dw TreeMonSet_Lake dw TreeMonSet_Forest - dw TreeMonSet_Rock dw TreeMonSet_City assert_table_length NUM_TREEMON_SETS +RockSmashMons:: + ; broke off from the above table, for nayru's pokedex + ; delineation was needed because there is no 'rare' table for rocksmash + table_width 2, RockSmashMons + dw TreeMonSet_Rock + assert_table_length NUM_ROCKSMASH_SETS + ; Two tables each (common, rare). ; Structure: ; db %, species, level @@ -141,6 +147,9 @@ TreeMonSet_Forest: db 5, ARIADOS, 18 db -1 +; Rock smash sets dont have common/rare tables +; can have as many entries as you want as long as the % adds up to 100 +; feel free to add new rock smash sets TreeMonSet_Rock: db 90, KRABBY, 20 db 10, SHUCKLE, 20 diff --git a/engine/events/treemons.asm b/engine/events/treemons.asm index 804f7d666..bd2aea6d5 100644 --- a/engine/events/treemons.asm +++ b/engine/events/treemons.asm @@ -35,7 +35,7 @@ RockMonEncounter: call GetTreeMonSet jr nc, .no_battle - call GetTreeMons + call GetRockMons jr nc, .no_battle ; 40% chance of an encounter @@ -164,6 +164,30 @@ GetTreeMon: call SelectTreeMon ret +GetRockMons: +; Return the address of TreeMon table a in hl. +; Return nc if table a doesn't exist. + + cp NUM_ROCKSMASH_SETS + jr nc, .quit + + ld e, a + ld d, 0 + ld hl, RockSmashMons + add hl, de + add hl, de + + ld a, [hli] + ld h, [hl] + ld l, a + + scf + ret + +.quit + xor a + ret + SelectTreeMon: ; Read a TreeMons table and pick one monster at random. diff --git a/engine/gfx/cgb_layouts.asm b/engine/gfx/cgb_layouts.asm index 7cfa95690..40b8766b6 100644 --- a/engine/gfx/cgb_layouts.asm +++ b/engine/gfx/cgb_layouts.asm @@ -294,6 +294,7 @@ _CGB_Pokedex: inc hl .not_shiny call LoadPalette_White_Col1_Col2_Black ; mon palette + ; black background for Pal 7 ld de, wBGPals1 palette 7 ; First color slot of Pal 7 call LoadSingleBlackPal ; loads black into slot 1 of pal 7, since it is normally white @@ -385,7 +386,11 @@ ENDC ld a, BANK(wOBPals1) call FarCopyWRAM -; page nums +; category enclosure + page nums + A > + hlcoord 18, 5, wAttrmap + ld bc, 2 + ld a, 0 | VRAM_BANK_1 ; dex pal PREDEFPAL_POKEDEX + call ByteFill hlcoord 18, 7, wAttrmap ld bc, 2 ld a, 0 | VRAM_BANK_1 ; dex pal PREDEFPAL_POKEDEX @@ -409,10 +414,8 @@ _CGB_Pokedex_EvoPage: ld de, wBGPals1 palette 6 ld a, PREDEFPAL_POKEDEX call GetPredefPal - call LoadHLPaletteIntoDE ; dex interface palette - - ; ld de, wBGPals1 palette 6 - ; call LoadSingleBlackPal + call LoadHLPaletteIntoDE ; dex interface palette + ; main screen within border, vram 1 hlcoord 1, 1, wAttrmap lb bc, 16, 19 @@ -499,18 +502,15 @@ _CGB_Pokedex_PicsPage: ; animated front pic hlcoord 1, 1, wAttrmap lb bc, 7, 7 - ld a, 1 - set 3, a + ld a, 1 | VRAM_BANK_1 ; VRAM 1 call FillBoxCGB -; ; back pic +; back pic hlcoord 11, 2, wAttrmap lb bc, 6, 6 - ld a, 1 - set 3, a + ld a, 1 | VRAM_BANK_1 ; VRAM 1 call FillBoxCGB - ; sprite box border hlcoord 1, 13, wAttrmap lb bc, 4, 4 @@ -674,9 +674,8 @@ INCLUDE "gfx/pc/orange.pal" _CGB_PokedexUnownMode: ld de, wBGPals1 - ; ld a, PREDEFPAL_POKEDEX call CheckPokedexColor - call GetPredefPal + call GetPredefPal call LoadHLPaletteIntoDE ld a, [wCurPartySpecies] call GetMonPalettePointer @@ -1081,7 +1080,6 @@ _CGB_BetaPikachuMinigame: _CGB_PokedexSearchOption: ld de, wBGPals1 - ; ld a, PREDEFPAL_POKEDEX call CheckPokedexColor call GetPredefPal call LoadHLPaletteIntoDE diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index 5338f1fbc..a420ce32f 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -1387,19 +1387,57 @@ endr call FarCopyWRAM ret - LoadSingleBlackPal: ; Destination address of the Palette and Slot is passed in 'de' ldh a, [rSVBK] push af ld a, BANK(wBGPals1) ldh [rSVBK], a - xor a ; the color black is $0000 + xor a ld [de], a inc de ld [de], a inc de + pop af + ldh [rSVBK], a + ld hl, TypeIconPals + ld a, b + add a + push bc + ld c, a + ld b, 0 + add hl, bc + ld bc, 2 + push de + call FarCopyColorWRAM + pop de + + ld hl, TypeIconPals + pop bc + ld a, c + add a + ld c, a + ld b, 0 + add hl, bc + inc de + inc de + ld bc, 2 + push de + call FarCopyColorWRAM + pop de + inc de + inc de + + ldh a, [rSVBK] + push af + ld a, BANK(wBGPals1) + ldh [rSVBK], a + xor a + ld [de], a + inc de + ld [de], a + inc de pop af ldh [rSVBK], a ret diff --git a/engine/pokedex/new_pokedex_entry.asm b/engine/pokedex/new_pokedex_entry.asm index dc2a4a493..d2c7a83b3 100644 --- a/engine/pokedex/new_pokedex_entry.asm +++ b/engine/pokedex/new_pokedex_entry.asm @@ -2,6 +2,9 @@ NewPokedexEntry: ldh a, [hMapAnims] push af xor a + ld [wPokedexShinyToggle], a + ld [wPokedexEntryPageNum], a + ldh [hMapAnims], a call LowVolume call ClearBGPalettes @@ -14,6 +17,7 @@ NewPokedexEntry: add POKEDEX_SCX ldh [hSCX], a xor a + ldh [hSCY], a ld [wPokedexStatus], a farcall _NewPokedexEntry call WaitPressAorB_BlinkCursor diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index d993cd312..24d7f841f 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -366,16 +366,16 @@ Pokedex_UpdateDexEntryScreen: ld a, [hl] and B_BUTTON jr nz, .return_to_prev_screen - vc_hook Forbid_printing_Pokedex + vc_hook print_forbid_5 ld a, [hl] and A_BUTTON jr nz, .do_menu_action - ld a, [hl] - and SELECT ; - call nz, Pokedex_toggle_shininess_Entry ld a, [hl] ; and START ; jp nz, Area_Page_map ; .toCry ; + ld a, [hl] + and SELECT ; + call nz, Pokedex_toggle_shininess_Entry call Pokedex_NextOrPreviousDexEntry ret nc call Pokedex_IncrementDexPointer @@ -418,7 +418,18 @@ Pokedex_toggle_shininess_Entry: call Pokedex_toggle_shininess1 ; refresh palettes ld a, SCGB_POKEDEX - call Pokedex_GetSGBLayout + call Pokedex_GetSGBLayout + + ; add or remove shiny icon + hlcoord 8, 1 + ld a, [hl] + cp "" + jr z, .shinyicon_set + ld [hl], "" + jr .done +.shinyicon_set + ld [hl], " " +.done call Pokedex_toggle_shininess2 ret @@ -426,7 +437,18 @@ Pokedex_toggle_shininess_Pics: call Pokedex_toggle_shininess1 ; refresh palettes ld a, SCGB_POKEDEX_PICS - call Pokedex_GetSGBLayout + call Pokedex_GetSGBLayout + + ; add or remove shiny icon + hlcoord 3, 11 ; 1, 9 ; 9, 7 ; 0, 9 + ld a, [hl] + cp "" + jr z, .shinyicon_set + ld [hl], "" + jr .done +.shinyicon_set + ld [hl], " " +.done call Pokedex_toggle_shininess2 ret @@ -457,13 +479,11 @@ Pokedex_toggle_shininess2: Pokedex_ReinitDexEntryScreen: ; Reinitialize the Pokédex entry screen after changing the selected mon. call Pokedex_BlackOutBG - ; xor a - ; ldh [hBGMapMode], a call Pokedex_DrawDexEntryScreenBG call Pokedex_LoadCurrentFootprint call Pokedex_GetSelectedMon ld [wPrevDexEntry], a -.skip + ld a, [wPokedexEntryType] cp DEXENTRY_PICS jr c, .not_area @@ -541,9 +561,18 @@ Pokedex_ReinitDexEntryScreen: ld [wPokedexEntryPageNum], a ld [wPokedexStatus], a ; moves machines index farcall DisplayDexMonMoves -.cont +.cont call Pokedex_DrawFootprint call Pokedex_LoadSelectedMonTiles + hlcoord 8, 1 + ld a, [wPokedexShinyToggle] + bit 0, a + jr z, .not_shiny + ld [hl], "" + jr .shiny_done +.not_shiny + ld [hl], " " +.shiny_done call WaitBGMap call Pokedex_GetSelectedMon ld [wCurPartySpecies], a @@ -713,9 +742,6 @@ Evos_Page: .skip call LoadTilemapToTempTilemap call Pokedex_BlackOutBG - ; hlcoord 0, 0 - ; lb bc, SCREEN_HEIGHT, SCREEN_WIDTH - ; call ClearBox xor a ldh [hBGMapMode], a ld [wCurDamage], a @@ -727,28 +753,12 @@ Evos_Page: xor a ldh [hBGMapMode], a farcall HDMATransferTilemapToWRAMBank3 - ; xor a - ; ldh [hSCX], a - ; call DelayFrame - ; ld a, $7 - ; ldh [hWX], a - ; ld a, $90 - ; ldh [hWY], a ld a, $1 ldh [rVBK], a ld de, Pokedex_ExtraTiles ; tile 19 - ld hl, vTiles2 tile $62 ; $76 - lb bc, BANK(Pokedex_ExtraTiles), 30 ; 10 - call Request2bpp -; replace icon borders for evo page - ld de, Pokedex_ExtraTiles tile 32 - ld hl, vTiles2 tile $77 - lb bc, BANK(Pokedex_ExtraTiles), 4 - call Request2bpp - ld de, Pokedex_ExtraTiles tile 36 - ld hl, vTiles2 tile $7d - lb bc, BANK(Pokedex_ExtraTiles), 2 + ld hl, vTiles2 tile $62 + lb bc, BANK(Pokedex_ExtraTiles), 31 ; 30 ; 10 call Request2bpp call Pokedex_LoadInversedFont @@ -843,8 +853,19 @@ Evos_Page: call z, Evos_Page cp -2 jp z, Pokedex_ReinitDexEntryScreen + + hlcoord 8, 1 + ld a, [wPokedexShinyToggle] + bit 0, a + jr z, .not_shiny + ld [hl], "" + jr .shiny_done +.not_shiny + ld [hl], " " +.shiny_done call WaitBGMap ret + .right_dpad ld a, [wCurDamage + 1] cp -1 @@ -1099,6 +1120,9 @@ Pokedex_UpdateOptionScreen: dw .MenuAction_OldMode dw .MenuAction_UnownMode +.MenuAction_NayDexInfoPage + ret + .MenuAction_NewMode: ld b, DEXMODE_NEW jr .ChangeMode @@ -1670,12 +1694,9 @@ String_SELECT_OPTION: db $3b, $48, $49, $4a, $44, $45, $46, $47 ; SELECT > OPTION ; fallthrough String_START_SEARCH: - db $3c, $3b, $41, $42, $43, $4b, $4c, $4d, $4e, $3c, -1 ; START > SEARCH + db $3c, $3b, $41, $42, $43, $4b, $4c, $4d, $3c, $32, -1 ; START > SEARCH Pokedex_DrawDexEntryScreenBG: - ; xor a - ; ldh [hBGMapMode], a - ; call Pokedex_FillBackgroundColor2 hlcoord 0, 0 lb bc, 15, 18 call Pokedex_PlaceBorder @@ -1708,21 +1729,16 @@ Pokedex_DrawDexEntryScreenBG: ld [hl], $58 ; new curved text border, right ; clear the row for bottom menu hlcoord 1, 17 - ld bc, 18 + ld bc, SCREEN_WIDTH - 2 ld a, " " call ByteFill - - hlcoord 2, 17 - ld bc, $7 tiles - ld a, $7f ; black square - call ByteFill ld c, 4 call DelayFrames - - lb bc, 8, SCREEN_WIDTH - 1 - hlcoord 1, 8 +; erase the bottom half of screen where info will go + lb bc, 8, SCREEN_WIDTH - 1 ; 8 tiles high, 19 tiles wide + hlcoord 1, 8 call ClearBox - +; horizonal skinny line ending in the page num tab hlcoord 1, 8 ld bc, 19 ld a, $55 @@ -1735,14 +1751,12 @@ Pokedex_DrawDexEntryScreenBG: ; place species name ld a, [wTempSpecies] ld [wCurSpecies], a - farcall DisplayDexMonType + farcall DisplayDexMonType_CustomGFX call GetPokemonName - hlcoord 9, 4 - call PlaceString ; mon species - -.print_dex_num -; Print dex number - hlcoord 9, 2 + hlcoord 9, 3 + call PlaceString ; mon species +; .print_dex_num ; Print dex number + hlcoord 10, 1 ld a, $5c ; No ld [hli], a ld a, $e8 ; . @@ -1750,17 +1764,23 @@ Pokedex_DrawDexEntryScreenBG: ld de, wTempSpecies lb bc, PRINTNUM_LEADINGZEROS | 1, 3 call PrintNum - +; up/down arrow indicators + hlcoord 19, 0 + ld [hl], $3f + hlcoord 19, 16 + ld [hl], $40 +; place bottom row menu hlcoord 0, 17 ld de, .MenuItems - call Pokedex_PlaceString + call Pokedex_PlaceString call Pokedex_PlaceFrontpicTopLeftCorner ; Check to see if we caught it. Get out of here if we haven't. ld a, [wTempSpecies] dec a call CheckCaughtMon ret z - hlcoord 14, 2 +; place Caught ball icon + hlcoord 16, 1 ld [hl], $4f ; pokeball icon ret .MenuItems: @@ -1877,10 +1897,10 @@ Pokedex_DrawColorScreenBG: call Pokedex_PlaceString hlcoord 3, 11 ld de, .Gray - call Pokedex_PlaceString - hlcoord 3, 12 - ld de, .Mewtwo jp Pokedex_PlaceString + ; hlcoord 3, 12 + ; ld de, .Mewtwo + ; jp Pokedex_PlaceString .Title: db $3b, " COLORS ", $3c, -1 @@ -1912,8 +1932,8 @@ Pokedex_DrawColorScreenBG: .Gray db "GRAY ", $4f, -1 - .Mewtwo - db "MEWTWO ", $4f, -1 +;.Mewtwo +; db "MEWTWO ", $4f, -1 Pokedex_UpdateColorOption: ld de, .ArrowCursorData @@ -1938,7 +1958,7 @@ Pokedex_DrawColorScreenBG: dwcoord 2, 9 ; Yellow dwcoord 2, 10 ; Cyan dwcoord 2, 11 ; Gray - dwcoord 2, 12 ; Mewtwo + ; dwcoord 2, 12 ; Mewtwo .do_menu_action ld a, [wDexArrowCursorPosIndex] @@ -1963,7 +1983,7 @@ Pokedex_DrawColorScreenBG: dw .MenuAction_Yellow dw .MenuAction_Cyan dw .MenuAction_Gray - dw .MenuAction_Mewtwo + ; dw .MenuAction_Mewtwo .MenuAction_Red ld b, DEXCOLOR_RED @@ -2001,8 +2021,8 @@ Pokedex_DrawColorScreenBG: ld b, DEXCOLOR_GRAY jr .ChangeColor - .MenuAction_Mewtwo - ld b, DEXCOLOR_MEWTWO + ; .MenuAction_Mewtwo +; ld b, DEXCOLOR_MEWTWO .ChangeColor: ld a, [wCurPokedexColor] @@ -2414,10 +2434,10 @@ Pokedex_CheckSeen: ld a, [wTempSpecies] dec a call CheckSeenMon -; IF DEF(_DEBUG) -; ld a, 1 ; DEBUG, to unlock all unseen mon -; and a ; DEBUG, to unlock all unseen mon -; ENDC +IF DEF(_DEBUG) + ld a, 1 ; DEBUG, to unlock all unseen mon + and a ; DEBUG, to unlock all unseen mon +ENDC pop hl pop de ret @@ -2531,7 +2551,7 @@ Pokedex_DisplayModeDescription: ld e, l ld d, h hlcoord 1, 14 - call PlaceString + call Pokedex_PlaceString ld a, $1 ldh [hBGMapMode], a ret @@ -2719,7 +2739,8 @@ Pokedex_SearchForMons: jr z, .next_mon ld [wTempSpecies], a ld [wCurSpecies], a - call Pokedex_CheckCaught + ; call Pokedex_CheckCaught + call Pokedex_CheckSeen jr z, .next_mon push hl push de @@ -3138,8 +3159,6 @@ Pokedex_BlackOutBG: Pokedex_ApplyPrintPals: ld a, $ff call DmgToCgbBGPals - ;ld a, $ff - ; call DmgToCgbObjPal0 call DelayFrame ret @@ -3151,8 +3170,6 @@ Pokedex_ApplyUsualPals: ; This applies the palettes used for most Pokédex screens. ld a, $e4 call DmgToCgbBGPals - ;ld a, $e0 - ;call DmgToCgbObjPal0 ret Pokedex_LoadPointer: @@ -3207,7 +3224,7 @@ Pokedex_LoadAnyFootprint: ld a, [wTempSpecies] dec a and %111 - swap a ; * $10 + swap a add a, a ld l, a ld h, 0 @@ -3217,7 +3234,7 @@ Pokedex_LoadAnyFootprint: ld e, l ld d, h - ld hl, vTiles2 tile $6d ; $62 + ld hl, vTiles2 tile $6d ; $62 is vanilla location for footprints lb bc, BANK(Footprints), 4 call Request1bpp ret @@ -3311,7 +3328,7 @@ Pokedex_LoadPageNums: ldh [rVBK], a ld de, Pokedex_PageNumTiles tile 0 ld hl, vTiles2 tile $60 - lb bc, BANK(Pokedex_PageNumTiles), 16 + lb bc, BANK(Pokedex_PageNumTiles), 14 call Request2bpp ; plain line ld de, Pokedex_PageNumTiles tile 13 @@ -3394,12 +3411,6 @@ Pokedex_InvertTiles: call Get1bpp ret -; PokedexLZ: -; INCBIN "gfx/pokedex/pokedex.2bpp.lz" - -; PokedexSlowpokeLZ: -; INCBIN "gfx/pokedex/slowpoke.2bpp.lz" - Pokedex_CheckSGB: ldh a, [hCGB] or a diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm index 0c8e8c34f..863ea7e10 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/pokedex_2.asm @@ -10,15 +10,22 @@ const DEXENTRY_EVO ; 7 const DEXENTRY_PICS ; 8 const DEXENTRY_AREA_NONE ; 9 - const DEXENTRY_AREA_GRASS_JOHTO ; 10 - const DEXENTRY_AREA_GRASS_KANTO ; 11 - const DEXENTRY_AREA_GRASS_SWARM ; 12 - const DEXENTRY_AREA_SURF_JOHTO ; 13 - const DEXENTRY_AREA_SURF_KANTO ; 14 - const DEXENTRY_AREA_SURF_SWARM ; 15 - const DEXENTRY_AREA_RODS ; 16 - const DEXENTRY_AREA_TREES ; 17 - const DEXENTRY_AREA_CONTEST ; 18 + const DEXENTRY_AREA_GRASS_JOHTO ; 10 / A + const DEXENTRY_AREA_GRASS_KANTO ; 11 / B + const DEXENTRY_AREA_GRASS_SWARM ; 12 / C + const DEXENTRY_AREA_SURF_JOHTO ; 13 / D + const DEXENTRY_AREA_SURF_KANTO ; 14 / E + const DEXENTRY_AREA_SURF_SWARM ; 15 / F + const DEXENTRY_AREA_RODS ; 16 / 0x10 + const DEXENTRY_AREA_TREES_COMMON ; 17 / 0x11 + const DEXENTRY_AREA_TREES_RARE ; 18 / 0x12 + const DEXENTRY_AREA_ROCKSMASH ; 19 / 0x13 + const DEXENTRY_AREA_CONTEST ; 20 / 0x14 + const DEXENTRY_AREA_ROAMING ; 21 / 0x15 + const DEXENTRY_AREA_CASINO ; 22 / 0x16 + const DEXENTRY_AREA_NPCTRADES ; 23 / 0x17 + const DEXENTRY_AREA_EVENTWILDMONS ; 24 / 0x18 + const DEXENTRY_AREA_GIFTMONS ; 25 / 0x19 EXPORT DEXENTRY_LORE EXPORT DEXENTRY_BASESTATS @@ -40,8 +47,16 @@ EXPORT DEXENTRY_AREA_SURF_KANTO EXPORT DEXENTRY_AREA_SURF_SWARM EXPORT DEXENTRY_AREA_RODS -EXPORT DEXENTRY_AREA_TREES +EXPORT DEXENTRY_AREA_TREES_COMMON +EXPORT DEXENTRY_AREA_TREES_RARE +EXPORT DEXENTRY_AREA_ROCKSMASH EXPORT DEXENTRY_AREA_CONTEST +EXPORT DEXENTRY_AREA_ROAMING +EXPORT DEXENTRY_AREA_CASINO +EXPORT DEXENTRY_AREA_NPCTRADES +EXPORT DEXENTRY_AREA_EVENTWILDMONS +EXPORT DEXENTRY_AREA_GIFTMONS + EXPORT DEXENTRY_AREA_NONE DEF NUM_FIELD_MOVES EQU 14 @@ -137,10 +152,38 @@ HandlePageNumReset: ret DisplayDexEntry: - call Dex_PrintMonTypeTiles - call GetPokemonName - hlcoord 9, 3 - call PlaceString ; mon species + ld a, [wPokedexEntryType] + and a + jr nz, .next + ld a, DEXENTRY_LORE + call HandlePageNumReset + hlcoord 8, 1 + ld a, [wPokedexShinyToggle] + bit 0, a + jr z, .not_shiny + ld [hl], "" + jr .next +.not_shiny + ld [hl], " " +.next + ld a, DEXENTRY_LORE + call HandlePageNumReset +; erase bottom half of page + hlcoord 1, 8 + lb bc, 8, SCREEN_WIDTH - 1 + call ClearBox +; take away page num and A press since we're assuming we haven't seen the mon +; will re-print if we have, later + hlcoord 17, 5 + ld bc, 3 ; box 2 tiles high, 9 wide + ld a, $4e ; category box horizontal line + call ByteFill +; skinny horizontal line halfway down page + hlcoord 1, 8 + ld bc, SCREEN_WIDTH - 1 + ld a, $55 + call ByteFill + ld a, [wTempSpecies] ld b, a call GetDexEntryPointer @@ -158,6 +201,13 @@ DisplayDexEntry: push af hlcoord 9, 6 call PlaceFarString ; dex species nickname + push bc ; bank? + push de ; dex entry ptr + hlcoord 9, 7 + ld de, String_pokemon + call PlaceString + pop de ; dex entry ptr + pop bc ; bank? ld h, b ld l, c push de ; dex entry ptr @@ -185,27 +235,25 @@ DisplayDexEntry: pop de inc de pop af - hlcoord 2, 11 + hlcoord 2, 10 push af call PlaceFarString pop bc call DexEntry_IncPageNum - ; call WaitBGMap ret - ; Page 2 .page2 pop de inc de pop af - hlcoord 2, 11 + hlcoord 2, 10 push af call PlaceFarString pop bc push bc push de lb bc, 5, SCREEN_WIDTH - 1 - hlcoord 1, 11 + hlcoord 1, 10 call ClearBox hlcoord 1, 8 ld bc, 19 @@ -215,12 +263,13 @@ DisplayDexEntry: pop de inc de pop af - hlcoord 2, 11 + hlcoord 2, 10 call PlaceFarString xor a ld [wPokedexEntryPageNum], a - ; call WaitBGMap ret +String_pokemon: + db " #MON @" GetDexEntryPointer: ; return dex entry pointer b:de @@ -276,19 +325,9 @@ endr pop hl ret -DisplayDexMonType: +DisplayDexMonType_CustomGFX: call GetBaseData - hlcoord 9, 6 ld a, [wBaseType1] -; Skip Bird - cp BIRD - jr c, .type1_adjust_done - cp UNUSED_TYPES - dec a - jr c, .type1_adjust_done - sub UNUSED_TYPES -.type1_adjust_done - call DEX_PrintType_Short IF SWAP_DARK_GHOST_TYPES == TRUE call Pokedex_swap_GhostDark_Indexes @@ -333,18 +372,6 @@ ENDC ld a, [wBaseType2] cp b ret z -; Skip Bird - cp BIRD - jr c, .type2_adjust_done - cp UNUSED_TYPES - dec a - jr c, .type2_adjust_done - sub UNUSED_TYPES -.type2_adjust_done - hlcoord 15, 6 - call DEX_PrintType_Short - hlcoord 13, 6 - ld [hl], "/" IF SWAP_DARK_GHOST_TYPES == TRUE call Pokedex_swap_GhostDark_Indexes @@ -356,21 +383,24 @@ ENDC IF USE_GEN3_STYLE_TYPE_GFX == TRUE ; load type 2 tiles - ld hl, TypeDarkIconGFX ; gfx\stats\types_dark.png - ld bc, 4 * LEN_2BPP_TILE ; Type GFX are 3 Tiles wide - call AddNTimes ; increments the TypeDarkIconGFX pointer to the right address of the needed Type Tiles + ld hl, TypeDarkIconGFX + ld bc, 4 * LEN_2BPP_TILE + call AddNTimes ld d, h ld e, l - ld hl, vTiles2 tile $74 ; destination address of the Tile, in this case Tiles $74-$77 - lb bc, BANK(TypeDarkIconGFX), 4 ; Bank in 'b', Number of Tiles being loaded in 'c' - call Request2bpp - hlcoord 9, 1 - ld [hl], $70 + ld a, $1 + ldh [rVBK], a + + ld hl, vTiles2 tile $7b + lb bc, BANK(TypeDarkIconGFX), 4 + call Request2bpp + hlcoord 13, 4 + ld [hl], $7b inc hl - ld [hl], $71 + ld [hl], $7c inc hl - ld [hl], $72 + ld [hl], $7d inc hl ld [hl], $7e ld a, $0 diff --git a/engine/pokedex/pokedex_area_page.asm b/engine/pokedex/pokedex_area_page.asm index 5c4d40b1f..816e5863b 100644 --- a/engine/pokedex/pokedex_area_page.asm +++ b/engine/pokedex/pokedex_area_page.asm @@ -28,11 +28,11 @@ DEF MAX_LINES_PRINTED_PER_PAGE EQU MAX_ENTRIES_PER_PAGE * 2 ; 6 ; ; but Crystal only has 2. please change this if you want to use the 3rd String_johto_text: - db " JOHTO: @" + db "JOHTO: @" String_kanto_text: - db " KANTO: @" + db "KANTO: @" String_swarm_text: - db " SWARM: @" + db "SWARM: @" Pokedex_DetailedArea: xor a @@ -60,45 +60,45 @@ Pokedex_DetailedArea: jp z, .grass ; _kanto ld hl, SwarmGrassWildMons cp DEXENTRY_AREA_GRASS_SWARM - jr z, .grass ; _swarm + jp z, .grass ; _swarm ld hl,JohtoWaterWildMons cp DEXENTRY_AREA_SURF_JOHTO - jr z, .surf + jp z, .surf ld hl, KantoWaterWildMons cp DEXENTRY_AREA_SURF_KANTO - jr z, .surf + jp z, .surf ld hl, SwarmWaterWildMons cp DEXENTRY_AREA_SURF_SWARM - jr z, .surf + jp z, .surf cp DEXENTRY_AREA_RODS - jr z, .rods + jp z, .rods cp DEXENTRY_AREA_TREES_COMMON - jr z, .trees + jp z, .trees cp DEXENTRY_AREA_TREES_RARE - jr z, .trees + jp z, .trees cp DEXENTRY_AREA_ROCKSMASH - jr z, .rocksmash + jp z, .rocksmash cp DEXENTRY_AREA_CONTEST - jr z, .bugcontest + jp z, .bugcontest cp DEXENTRY_AREA_ROAMING - jr z, .roaming + jp z, .roaming cp DEXENTRY_AREA_CASINO - jr z, .casino + jp z, .casino cp DEXENTRY_AREA_NPCTRADES - jr z, .npctrades + jp z, .npctrades cp DEXENTRY_AREA_EVENTWILDMONS - jr z, .eventwildmons + jp z, .eventwildmons cp DEXENTRY_AREA_GIFTMONS - jr z, .giftmons + jp z, .giftmons ; loop back around as if we are arriving for the first time, creating a closed-loop rotation .first @@ -118,12 +118,20 @@ Pokedex_DetailedArea: ; erase category banner, page number and A > indicator hlcoord 9, 6 - lb bc, 2, 11 ; erase a box 2 tiles high, 9 wide + lb bc, 2, 11 ; erase a box 2 tiles high, 9 wide, ; to 18, 7 call ClearBox - hlcoord 17, 5 - ld bc, 3 +; overwrite the A button with plain line + hlcoord 18, 5 + ld bc, 2 ld a, $4e ; category box border call ByteFill +; ; corners, lateral sides +; hlcoord 19, 5 +; ld [hl], $6f +; hlcoord 19, 6 +; ld [hl], $6e +; hlcoord 19, 7 +; ld [hl], $6e ret .found ld [wPokedexEntryType], a @@ -537,7 +545,7 @@ Pokedex_DetailedArea_grass: ret .grass_walk_text: ; db "GRASS @" - db " WALKING @" + db " WALKING @" ; db "GRASS/WALKING@" Pokedex_Parse_grass: @@ -784,7 +792,7 @@ Pokedex_DetailedArea_surf: xor a ; to ensure a isnt actually returned at -1. 0 is for normal ret .surfing_text: - db " SURFING @" + db " SURFING @" Pokedex_Parse_surf: push hl ; first species byte, surfing has no time of day @@ -1154,9 +1162,9 @@ Pokedex_DetailedArea_bugcontest: call DexEntry_NextCategory ret .bugcontest_text: - db " BUG @" ; CATCH CONTEST@" + db "BUG @" ; CATCH CONTEST@" .contest_text: - db " CONTEST @" + db " CONTEST @" .park_text: db " NATIONAL PARK@" .String_Tuesday: @@ -1270,7 +1278,7 @@ Pokedex_DetailedArea_roaming: call DexEntry_NextCategory ret .roaming_text: - db " ROAMING @" + db "ROAMING @" Dex_Print_Roamer_Info: ; push bc ; line counter in c @@ -1472,9 +1480,9 @@ Pokedex_DetailedArea_casino: call DexEntry_NextCategory ret .casino_text: - db " CASINO @" + db "CASINO @" .prize_text: - db " PRIZE @" + db " PRIZE @" Print_casinomon: ; 'de' has casino map_id ptr @@ -1518,7 +1526,7 @@ Print_casinomon: hlcoord 2, 13 jr .print_map_id .first_print_coins - hlcoord 2, 10 + hlcoord 2, 11 .print_coins lb bc, 2, 5 ; 2 byte number, up to 5 digits push hl ; print location @@ -1653,9 +1661,9 @@ Pokedex_DetailedArea_npctrades: jr .return .npctrade_text: - db " NPC @" + db "NPC @" .trade_text: - db " TRADE @" + db " TRADE @" Dex_Print_TradeMon_Info: ; 'de': location: hlcoord 2, 10 @@ -1927,9 +1935,9 @@ Pokedex_DetailedArea_eventwildmons: jp Pokedex_DetailedArea_eventmons .eventwildmon_text: - db " SPECIAL @" + db "SPECIAL @" .eventwildmon_text2: - db " ENCOUNTER @" + db "ENCOUNTER@" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EVENT WILD MONS END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1953,7 +1961,7 @@ Pokedex_DetailedArea_giftmons: jp Pokedex_DetailedArea_eventmons .giftmon_text: - db " GIFT @" + db "GIFT @" ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GIFT MONS END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/engine/pokedex/pokedex_area_page_fishing.asm b/engine/pokedex/pokedex_area_page_fishing.asm new file mode 100644 index 000000000..190ce0d91 --- /dev/null +++ b/engine/pokedex/pokedex_area_page_fishing.asm @@ -0,0 +1,585 @@ +;;;;;;;;;;;;;;;;;;;;;;; FISHING RODS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +Pokedex_DetailedArea_rods: + ld a, [wPokedexStatus]; wildmon entry index, 0 we havent started yet, 1 is old-shore, 2 is good-shore, 3 is super-shore, 4 is old-ocean, etc + and a + ; if not zero, we know that there are Fishing entries + jr nz, .auto_cont + + ld hl, FishGroups ; we want to start at the beginning + call Dex_Check_Fishing ; from prev category, we automatically roll into this category, we need to check if there's even anything there for us, so we use same func as first pass/check + and a ; if a is 0, means species was found somewhere + jp nz, Pokedex_Skip_Empty_Area_Category + +.auto_cont + xor a + ld [wPokedexEvoStage2], a + ld [wPokedexEvoStage3], a + + ; print the title, FISHING RODS + ld de, .fishing_text + ld hl, .rods_text + call Print_Category_text + ; calculate where we left off + + call Fishing_MonIndex_Addr ; clobbers bc, return addr in hl + ld bc, 0 ; printed line count + push bc ; printed line count + ; push hl ; points to fishgroup, specific rod ptr +.landmark_loop + call Check_this_rod ; maybe make new version to accumulate encounter % properly + pop bc ; line counter + ld a, [wPokedexEvoStage2] ; day and morn + and a + jr nz, .print + ld a, [wPokedexEvoStage3] ; nite + and a + jp z, .prep_loop +.print + ; when we arrive here, we are printing our first rod for this Fishing Group, could be any + ; print the first rod, then check if we're super, if not, inc Index and check + ; again, check if we're super, if we ARE, check and inc + push bc ; line counter, rod in b, maps in c + pop bc ; ; line counter, rod in b, maps in c + ; push hl ; points to fishgroup, specific rod ptr + ld a, [wPokedexStatus] ; fish group starting at bit 3 + ; ld b,b +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + call Fishing_Print_Rod + push bc ; line counter, rod in b, maps in c, b has been inc'd + ; zero the cumulative bytes + xor a + ld [wPokedexEvoStage2], a + ld [wPokedexEvoStage3], a +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ; ld b,b + ld a, [wPokedexStatus] ; fish group starting at bit 3 + and 3 ; rod type mask, first 2 bits + cp 2 ; did we just print a super rod? + jr z, .print_rods_done ; we do not inc the index, prep loop will, and calcs new hl + cp 1 ; did we just print a good rod? + jr z, .good2super ; we just printed an good rod, inc index and check, print if not 0 + ; now we can assume we are an old rod + call Fishing_Inc_Index ; we are now indexed on the good rod + call Fishing_MonIndex_Addr + call Check_this_rod + and a + jr z, .good2super ; since we're on the good rod, we still need to check the super rod entry + ld a, [wPokedexStatus] ; fish group starting at bit 3 + pop bc ; line counter, rod in b, maps in c + call Fishing_Print_Rod + push bc ; line counter, rod in b, maps in c, now has been inc'd + ; zero the cumulative bytes + xor a + ld [wPokedexEvoStage2], a + ld [wPokedexEvoStage3], a +.good2super + call Fishing_Inc_Index ; we are now indexed on the super rod + call Fishing_MonIndex_Addr + call Check_this_rod + and a + jr z, .print_rods_done + ld a, [wPokedexStatus] ; fish group starting at bit 3 + pop bc ; line counter, rod in b, maps in c + call Fishing_Print_Rod + push bc ; line counter, rod in b, maps in c, now has been inc'd + ; zero the cumulative bytes + xor a + ld [wPokedexEvoStage2], a + ld [wPokedexEvoStage3], a + ; do we fall through to prep loop or skip directly to max print? + ; should probably fall through, so double check we dont double inc +.print_rods_done + ; since we will be exiting since we printed a rod and finished checking the group + pop bc ; line counter, rod in b, maps in c +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; map name ;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ld hl, FishGroups_Names + push bc ; line counter, rod in b, maps in c + ld a, [wPokedexStatus] + sra a + sra a + ld d, 0 + ld e, a + add hl, de + add hl, de + ld a, BANK(FishGroups_Names) + call GetFarWord ;; + ld d, h + ld e, l + ld a, BANK(FishGroups_Names) + hlcoord 8 , 9 ; we want allllll the chars we can have + pop bc ; line counter, rod in b, maps in c + push bc + call PlaceFarString + pop bc + inc c ; since we printed a map name + push bc + push de + push hl + hlcoord 2, 9 + ld de, .group_text + call PlaceString + pop hl + pop de + + ld c, 4 + call DelayFrames + + pop bc ; line counter +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +.prep_loop + ; ; increment wildmon index, if end is 2, zero, inc fish group + push bc + call Fishing_Inc_Index + pop bc + ;;;;;;;;;; check if we've finished all FishingGroups + ld a, [wPokedexStatus] ; fishgroup in bit 3 + sra a + sra a + cp NUM_FISHGROUPS ; + 1 + jr z, .reached_end + ;;;;;;;;;;;;;;;;;;;;; + + ld a, b ; number of rods printed, anything over 0 means we want a new page + and a + jr nz, .max_print + + push bc ; print counter + jp .landmark_loop +.reached_end + xor a + ld [wPokedexStatus], a ; wildmon entry index + ld [wPokedexEntryPageNum], a ; page num + ld a, [wPokedexEntryType] ; johto, janto, swarm + inc a + call DexEntry_NextCategory + xor a ; to ensure a isnt actually returned at -1. 0 is for normal + ret +.max_print + call Fishing_MonIndex_Addr + call Rods_check_any_remaining ; if entries remaining for this species, will return 0 + and a + jr nz, .reached_end ; no more remaining entries for this species, do not increment page + + call DexEntry_IncPageNum + ; page number is currently in a + xor a ; to ensure a isnt actually returned at -1. 0 is for normal + ret +.fishing_text: + db " FISHING @" +.rods_text: + db " RODS @" +.group_text: + db "GROUP:@" +Fishing_Print_Rod: + ; day (e) /nite (d) encounter rates + ld a, [wPokedexEvoStage3] + ld d, a + ld a, [wPokedexEvoStage2] + call Adjust_percent_fish + ld e, a + ld a, d + call Adjust_percent_fish + ld d, a + + push bc ; b has rods printed, c is current maps printed + push de ; day (e) /nite (d) encounter rates + +; time of day icons + ; ld b,b + hlcoord 9, 11 ; same position regardless + call FishEntry_adjusthlcoord_rod ; current print line needs to be in c + ld [hl], $6b ; day icon tile + ld de, 6 + add hl, de + ld [hl], $6c ; nite icon tile +; % char + hlcoord 13, 11 + call FishEntry_adjusthlcoord_rod ; current print line needs to be in c + ld [hl], "<%>" + ld de, 6 ; de should still be 6 since we push/pop de in adjust, check this + add hl, de + ld [hl], "<%>" + + pop de ; nite encounter % in d, day in e + pop bc + push bc ; probably uneccessary but will check later + push de +; encounter % for nite + ld a, d + ld [wTextDecimalByte], a + ld de, wTextDecimalByte + hlcoord 16, 11 + call FishEntry_adjusthlcoord_rod ; current print line needs to be in b + lb bc, 1, 3 + call PrintNum +; encounter rate for day + pop de + pop bc + push bc + ld a, e + ld [wTextDecimalByte], a + ld de, wTextDecimalByte + hlcoord 10, 11 + call FishEntry_adjusthlcoord_rod ; current print line needs to be in b + lb bc, 1, 3 + call PrintNum + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;; Rod Name;;;;;;;;;;;; + pop bc + push bc +;;;;;;;;;; Print Rod based on Index ;;;;;;;;;;;;;;;;; + ld a, [wPokedexStatus] + and 3 ; bit mask for rod type, first 2 bits + ld de, oldrod_text + and a + jr z, .printrod + ld de, goodrod_text + cp 1 + jr z, .printrod + ld de, superrod_text +.printrod + hlcoord 1 , 10 + call FishEntry_adjusthlcoord_rod ; current print line needs to be in b + call PlaceString + + ld c, 4 + call DelayFrames + + pop bc ; line counter + inc b ; we've printed one rod + ret +oldrod_text: + db " OLD ROD@" +goodrod_text: + db " GOOD ROD@" +superrod_text: + db " SUPER ROD@" + +FishEntry_adjusthlcoord_rod: + ; NOTE, preserve bc before calling this + push bc + ld c, b + ; given: current printed map lines in c, rod lines in b + push af + push de + ld a, 20 + ; the num of moves already printed should still be in bc + call SimpleMultiply ; uses c as the other number + ; result in a + ld d, 0 + ld e, a + add hl, de ; allows us to print on the proper row + add hl, de ; allows us to print on the proper row + pop de + pop af + pop bc + ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FISHING ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Dex_Check_Fishing: +; For first pass checks +; NUM_FISHGROUPS +; FISHGROUP_DATA_LENGTH + ; ld hl, FishGroups + ld bc, 0 ; NUM_FISHGROUPS set up for mainloop + ld a, [wPokedexStatus] + and a + jr z, .mainloop + sra a + sra a ; get fishing group, so we can properly calc to the last fishing group + ld c, a +.mainloop + push bc ; NUM_FISHGROUPS + push hl ; FishGroups + FISHGROUP_DATA_LENGTH * n + inc hl ; skip fishing group's bite rate + call Check_Rods + and a + jr z, .found + pop hl ; FishGroups + FISHGROUP_DATA_LENGTH * n + ld bc, FISHGROUP_DATA_LENGTH + add hl, bc ; FishGroups + FISHGROUP_DATA_LENGTH * n + pop bc ; FISH GROUP # + inc c ; FISH GROUP # + + ld a, NUM_FISHGROUPS + cp c + ret z ; not found + jr .mainloop +.found + pop hl + pop bc + xor a + ret + +;;;; Check all Rods in this Group +Check_Rods: + ; looks for first instance of Species, starting with Old Rod +; ; Get encounter data by rod: + ld bc, 0 ; rod +.rod_loop + push bc + push hl +; ; 0: Old +; ; 1: Good +; ; 2: Super + ; inc hl + add hl, bc + add hl, bc + ; set b to 0? + ld b, 0 + call Check_this_rod + ; if a = 0, no match, done + ; if a not 0, accumulate % + ; b will now be this entry's coded % + push af + pop af + and a + jr z, .notfound ; check next rod type +.found + pop hl + pop bc + xor a + ret +.notfound + ; zero the cumulative bytes + xor a + ld [wPokedexEvoStage2], a + ld [wPokedexEvoStage3], a + call Fishing_Inc_Index + pop hl + pop bc + inc c ; 0 -> 1, good rod, 1 ->2 super rod + ld a, 3 + ; will most likely move this check to parent function and be able to query based on rod + cp c + ret z ; means we've checked 3rd rod, super rod, done, no match + jr .rod_loop + +;;;; Look for Species in this Group's Rod, report encounter % for day and nite in 2-byte (WRAM?) that's its not being used during calcs +Check_this_rod: +; day cumulative encounter %: ldh [hMultiplier], a +; nite cumulative encounter %: ldh [hMultiplicand], + ; ld b,b + push hl + ld a, BANK(FishGroups) + call GetFarWord +.loop + ; check for 100% aka 255. In table, probability is not percentage (out of 100) + ; the probabilities add up to 255. So need to cross multiply to get % T.T + ld a, BANK(FishGroups) + call GetFarByte ; index? this is the probability + + ld c, a ; current entry %, b has prev entry %, or 0 if first entry + sub b ; actual cumulative encounter % is difference between entry's % and prev entry's %, now in a + ; push af ; if this table entry is a match, we will need this value, accumulate based on species match + ld b, c ; for the next entry's calculation, need raw % not the calculated difference + ld c, a ; adjusted % + + inc hl + ld a, BANK(FishGroups) + call GetFarByte ; successfuly gets the Species in the Rod table + ld d, a + ld e, a + and a + call z, Dex_FishTimeGroupsGet ; if zero, not the species, + ; looks at Daytime table to determine the species + ld a, [wCurSpecies] + ; we cannot assume we didnt call the ToD table, which can hold two species, + ; so check both d and e + cp d + jr z, .found + cp e + jr z, .found + ; pop af ; dont need this value (diff of entry %), clean stack +.resume + ld a, b + cp 255 ; this is how we tell if we are looking at the last entry of the table (FF) + jr z, .end + ; we have not reached the end, increment to next entry % loop + inc hl ; species + inc hl ; encounter level + jr .loop +.found + ; return true flag for match, plus % + ; b has adjusted % + ; a is species rn, use to determine day/nite + cp d + jr nz, .trynite + push af ; species + ld a, [wPokedexEvoStage2] + add c + ld [wPokedexEvoStage2], a + pop af ; species +.trynite + cp e + jr nz, .resume + ld a, [wPokedexEvoStage3] + add c + ld [wPokedexEvoStage3], a + jr .resume +.end + pop hl + ; call Fishing_Inc_Index + ld a, [wPokedexEvoStage2] + and a + ret nz + ld a, [wPokedexEvoStage3] ; will ret correct value if 0 or not + ; and a + ; ret nz + ; xor a + ; ; b should be this entry's percentage still, regardless of match or not + ret +;;;;;;;;;;;;;;;;;;;;;;;;; Main 3 Fishing Funcs End;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;; Fishing Utility Funcs ;;;;;;;;;;;;;;;;;;;;;;; +Dex_FishTimeGroupsGet: + push hl + push bc + push af + inc hl + ld a, BANK(FishGroups) + call GetFarByte ; index + ; a is the index + ld hl, TimeFishGroups + ld b, 0 + ld c, a + add hl, bc + add hl, bc + add hl, bc + add hl, bc + ld a, BANK(TimeFishGroups) + call GetFarByte + ld d, a ; species 1 + inc hl + inc hl + ld a, BANK(TimeFishGroups) + call GetFarByte + ld e, a ; species 2 +.done + pop af + pop bc + pop hl + ret + +Adjust_percent_fish: + ; hMultiplicand + ; hMultiplier. Result in hProduct. + push hl + push bc + push de + ldh [hMultiplicand], a + ld a, 100 + ldh [hMultiplier], a + call Multiply + ; Divide hDividend length b (max 4 bytes) by hDivisor. Result in hQuotient. + ; All values are big endian. + ld b, 2 + ld a, 255 + ldh [hDivisor], a + call Divide + pop de + pop bc + pop hl + ldh a, [hQuotient + 3] + cp 100 + ret z + cp 0 + ret z + inc a + ret + +Fishing_MonIndex_Addr: + ; clobbers bc and de + ; return addr in hl + ; given: Wildmon Index (Fishing Group in bits 3+, rod type in bits 1&2) + ld a, [wPokedexStatus] ; wildmon index, will be zero if we are here for the first time + and 3 ; masks the rod value + push af ; rod value + ld a, [wPokedexStatus] + sra a; , 2 ; fish group # + sra a + ldh [hMultiplicand + 2], a + xor a + ldh [hMultiplicand + 0], a + ldh [hMultiplicand + 1], a +; Multiply hMultiplicand (3 bytes) by hMultiplier. Result in hProduct. + ld a, FISHGROUP_DATA_LENGTH + ldh [hMultiplier], a + call Multiply ; wildmon entry index + ldh a, [hProduct + 2] + ld b, a + ldh a, [hProduct + 3] + ld c, a ; result of simple multiply in a + ld hl, FishGroups + add hl, bc; pointing to fishgroup bite rate + pop af ; 0 = old rod, 1 = good rod, 2 = super rod + inc hl ; skip the bite rate byte + add a ; double the value since the rod's are pointers/words + ld de, 0 + ld e, a + add hl, de + ret + +Rods_check_any_remaining: + ; given: hl is addr of next rod, already adjusted for prev rod type and/or new fishing group + ; step 1, depending on this new rod type, if not old rod, check_this_rod individually until next fish group + ld a, [wPokedexStatus] + and 3 ; rod type mask for first 2 bits + jr z, .check_rods + cp 2 ; super rod + jr z, .super + ; we are at good rod rn + call Check_this_rod ; 0 means not found + and a + jr nz, .found + call Fishing_Inc_Index + ; check_this_rod calls inc_index which auto incs hl depending on rod type +.super + call Check_this_rod ; 0 means not found + and a + jr nz, .found + call Fishing_Inc_Index +.check_rods + ; hl was already set properly to beginning of Fish group when this func is called + dec hl ; Dex_Check_Fishing assumed you havent already accounted for Fishing Group's bite rate bit + call Dex_Check_Fishing ; 0 means found + ; and a + ; jr z, .found + ret +.found + xor a + ret + ; call Dex_Check_Fishing with hl aligned to new fish group old rod + ; we are about to exit so we dont need to align the hl addr with new incremented Wildmon index + ; when we come back, will auto calculate new Wildmon Index addr + +Fishing_Inc_Index: + ; given hl if using it + ld a, [wPokedexStatus] ; wildmon index + and 3 ; mask for first 2 bits + inc a + cp 3 + jr z, .incfishgrp + ; no new fish grp needed yet + ld a, [wPokedexStatus] ; wildmon index + inc a + ld [wPokedexStatus], a ; wildmon index + inc hl + inc hl ; two bytes to next ptr in fishgrp + ret +.incfishgrp + ld a, [wPokedexStatus] ; wildmon index + sra a + sra a + inc a + sla a + sla a + ld [wPokedexStatus], a ; wildmon index, also zeros the rod type + inc hl + inc hl + inc hl ; need to skip extra byte for fishgrp bite rate + ret diff --git a/engine/pokedex/pokedex_evolution_page.asm b/engine/pokedex/pokedex_evolution_page.asm index 50dabefce..165acdb4a 100644 --- a/engine/pokedex/pokedex_evolution_page.asm +++ b/engine/pokedex/pokedex_evolution_page.asm @@ -12,7 +12,9 @@ DisplayDexMonEvos: lb bc, SCREEN_HEIGHT - 4, SCREEN_WIDTH call ClearBox call EVO_Draw_border + ld a, [wTempSpecies] + ld [wCurDamage + 2], a callfar GetPreEvolution callfar GetPreEvolution ld a, [wCurPartySpecies] @@ -20,6 +22,7 @@ DisplayDexMonEvos: ld [wCurSpecies], a ld [wTempMonSpecies], a + ld de, .stage1_text hlcoord 6, 1 call PlaceString @@ -82,6 +85,8 @@ ENDC hlcoord 3, 6 ld de, .doesnt_evo_text call PlaceString + hlcoord 5, 2 + ld [hl], " " ret ; no Evos .does_evo push hl @@ -92,7 +97,6 @@ ENDC ; we're in a multi-page evo line pop hl ; dont need this value, just fix stack pop af ; dont need this value, just fix stack - ;call EVO_print_pagenum ; returns additional page num/index ld a, [wCurDamage] ; page num ld c, 4 ; we want the 4th Evo call SimpleMultiply @@ -335,13 +339,10 @@ ENDC ret .stage1_text: db $6b, $6c, $6d, "1@" - ; db "STAGE 1:@" .stage2_text: db $6b, $6c, $6d, "2@" - ; db "STAGE 2:@" .stage3_text: db $6b, $6c, $6d, "3@" - ; db "STAGE 3 .cont_page_text: db $63, $64, $65, $66, "@" .doesnt_evo_text: @@ -460,14 +461,10 @@ EVO_trade: .trade_text: db "TRADE@" .hold_text: - db " ", "<+>","@" + db " ", "+","@" EVO_happiness: push hl ; time of day byte - ; call EVO_inchlcoord - ; ld de, .happiness_text - ; call PlaceString ; mon species - pop hl ; time of day byte ld a, BANK("Evolutions and Attacks") call GetFarByte @@ -523,7 +520,7 @@ EVO_stats: cp ATK_EQ_DEF jr z, .done ld de, .atk_gt_def_text - cp ATK_LT_DEF + cp ATK_GT_DEF jr z, .done ld de, .atk_lt_def_text .done @@ -601,12 +598,9 @@ EVO_place_Mon_Types: push af push bc push hl - ld a, [wTempMonSpecies] - ld a, [wTempSpecies] ld a, [wCurSpecies] push af ld a, [wCurPartySpecies] - ld a, [wTempSpecies] ld [wCurSpecies], a call GetBaseData @@ -700,7 +694,6 @@ IF USE_GEN3_STYLE_TYPE_GFX == TRUE call Request2bpp ENDC - push af call EVO_type_gethlcoord IF USE_GEN3_STYLE_TYPE_GFX == TRUE @@ -903,16 +896,16 @@ EVO_DrawSpriteBox: cp 2 jr z, .slot4 ; slot 1 - hlcoord 1, 5 ; 0, 4 + hlcoord 1, 5 jr .start .slot3 - hlcoord 1, 9 ; 0, 8 + hlcoord 1, 9 jr .start .slot4 - hlcoord 1, 13 ; 0, 12 + hlcoord 1, 13 jr .start .stage1 - hlcoord 1, 1 ; 0, 0 + hlcoord 1, 1 .start ; top left corner ld [hl], $7a ; 3x1 corner, VRAM1 @@ -1076,16 +1069,16 @@ EVO_place_CaughtIcon: cp 2 jr z, .slot4 ; slot 1 - hlcoord 5, 5 ; 0, 4 + hlcoord 5, 4 ; 5, 5 jr .start .slot3 - hlcoord 5, 9 ; 0, 8 + hlcoord 5, 8 ; 5, 9 jr .start .slot4 - hlcoord 5, 13 ; 0, 12 + hlcoord 5, 12 ; 5, 13 jr .start .stage1 - hlcoord 5, 2 ; 0, 0 + hlcoord 5, 1 ; 5, 2 .start ld [hl], $70 ; pokeball icon, VRAM1 .done @@ -1160,6 +1153,13 @@ EVO_Draw_border: hlcoord 16, 16 ld de, .back_page_text call PlaceString + + ; print up/down arrows + hlcoord 19, 0 + ld [hl], $3f + hlcoord 19, 17 + ld [hl], $40 + call WaitBGMap ret .back_page_text: @@ -1243,5 +1243,3 @@ EVO_CheckSeenMon: EVO_Unseen_Mon_text: db "?????@" ENDC - - diff --git a/engine/pokedex/pokedex_stats_page.asm b/engine/pokedex/pokedex_stats_page.asm index e618d0fdc..9a75aba34 100644 --- a/engine/pokedex/pokedex_stats_page.asm +++ b/engine/pokedex/pokedex_stats_page.asm @@ -6,9 +6,9 @@ ENDC EXPORT POKEDEX_STATSPAGE_MAX_PAGE_NUM String_BASE_text: - db " BASE @" ; @ 8, 6 + db "BASE @" ; @ 8, 6 String_STATS_text: - db " STATS @" ; @ 8, 7 + db " STATS @" ; @ 8, 7 DisplayDexMonStats:: ld a, [wTempSpecies] ld [wCurSpecies], a @@ -71,64 +71,53 @@ ENDC ; done handling EVs/StatExp differences db "BASE STATS@" Pokedex_GBS_Stats: - ld de, BS_HP_text - hlcoord 3, 10 - call PlaceString ; TEXT for 'HP' name - - ld de, BS_ATK_text - hlcoord 3, 11 - call PlaceString ; TEXT for 'ATK' name - - ld de, BS_DEF_text - hlcoord 12, 11 - call PlaceString ; TEXT for 'DEF' name - - ld de, BS_SPCL_text - hlcoord 3, 12 - call PlaceString ; TEXT for 'SPCL' name - - ld de, BS_SPCLDEF_text - hlcoord 12, 12 - call PlaceString - - ld de, BS_SPEED_text - hlcoord 12, 10 - call PlaceString + hlcoord 1, 9 + ld de, .String_abbrv_BS_text1 + call PlaceString + hlcoord 1, 10 + ld de, .String_abbrv_BS_text2 + call PlaceString + hlcoord 1, 11 + ld de, .String_abbrv_BS_text3 + call PlaceString - hlcoord 7, 10 + hlcoord 6, 9 ld de, wBaseHP - ld c, 3 ;digits - ld b, 1 ;bytes + lb bc, 1, 3 ; 1 byte, 3 digits call PrintNum - hlcoord 16, 10 + hlcoord 15, 9 ld de, wBaseSpeed - ld c, 3 ;digits - ld b, 1 ;bytes + lb bc, 1, 3 ; 1 byte, 3 digits call PrintNum - hlcoord 7, 11 + hlcoord 6, 10 ld de, wBaseAttack - ld c, 3 ;digits - ld b, 1 ;bytes + lb bc, 1, 3 ; 1 byte, 3 digits call PrintNum - hlcoord 16, 11 + hlcoord 15, 10 ld de, wBaseDefense - ld c, 3 ;digits - ld b, 1 ;bytes + lb bc, 1, 3 ; 1 byte, 3 digits call PrintNum - hlcoord 7, 12 + hlcoord 6, 11 ld de, wBaseSpecialAttack - ld c, 3 ;digits - ld b, 1 ;bytes + lb bc, 1, 3 ; 1 byte, 3 digits call PrintNum - hlcoord 16, 12 + hlcoord 15, 11 ld de, wBaseSpecialDefense - ld c, 3 ;digits - ld b, 1 ;bytes + lb bc, 1, 3 ; 1 byte, 3 digits call PrintNum + ret + +.String_abbrv_BS_text1: + db " HP SPE @" +.String_abbrv_BS_text2: + db " ATK DEF @" +.String_abbrv_BS_text3: + db " SPA SPD @" - hlcoord 3, 14 +Pokedex_BST: + hlcoord 2, 9 ld de, .BS_Total_text call PlaceString @@ -179,7 +168,7 @@ Pokedex_GBS_Stats: ld a, l ld [wCurDamage + 1], a - hlcoord 15, 14 + hlcoord 15, 9 ld de, wCurDamage lb bc, 2, 3 call PrintNum @@ -191,28 +180,18 @@ Pokedex_GBS_Stats: .BS_Total_text: db "Base Total:@" -BS_HP_text: - db " HP@" -BS_SPEED_text: - db "SPE@" -BS_ATK_text: - db "ATK@" -BS_DEF_text: - db "DEF@" -BS_SPCL_text: - db "SPA@" -BS_SPCLDEF_text: - db "SPD@" - Pokedex_Get_Items: ; TODO: Add code to differentiate same items in both entries, special cases - hlcoord 3, 10 + ld a, [wCurSpecies] + push af + + hlcoord 2, 13 ld de, .BS_ITEM_text call PlaceString - hlcoord 3, 11 + hlcoord 2, 14 ld de, .BS_ITEM1 call PlaceString - hlcoord 3, 12 + hlcoord 2, 15 ld de, .BS_ITEM2 call PlaceString @@ -227,7 +206,7 @@ Pokedex_Get_Items: ld [wNamedObjectIndex], a call GetItemName .Item1Done - hlcoord 7, 11 + hlcoord 7, 14 call PlaceString .WildHeldItems2: ld de, .ThreeDashes @@ -240,15 +219,18 @@ Pokedex_Get_Items: ld [wNamedObjectIndex], a call GetItemName .Item2Done - hlcoord 7, 12 + hlcoord 7, 15 call PlaceString + pop af + ld [wCurSpecies], a + ld [wTempSpecies], a ret .ThreeDashes: db "---@" .BS_ITEM_text: db "Wild Held Items:@" .BS_ITEM1: - db "[1]@" + db "[23<%>]@" .BS_ITEM2: db "[ 2<%>]@" @@ -346,13 +328,13 @@ Pokedex_EggG_SetUp: and $f0 swap a ld c, a - hlcoord 3, 10 + hlcoord 2, 11 ld de, .BS_Egg_text1 push bc call PlaceString pop bc call Pokedex_Get_EggGroup - hlcoord 4, 11 + hlcoord 4, 12 push bc call PlaceString pop bc @@ -360,14 +342,14 @@ Pokedex_EggG_SetUp: cp c jr z, .EggGroups_DONE ;;; Print second egg group - hlcoord 3, 10 + hlcoord 2, 11 ld de, .BS_Egg_text2 push bc call PlaceString pop bc ld b, c call Pokedex_Get_EggGroup - hlcoord 4, 12 + hlcoord 4, 13 call PlaceString ;no longer need to preserve bc .EggGroups_DONE ret @@ -376,7 +358,6 @@ Pokedex_EggG_SetUp: .BS_Egg_text2: db "Egg Groups: @" - Pokedex_Get_EggGroup: ;; have the fixed group num in 'a' already ;; return 'de' as the text for matching group @@ -470,7 +451,7 @@ Pokedex_Get_EggGroup: db "Dragon@" Pokedex_Get_GenderRatio:: - hlcoord 3, 15 + hlcoord 2, 14 ld de, .GR_Text call PlaceString ld a, [wBaseGender] @@ -499,12 +480,12 @@ Pokedex_Get_GenderRatio:: jr z, .GR_print ld de, DexEntry_NONE_text .GR_print - hlcoord 14, 15 + hlcoord 4, 15 call PlaceString ret .GR_Text - db "Gender <%>: @" + db "Gender Ratio: @" .GR_always_fem: db "♀ Only@" .GR_always_male @@ -518,86 +499,14 @@ Pokedex_Get_GenderRatio:: .GR_MostMale db "7♂:1♀@" -Pokedex_CatchRate: - hlcoord 3, 15 - ld de, .BS_Catchrate - call PlaceString - hlcoord 15, 15 - lb bc, PRINTNUM_LEFTALIGN | 1, 3 - ld de, wBaseCatchRate - call PrintNum - ret -;Catch Rate -.BS_Catchrate: - db "Catch Rate: @" - -Pokedex_Get_Growth:: -;Growth rate - ; hlcoord 3, 14 - ; ld de, .BS_Growth_text - ; call PlaceString - ld a, [wBaseGrowthRate] - ld de, .growth_Medfast - cp GROWTH_MEDIUM_FAST - jr z, .Growth_print - ld a, [wBaseGrowthRate] - ld de, .growth_slightfast - cp GROWTH_SLIGHTLY_FAST - jr z, .Growth_print - ld a, [wBaseGrowthRate] - ld de, .growth_slightslow - cp GROWTH_SLIGHTLY_SLOW - jr z, .Growth_print - ld a, [wBaseGrowthRate] - ld de, .growth_medslow - cp GROWTH_MEDIUM_SLOW - jr z, .Growth_print - ld a, [wBaseGrowthRate] - ld de, .growth_fast - cp GROWTH_FAST - jr z, .Growth_print - ld de, .growth_slow -.Growth_print - hlcoord 3, 15 - call PlaceString - ret -; .BS_Growth_text: -; db "GROWTH RATE: @" -.growth_Medfast: - db "Med. Fast Growth@" -.growth_slightfast - db "Sml. Fast Growth@" -.growth_slightslow - db "Sml. Slow Growth@" -.growth_medslow - db "Med. Slow Growth@" -.growth_fast - db "Fast Growth@" -.growth_slow - db "Slow Growth@" - -Pokedex_PrintBaseExp: -; wBaseExp - hlcoord 3, 14 - ld de, .Exp_text - call PlaceString - hlcoord 14, 14 - ld de, wBaseExp - ; lb bc, PRINTNUM_LEFTALIGN | 1, 3 - lb bc, 1, 3 - call PrintNum - ret -.Exp_text: - db "EXP Yield:@" - Pokedex_PrintHatchSteps: ; wBaseEggSteps - hlcoord 3, 13 + hlcoord 2, 9 ld de, .HatchSteps_text call PlaceString - hlcoord 14, 13 + hlcoord 13, 9 ld de, wBaseEggSteps - lb bc, 1, 3 + lb bc, 1, 3 ; 1 byte, 3 digits call PrintNum ret .HatchSteps_text: @@ -739,6 +648,9 @@ Pokedex_PrintBaseEVs: ENDC Pokedex_HeightWeight: + push hl + push bc + push de ; height string IF DEF(MON_STAT_EXP) ; vanilla hlcoord 2, 15 @@ -761,17 +673,16 @@ ENDC inc hl cp "@" jr nz, .loop1 - ; hl should now be at height push hl ; keep the ptr, for weight ld a, b ; bank push af ; keep bank call GetFarWord ld a, h - ld [wPoisonStepCount], a + ld [wPoisonStepCount], a ; weight ptr, 2 bytes ld a, l - ld [wPoisonStepCount + 1], a - ld de, wPoisonStepCount + ld [wPoisonStepCount + 1], a ; weight ptr, 2 bytes + ld de, wPoisonStepCount ; weight ptr, 2 bytes ; Print the height, with two of the four digits in front of the decimal point IF DEF(MON_STAT_EXP) ; vanilla hlcoord 4, 15 @@ -793,7 +704,7 @@ ENDC inc hl call GetFarWord ld a, h - ld [wPoisonStepCount], a + ld [wPoisonStepCount], a ; weight ptr, 2 bytes ld a, l ld [wPoisonStepCount + 1], a ; weight ptr, 2 bytes ld de, wPoisonStepCount ; weight ptr, 2 bytes @@ -862,4 +773,4 @@ BS_DEF_text: BS_SPCL_text: db "SPA@" BS_SPCLDEF_text: - db "SPD@" + db "SPD@" \ No newline at end of file diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index a8602caf4..f89c1d34c 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -73,6 +73,17 @@ PokeGear: .InitTilemap: call ClearBGPalettes call ClearTilemap +; ; time of day icons +; push af +; xor a +; ldh [hBGMapMode], a +; ld de, Pokedex_ExtraTiles tile $f +; ld hl, vTiles2 tile $63 +; lb bc, BANK(Pokedex_ExtraTiles), 3 ; tiles +; call Request2bpp +; pop af +; ldh [hBGMapMode], a +; call ClearSprites call DisableLCD xor a @@ -671,7 +682,7 @@ Pokegear_UpdateClock: .MornStr: db "MORN@" .DayStr: - db "DAYTIME@" + db "DAY@" .NiteStr: db "NITE@" ; db "NIGHT@" @@ -2515,12 +2526,12 @@ Pokedex_GetArea: ld c, 4 call Request2bpp call LoadTownMapGFX - call FillKantoMap + call Dex_FillKantoMap call .PlaceString_MonsNest call TownMapPals hlbgcoord 0, 0, vBGMap1 call TownMapBGUpdate - call FillJohtoMap + call Dex_FillJohtoMap call .PlaceString_MonsNest call TownMapPals hlbgcoord 0, 0 @@ -2634,6 +2645,21 @@ Pokedex_GetArea: ld l, c ld de, .String_SNest call PlaceString +; add blurb to let people know they can press select to see current location + hlcoord 1, 2 + ld a, $48 ; part of SELECT > + ld [hli], a + ld a, $49 ; part of SELECT > + ld [hli], a + ld a, $4a ; part of SELECT > + ld [hli], a + ld a, $1d ; custom arrow cap + YOU + ld [hli], a ; $78 + ld [hl], $1e + +; show player coords +; ; show player +; lb de, $28, $34 ret .String_SNest: @@ -2805,6 +2831,14 @@ FillJohtoMap: ld de, JohtoMap jr FillTownMap +Dex_FillJohtoMap: + ld de, DEX_JohtoMap + jr FillTownMap + +Dex_FillKantoMap: + ld de, DEX_KantoMap + jr FillTownMap + FillKantoMap: ld de, KantoMap FillTownMap: @@ -2961,9 +2995,13 @@ INCBIN "gfx/pokegear/pokegear_timeofday_icons.2bpp" JohtoMap: INCBIN "gfx/pokegear/johto.bin" +DEX_JohtoMap: +INCBIN "gfx/pokegear/dex_johto.bin" KantoMap: INCBIN "gfx/pokegear/kanto.bin" +DEX_KantoMap: +INCBIN "gfx/pokegear/dex_kanto.bin" PokedexNestIconGFX: INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp" diff --git a/engine/pokemon/mon_stats.asm b/engine/pokemon/mon_stats.asm index d72db8178..e894a61a8 100644 --- a/engine/pokemon/mon_stats.asm +++ b/engine/pokemon/mon_stats.asm @@ -489,13 +489,8 @@ ListMoves: ret GetMonTypeIndex: -; automatically detects and accounts for Physical/Special Split (PSS) ; type in c, because farcall clobbers a -; if PSS, c needs to be adjusted ld a, c -IF DEF(TYPE_MASK) - and TYPE_MASK ; Phys/Spec Split specific -ENDC ; Skip Bird cp BIRD jr c, .done diff --git a/gfx/pokegear/dex_johto.bin b/gfx/pokegear/dex_johto.bin new file mode 100644 index 0000000000000000000000000000000000000000..b3805e13e7a8510165ac8f16a205fc1acb3480a1 GIT binary patch literal 361 zcmZXQ+YZ7o3_}?V5Z#7|C?NzS=-P3={QuX1(;;5)Lz^Bsw$#b=PiyvL`Y9$4F?(N@ z<(G#LzYJHGt?hh3%iibxs^2b@MonfZDde=aL!B|KDQvJHGsW@Dlh8|}bUQ~EKAYPpJd=3+P(an=%yVPGaVvt2v|Emj5AiVQLvN<|b}VFr># lW|%5_S%=8MR%)9}%;(GXwmXnT$oBqtzV>|l`_k#@{Q(6G9a{hZ literal 0 HcmV?d00001 diff --git a/gfx/pokegear/dex_kanto.bin b/gfx/pokegear/dex_kanto.bin new file mode 100644 index 0000000000000000000000000000000000000000..d8dc4a1645660df056efb4005f263c5d6fac50bf GIT binary patch literal 361 zcmZXQ+YZ7Y5JYVgwNj#;MsZyqwA6aP{QuYKEcT&EH-Uu1Sq7NRN3{*>L7h58kuYE+ zhK6hdpe7>gTL16fKvna^0Bui3JLr0fET;!}z^Qsw&gzjH)1)$h4V_0F0{2)j$vn4; zz2~4!V-3)l&eJ1TDpH!q;@sRBg{Oi(wF7EhyNJON5Uai~0TJeP=8ZG2|B;!yd}sN6=ls5N z&g8CEL`Qmg`g%eT+A+=TYUJGBmSbSt&ze17M1!dlq zep|VwFy)dR)Pw`ugEr-6{TejabJzG)?9f%u-~4jz+=AR?QqRqLG7O-@#E|Z3IzT0&GoXd z4W}j=3bMXa-hnfQOu64wJp89oPhTVk&I;Qx2!dSvNQp!tlStlW19B+Zo_{i`N-^wg z&VFSCRlaJK#O+4j_3G0(KBGOk>lb836%Jop$?^}Z=0D!{xQhDNt>kp#>6^{d+}$gz zcb~l$6g|&wOa3NkVOmSI1d$a~HqLrmn)5r_m{uk$9MifSnHhAPQ&RK%Wz^+greDmO zUH96yX(u)|>QSlxj0)Fu_j|1erS!dNjV~KlTPK)lh2i%C>^huw(R_nr_y5Cw@NnXo z315nD$7_E!Mz3TH?l)oG>cBMF(9CGEA|Ug^04p4@@$8_6ZRvaN%-MMH!h?kSYpHE( zj_qe3*t_x5;Il2|9&J9hTfx7*U2-5hY2&s->utVx*v+|$hDbkaPVS+QeW6t~@`&p# z&4*`SI(TtQ&I$X#oKi*EnY?dmK~b1VaQF%G86uTl%fN8Gl3-Z122d3c6dY_QpNnA{e=gJYeK|-XF(kvqpn-v|W%F0j)aaw4IXRuWS0JH>!!B(wC zXA)V(G$*bIygS598tgQoGQ_k5xdN8xjRcG`PzFMeu##prEyNQJHsWegO!%}e2(S{< z(kRLxVlpij3&X-;=#8mNmQW~UB5Wp`O$QcqlTAlqR=UpQ=YZ(M2q#P`BWa*Wy$*I@ zVoH4`C8p7U9)1^})*zR6!|P04EC4>3R?NU;F%YI!%k1f4q9V)yq${95^)SVO9%9B2 zCVi$+MMRhh9p%>(0#|kW8#0X=XF9lwNoWWyFg1Z)S-rN5l*tv{9u5jpNv*-@1<3AY zNs;RJWc7;8p>d|uGZ5h3joZumUG7d}U?rD}!u6_5M|iSuG0m~R2-mAfT;zO3F%F;0 zRSD^ciiglql#S4Zs6a`_a3x28^7v|mKzl&RbS4VZsR#!Y0B4W@N68l`c`PN5&ccNl z9Tl+Dbfr=VZY-RG;yfXT&%t^?%rugqDltvZs2or@fa0hzm71ec(Ro5}L%C`JU7*5* z0GW*;Y!+9IvRFeV1Jua)Y((9#KO*1=TbvDn+b-UZ6U%`ohg_wGl4tf z1X!IaRT`#CCBXdXD%f{&@=uCE%@GhN3hIfCtN5UvI4CFvHbLicgeZ=&xH!gU_eMAA z)szJ@5@D%;N5B;*P$yUL#IB}_vJBOK=dD5E2MdJoEI%&ugaj*0Ou+hFE@@e%Aa z=rLk|U#AR=E-(q1-J`IJFUQdN3x8eb@E7g?p!+uYAb$Jk>Z9v}82BLLzUu0u>w_5h zAmhI3`oGcT`Tk>y(1CwI7VxR$QTAjQ_{?%uPLB+SN{jNye}a{VL7HfSpn*djmkYGD z$Oj1BDVaRN{js}`H^Lj064MBr(q!RbaS2t`35lC>kpcVKkI_aC8GK=J+GN>zHM8p2 z_Y(hEKe!g2zaw=~JX@4s#7RE7sckYet>ltS`u!)+?(`M-Xm3ko-Q)*tG1)F9AKfjC zJ-lkKm#%PP@yC{wl7TBmx-n)fy*6XGpuD>2)zf4tdtlS(<)tfI>l7!ib-o1j;}*@U&|l0=Z}9tR-a`0hSQB%r3F7F)f7iYkMw9b_XQ)%?%T51 zzBqEJIi=-%gzNBSV$U;)LuL6d#Zmfaw->igIw5iEw|x7T1?#gnLUGk!dHYR*4%{El zc@@%fVubo%8%9!Ra(M*|?$zo2@i|LjZ+qlyt_eQ!Fkb6=#dI&CxK=27E@b<8S?z>k z_^EYv`G(bLci_#oakHw!0wB%79mC=)g|*EMAxkTY9_7)7wy;m+DFCOS@#rZTqiTq?YSzp6*CNbH=*(?*42_`dKteP{+=;*otdqh^P5=`pEikkCeWgNsS8RNYghHk?l5N zTj|NYZ%QghU1@!C^iBP|CpC*gkJ{nNP-fxueFvISN=C5nX4lkaKfLty<&TPdxBOmu z>)X=Chk4?;Y}@&|{Y?*FcNDjs^bUHlC4a@3l(puZ)(QQZ&lPWvO=yD3Z+3)~z8u&8 zU|mPZqtL+(H$2AEk-6F;Wz$Q$c^G;^kPpDkcR#{7A^Ld)*8RLr+mJ_Th6$s(e|zx!mt Gvi|^s8RJC& delta 427 zcmV;c0aX6hB)J2S7=Ho)00018(6X2S00DqWL_t(|+HI0CYr;Sj$6pLtjzShQc5H`C z1y_r<-Gak`_iPbEX8R>7&Rq)~l_G@qDU_^*PWc`IaZ9+~i@|u}BjknLkNf}c-5*eO zyFo&m`Fu)XDo^qRASA8P6cM0YF1?sGh(`cpjKegda-aegq<6jq{=^0?=U>1`D>be?< zFJ7N8fU&wYK!5#Q0ce4hder(=>%0MM36jQwSu!eztH4AW3pQX&Ol6F-K