aboutsummaryrefslogtreecommitdiffstats
path: root/engine/events/prize_menu.asm
diff options
context:
space:
mode:
authorSylvie <35663410+Rangi42@users.noreply.github.com>2024-09-18 21:01:18 -0400
committerGitHub <noreply@github.com>2024-09-18 21:01:18 -0400
commit613d34678b7e9da1a467ec48fff23bfa75209871 (patch)
treec21669899a90df25aaac9b4b4d213ac525d6f277 /engine/events/prize_menu.asm
parentUse correct label in get_trainer_name.asm (#461) (diff)
downloadpokeyellow-613d34678b7e9da1a467ec48fff23bfa75209871.tar.gz
pokeyellow-613d34678b7e9da1a467ec48fff23bfa75209871.tar.xz
pokeyellow-613d34678b7e9da1a467ec48fff23bfa75209871.zip
Split `hSpriteIndexOrTextID` into `hSpriteIndex` and `hTextID` (#462)
Also identify `wPPUpCountAndMaxPP`
Diffstat (limited to 'engine/events/prize_menu.asm')
-rw-r--r--engine/events/prize_menu.asm21
1 files changed, 9 insertions, 12 deletions
diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm
index 4603b582..f99cdaaa 100644
--- a/engine/events/prize_menu.asm
+++ b/engine/events/prize_menu.asm
@@ -56,17 +56,14 @@ WhichPrizeTextPtr:
text_end
GetPrizeMenuId:
-; determine which one among the three
-; prize-texts has been selected
-; using the text ID (stored in [hSpriteIndexOrTextID])
-; load the three prizes at wd13d-wd13f
-; load the three prices at wd141-wd146
-; display the three prizes' names
-; (distinguishing between Pokemon names
-; and Items (specifically TMs) names)
- ldh a, [hSpriteIndexOrTextID]
- sub 3 ; prize-texts' id are 3, 4 and 5
- ld [wWhichPrizeWindow], a ; prize-texts' id (relative, i.e. 0, 1 or 2)
+; determine which one among the three prize texts has been selected using the text ID (stored in [hTextID])
+; prize texts' IDs are TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_1-TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_3
+; load the three prizes at wPrize1-wPrice3
+; load the three prices at wPrize1Price-wPrize3Price
+; display the three prizes' names, distinguishing between Pokemon names and item names (specifically TMs)
+ ldh a, [hTextID]
+ sub TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_1
+ ld [wWhichPrizeWindow], a ; prize texts' relative ID (i.e. 0-2)
add a
add a
ld d, 0
@@ -88,7 +85,7 @@ GetPrizeMenuId:
ld bc, 6
call CopyData
ld a, [wWhichPrizeWindow]
- cp 2 ;is TM_menu?
+ cp 2 ; is TM_menu?
jr nz, .putMonName
ld a, [wPrize1]
ld [wd11e], a