DV / Stat Exp display in stat menu

Imported from Shin Pokered. Required a little bit of refactoring but all in all very straightforward. I changed the WRAM associations to be easier for me to work with should I ever need to.

I am not a 100% fan of the way this works - requiring hold inputs - but I am also not sure how to make it just be something you can easily input...
This commit is contained in:
Llinos Evans 2023-06-11 07:25:45 +01:00
parent c939b46740
commit 98110eddc8
3 changed files with 121 additions and 10 deletions

View file

@ -9,12 +9,12 @@ New Pokemon:
The Kanto Expansion Pak's ethos is to add every "Kanto-related" Pokemon to RBY without fundamentally changing the grander metagame. What's defined as "Kanto-related" is a Pokemon that evolves from an existing Kanto Pokemon, made an appearance in a Kanto-based game (LGPE), is a regional variant, or was a Kanto-related Pokemon cut during the development of an official game. The Kanto Expansion Pak's ethos is to add every "Kanto-related" Pokemon to RBY without fundamentally changing the grander metagame. What's defined as "Kanto-related" is a Pokemon that evolves from an existing Kanto Pokemon, made an appearance in a Kanto-based game (LGPE), is a regional variant, or was a Kanto-related Pokemon cut during the development of an official game.
With this criteria, we get: With this criteria, we get:
- The 34 known beta Pokemon that were cut from RBY; eg. Gorochu, Deer - The 34 known beta Pokemon that were cut from Red and Green; eg. Gorochu, Deer
- Evolutions or pre-evolutions of a Kanto Pokemon found in a future generation eg. Kleavor, Glaceon, Annihilape - Evolutions or pre-evolutions of a Kanto Pokemon found in a future generation eg. Kleavor, Glaceon, Annihilape
- Evolutions of Kanto Pokemon found in the SpaceWorld '97 demo; eg. Madaamu, Purakkusu - Evolutions of Kanto Pokemon found in the SpaceWorld '97 demo of Gold and Silver; eg. Madaamu, Purakkusu
- All fully-evolved regional variants of Kanto Pokemon; eg. Hisuian Arcanine, Galarian Slowbro, Paldean Tauros, Alolan Muk - All fully-evolved regional variants of Kanto Pokemon; eg. Hisuian Arcanine, Galarian Slowbro, Paldean Tauros, Alolan Muk
- Meltan and Melmetal from LGPE. - Meltan and Melmetal from Let's Go Pikachu and Let's Go Eevee.
- Paradox Pokemon from SV; Scream Tail and Sandy Shocks. - Paradox Pokemon from Scarlet & Violet; Scream Tail and Sandy Shocks.
Johto baby Pokemon and regional pre-evolutions were omitted due to RBY using an 8-bit register. This hack as-is just barely manages to fit everything. A refactor to a 16-bit register is possible and has been done before, but only on a really old pokered version that would require a ton of its own refactoring to be modernised. It's just not feasible at this current time. Johto baby Pokemon and regional pre-evolutions were omitted due to RBY using an 8-bit register. This hack as-is just barely manages to fit everything. A refactor to a 16-bit register is possible and has been done before, but only on a really old pokered version that would require a ton of its own refactoring to be modernised. It's just not feasible at this current time.
@ -119,6 +119,7 @@ QoL Enhancements
- New Pokedex entries for most Pokemon are available, sourced from the original 1996 Pokedex book by Creatures Inc., restoring a ton of old Kanto lore. Thanks to [Dr. Lava and Nob Ogasawara](http://lavacutcontent.com/1996-creatures-pokedex-translation-1/) for their incredible work translating and writing about it! - New Pokedex entries for most Pokemon are available, sourced from the original 1996 Pokedex book by Creatures Inc., restoring a ton of old Kanto lore. Thanks to [Dr. Lava and Nob Ogasawara](http://lavacutcontent.com/1996-creatures-pokedex-translation-1/) for their incredible work translating and writing about it!
- Pikachu and Eevee are now starters, featuring fully functional Rival lineups. If you pick Pikachu, he picks Eevee, and if you pick Eevee, he picks Pikachu! Their growth rates have been changed to Medium Slow to give them the early-game power spike the other starters have. - Pikachu and Eevee are now starters, featuring fully functional Rival lineups. If you pick Pikachu, he picks Eevee, and if you pick Eevee, he picks Pikachu! Their growth rates have been changed to Medium Slow to give them the early-game power spike the other starters have.
- Item Descriptions are available! - Item Descriptions are available!
- DVs and Stat Exp can be viewed on the status screen by holding start or select when opening the menu, respectively. Feature ported to modern Pokered from Shin Pokered.
- Press A beside surfable water, strength boulders, or cut trees to use the HMs without needing to go into the Party menu. - Press A beside surfable water, strength boulders, or cut trees to use the HMs without needing to go into the Party menu.
- Running Shoes activate by holding B. Also works with the bike and Surf. - Running Shoes activate by holding B. Also works with the bike and Surf.
- Fast text has no frame delay between text scrolling, doubling the scroll speed. It's also been made the default option, so you don't need to go into the Options menu for it. - Fast text has no frame delay between text scrolling, doubling the scroll speed. It's also been made the default option, so you don't need to go into the Options menu for it.
@ -208,6 +209,7 @@ Known Bugs
- Meltan spawned via the Mystery Box will use the moves of the Pokemon they are replacing. - Meltan spawned via the Mystery Box will use the moves of the Pokemon they are replacing.
- GiveMonName doesn't work properly for the Vermilion Beauty after receiving the Pokemon, jank ensues. - GiveMonName doesn't work properly for the Vermilion Beauty after receiving the Pokemon, jank ensues.
- Text scrolls immediately when receiving the Pokemon from the Vermilion Beauty. - Text scrolls immediately when receiving the Pokemon from the Vermilion Beauty.
- HP DV does not appear to display correctly.
Evolution Methods for new Pokemon Evolution Methods for new Pokemon
==== ====
@ -336,7 +338,7 @@ Credits
* Helix Chamber, RacieBeep, loumilouminosus, Orchid, GBCRetro, & catstorm26 - Prototype Pokémon sprites * Helix Chamber, RacieBeep, loumilouminosus, Orchid, GBCRetro, & catstorm26 - Prototype Pokémon sprites
* Vortiene - Reused a bit of code from their pureRGB hack. Assisted in bug fixes. * Vortiene - Reused a bit of code from their pureRGB hack. Assisted in bug fixes.
* Pigu-A, RevoSucks, walle303 - Contributors to Pokemon Anniversary Red, which we used as reference points for the Girl sprites and the Battle Tent. * Pigu-A, RevoSucks, walle303 - Contributors to Pokemon Anniversary Red, which we used as reference points for the Girl sprites and the Battle Tent.
* jojobear13 & Mateo - Move deleter & move relearner functionality from Shin Pokered, followed [this guide](https://github.com/jojobear13/shinpokered/blob/master/how%20to%20guides/how%20to%20add%20the%20move%20relearner%26deleter.txt). Tweaks were made to make it compatible with the pokered version we worked off of. * jojobear13 & Mateo - HP/StatExp display, move deleter, & move relearner functionality from Shin Pokered, followed [this guide](https://github.com/jojobear13/shinpokered/blob/master/how%20to%20guides/how%20to%20add%20the%20move%20relearner%26deleter.txt). Tweaks were made to make it compatible with the pokered version we worked off of.
* Rangi - Reused a bit of code from their Red* / Blue* hack to make HMs usable in the overworld! * Rangi - Reused a bit of code from their Red* / Blue* hack to make HMs usable in the overworld!
* wrulfy - Technical advice * wrulfy - Technical advice
* 大吟醸 (Daiginjo) - Assistance in translating the Tamamushi University Student Book, allowing for an accurate adaptation of the location. * 大吟醸 (Daiginjo) - Assistance in translating the Tamamushi University Student Book, allowing for an accurate adaptation of the location.

View file

@ -33,6 +33,7 @@ DrawHP_:
ld a, $6 ld a, $6
ld d, a ld d, a
ld c, a ld c, a
; shin pokered status screen func
.drawHPBarAndPrintFraction .drawHPBarAndPrintFraction
pop hl pop hl
push de push de
@ -40,7 +41,7 @@ DrawHP_:
push hl push hl
call DrawHPBar call DrawHPBar
pop hl pop hl
ldh a, [hUILayoutFlags] ld a, [hUILayoutFlags] ; wass hFlags_0xFFF6, translated into modern pokered-ese it's this
bit 0, a bit 0, a
jr z, .printFractionBelowBar jr z, .printFractionBelowBar
ld bc, $9 ; right of bar ld bc, $9 ; right of bar
@ -49,6 +50,24 @@ DrawHP_:
ld bc, SCREEN_WIDTH + 1 ; below bar ld bc, SCREEN_WIDTH + 1 ; below bar
.printFraction .printFraction
add hl, bc add hl, bc
;joenote - print stat exp if select is held
;parse dv stats here so they can be grabbed later
call DVParse
call Joypad
ld a, [hJoyHeld]
bit 2, a
jr z, .checkstart
ld de, wLoadedMonHPExp
lb bc, 2, 5
jr .printnum
.checkstart ;print DVs if start is held
bit 3, a
jr z, .doregular
ld de, wDVCalcVar1
lb bc, 1, 2
jr .printnum
.doregular
ld de, wLoadedMonHP ld de, wLoadedMonHP
lb bc, 2, 3 lb bc, 2, 3
call PrintNumber call PrintNumber
@ -56,6 +75,8 @@ DrawHP_:
ld [hli], a ld [hli], a
ld de, wLoadedMonMaxHP ld de, wLoadedMonMaxHP
lb bc, 2, 3 lb bc, 2, 3
.printnum
call PrintNumber call PrintNumber
pop hl pop hl
pop de pop de
@ -272,6 +293,36 @@ PrintStatsBox:
pop hl pop hl
pop bc pop bc
add hl, bc add hl, bc
; New Stat Exp / DVs display functionality, from shin pokered.
;joenote - print stat exp if select is held
call Joypad
ld a, [hJoyHeld]
bit 2, a
jr z, .checkstart
dec l ;shift alignment 2 tiles to the left
dec l
ld de, wLoadedMonAttackExp
lb bc, 2, 5
call PrintStat
ld de, wLoadedMonDefenseExp
call PrintStat
ld de, wLoadedMonSpeedExp
call PrintStat
ld de, wLoadedMonSpecialExp
jp PrintNumber
.checkstart ;joenote - print DVs if start is held
bit 3, a
jr z, .doregular
ld de, wDVCalcVar2
lb bc, 1, 2
call PrintStat
ld de, wDVCalcVar2 + 1
call PrintStat
ld de, wDVCalcVar2 + 2
call PrintStat
ld de, wDVCalcVar2 + 3
jp PrintNumber
.doregular
ld de, wLoadedMonAttack ld de, wLoadedMonAttack
lb bc, 2, 3 lb bc, 2, 3
call PrintStat call PrintStat
@ -480,3 +531,58 @@ StatusScreen_PrintPP:
dec c dec c
jr nz, StatusScreen_PrintPP jr nz, StatusScreen_PrintPP
ret ret
; DV parsing from shin pokered
;joenote - parse DV scores
DVParse:
push hl
push bc
ld hl, wDVCalcVar2
ld b, $00
ld a, [wLoadedMonDVs] ;get attack dv
swap a
and $0F
ld [hl], a
inc hl
and $01
sla a
sla a
sla a
or b
ld b, a
ld a, [wLoadedMonDVs] ;get defense dv
and $0F
ld [hl], a
inc hl
and $01
sla a
sla a
or b
ld b, a
ld a, [wLoadedMonDVs + 1] ;get speed dv
swap a
and $0F
ld [hl], a
inc hl
and $01
sla a
or b
ld b, a
ld a, [wLoadedMonDVs + 1] ;get special dv
and $0F
ld [hl], a
inc hl
and $01
or b
ld b, a
ld [hl], b ;load hp dv
pop bc
pop hl
ret

View file

@ -1797,8 +1797,6 @@ wOptions:: db
wObtainedBadges:: flag_array NUM_BADGES wObtainedBadges:: flag_array NUM_BADGES
ds 1
; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if ; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if
; the delay has been disabled entirely through bit 1 of this variable ; the delay has been disabled entirely through bit 1 of this variable
; or bit 6 of wd730. ; or bit 6 of wd730.
@ -1854,8 +1852,13 @@ wSpriteSetID:: db
wObjectDataPointerTemp:: dw wObjectDataPointerTemp:: dw
; Used on the new status screen
wDVCalcVar1::
ds 2 ds 2
wDVCalcVar2::
ds 4
; the tile shown outside the boundaries of the map ; the tile shown outside the boundaries of the map
wMapBackgroundTile:: db wMapBackgroundTile:: db
@ -1871,7 +1874,7 @@ wDestinationWarpID:: db
;;;;;;;;;; note: CHANGED: this empty space is now used for bigger bag space - TY Vortiene ;;;;;;;;;; note: CHANGED: this empty space is now used for bigger bag space - TY Vortiene
UNION UNION
; original size of this empty space ; original size of this empty space
ds 128 ds 124
NEXTU NEXTU
wNumBagItems:: db wNumBagItems:: db