shithub: pokecrystal

Download patch

ref: f3c8f7520975cbfca8be57b0adb855bf42368d83
parent: d972564175bcee324877f1e016fafd349c50e7d3
author: PikalaxALT <[email protected]>
date: Mon Nov 23 16:19:53 EST 2015

bug contest judgint labels

--- a/engine/npctrade.asm
+++ b/engine/npctrade.asm
@@ -519,7 +519,7 @@
 	ret
 
 .done
-	; sound0x0A
+	; sound_dex_fanfare_80_109
 	; interpret_data
 	text_jump UnknownText_0x1bd445
 	db "@"
--- a/event/bug_contest_judging.asm
+++ b/event/bug_contest_judging.asm
@@ -2,24 +2,24 @@
 	call ContestScore
 	callba MobileFn_105f79
 	call Function13819
-	ld a, [wd00a]
+	ld a, [wBugContestThirdPlacePersonID]
 	call LoadContestantName
-	ld a, [wd00b]
-	ld [wd265], a
+	ld a, [wBugContestThirdPlaceMon]
+	ld [wNamedObjectIndexBuffer], a
 	call GetPokemonName
 	ld hl, BugContest_ThirdPlaceText
 	call PrintText
-	ld a, [EndFlypoint]
+	ld a, [wBugContestSecondPlacePersonID]
 	call LoadContestantName
-	ld a, [MovementBuffer]
-	ld [wd265], a
+	ld a, [wBugContestSecondPlaceMon]
+	ld [wNamedObjectIndexBuffer], a
 	call GetPokemonName
 	ld hl, BugContest_SecondPlaceText
 	call PrintText
-	ld a, [wd002]
+	ld a, [wBugContestFirstPlacePersonID]
 	call LoadContestantName
-	ld a, [wd003]
-	ld [wd265], a
+	ld a, [wBugContestFirstPlaceMon]
+	ld [wNamedObjectIndexBuffer], a
 	call GetPokemonName
 	ld hl, BugContest_FirstPlaceText
 	call PrintText
@@ -85,7 +85,7 @@
 
 ; If a = 0, get your name.
 	dec a
-	jr z, .done
+	jr z, .player
 ; Find the pointer for the trainer class of the Bug Catching Contestant whose ID is in a.
 	ld c, a
 	ld b, 0
@@ -102,13 +102,13 @@
 ; Save hl and bc for later.
 	push hl
 	push bc
-; Get the Trainer Class name and copy it into wd016.
+; Get the Trainer Class name and copy it into wBugContestWinnerName.
 	callab GetTrainerClassName
 	ld hl, StringBuffer1
-	ld de, wd016
+	ld de, wBugContestWinnerName
 	ld bc, TRAINER_CLASS_NAME_LENGTH
 	call CopyBytes
-	ld hl, wd016
+	ld hl, wBugContestWinnerName
 ; Delete the trailing terminator and replace it with a space.
 .next
 	ld a, [hli]
@@ -127,15 +127,15 @@
 	ld a, [hl]
 	ld b, a
 	callab GetTrainerName
-; Append the name to wd016.
+; Append the name to wBugContestWinnerName.
 	ld hl, StringBuffer1
 	pop de
 	ld bc, NAME_LENGTH - 1
 	jp CopyBytes
 
-.done
+.player
 	ld hl, PlayerName
-	ld de, wd016
+	ld de, wBugContestWinnerName
 	ld bc, NAME_LENGTH
 	jp CopyBytes
 ; 13783
@@ -216,7 +216,7 @@
 ; 13807
 
 Function13807: ; 13807
-	ld hl, wd00a
+	ld hl, wBugContestThirdPlacePersonID
 	ld de, -4
 	ld b, 3
 .loop
@@ -232,9 +232,9 @@
 ; 13819
 
 Function13819: ; 13819
-	call Function13833
-	call Function138b0
-	ld hl, wd00e
+	call ClearContestResults
+	call ComputeAIContestantScores
+	ld hl, wBugContestTempPersonID
 	ld a, 1
 	ld [hli], a
 	ld a, [wContestMon]
@@ -243,12 +243,12 @@
 	ld [hli], a
 	ld a, [hMultiplicand]
 	ld [hl], a
-	call Function1383e
+	call DetermineContestWinners
 	ret
 ; 13833
 
-Function13833: ; 13833
-	ld hl, wd002
+ClearContestResults: ; 13833
+	ld hl, wBugContestFirstPlacePersonID
 	ld b, 12
 	xor a
 .loop
@@ -258,69 +258,66 @@
 	ret
 ; 1383e
 
-Function1383e: ; 1383e
-	ld de, wd010
-	ld hl, wd004
+DetermineContestWinners: ; 1383e
+	ld de, wBugContestTempScore
+	ld hl, wBugContestFirstPlaceScore
 	ld c, 2
 	call StringCmp
-	jr c, .next
-	ld hl, EndFlypoint
-	ld de, wd00a
+	jr c, .not_first_place
+	ld hl, wBugContestSecondPlacePersonID
+	ld de, wBugContestThirdPlacePersonID
 	ld bc, 4
 	call CopyBytes
-	ld hl, wd002
-	ld de, EndFlypoint
+	ld hl, wBugContestFirstPlacePersonID
+	ld de, wBugContestSecondPlacePersonID
 	ld bc, 4
 	call CopyBytes
-	ld hl, wd002
-	call Function138a0
+	ld hl, wBugContestFirstPlacePersonID
+	call CopyTempContestant
 	jr .done
 
-.next
-	ld de, wd010
-	ld hl, wd008
+.not_first_place
+	ld de, wBugContestTempScore
+	ld hl, wBugContestSecondPlaceScore
 	ld c, 2
 	call StringCmp
-	jr c, .next2
-	ld hl, EndFlypoint
-	ld de, wd00a
+	jr c, .not_second_place
+	ld hl, wBugContestSecondPlacePersonID
+	ld de, wBugContestThirdPlacePersonID
 	ld bc, 4
 	call CopyBytes
-	ld hl, EndFlypoint
-	call Function138a0
+	ld hl, wBugContestSecondPlacePersonID
+	call CopyTempContestant
 	jr .done
 
-.next2
-	ld de, wd010
-	ld hl, wd00c
+.not_second_place
+	ld de, wBugContestTempScore
+	ld hl, wBugContestThirdPlaceScore
 	ld c, 2
 	call StringCmp
 	jr c, .done
-	ld hl, wd00a
-	call Function138a0
+	ld hl, wBugContestThirdPlacePersonID
+	call CopyTempContestant
 
 .done
 	ret
 ; 138a0
 
-Function138a0: ; 138a0
-	ld de, wd00e
+CopyTempContestant: ; 138a0
+; Could've just called CopyBytes.
+	ld de, wBugContestTempPersonID
+rept 3
 	ld a, [de]
 	inc de
 	ld [hli], a
+endr
 	ld a, [de]
 	inc de
-	ld [hli], a
-	ld a, [de]
-	inc de
-	ld [hli], a
-	ld a, [de]
-	inc de
 	ld [hl], a
 	ret
 ; 138b0
 
-Function138b0: ; 138b0
+ComputeAIContestantScores: ; 138b0
 	ld e, 0
 .loop
 	push de
@@ -331,7 +328,7 @@
 rept 2
 	inc a
 endr
-	ld [wd00e], a
+	ld [wBugContestTempPersonID], a
 	dec a
 	ld c, a
 	ld b, 0
@@ -356,7 +353,7 @@
 	add hl, bc
 endr
 	ld a, [hli]
-	ld [wd00f], a
+	ld [wBugContestTempMon], a
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
@@ -366,11 +363,11 @@
 	ld b, 0
 	add hl, bc
 	ld a, h
-	ld [wd010], a
+	ld [wBugContestTempScore], a
 	ld a, l
-	ld [wd011], a
+	ld [wBugContestTempScore + 1], a
 	push de
-	call Function1383e
+	call DetermineContestWinners
 	pop de
 
 .done
--- a/macros/text.asm
+++ b/macros/text.asm
@@ -73,7 +73,7 @@
 	endm
 
 	enum TX_SOUND_0B
-sound0: macro
+sound_dex_fanfare_50_79: macro
 	db TX_SOUND_0B
 	endm
 
@@ -89,33 +89,33 @@
 	endm
 
 	enum TX_SOUND_0E
-sound1: macro
+sound_dex_fanfare_20_49: macro
 	db TX_SOUND_0E
 	endm
 
 	enum TX_SOUND_0F
-sound0x0F: macro
+sound_item: macro
 	db TX_SOUND_0F
 	endm
 
 	enum TX_SOUND_10
-sound0x02: macro
+sound_caught_mon: macro
 	db TX_SOUND_10
 	endm
 
 	enum TX_SOUND_11
-sound0x0A: macro
+sound_dex_fanfare_80_109: macro
 	db TX_SOUND_11
 	endm
 
 	enum TX_SOUND_12
-sound0x12: macro
+sound_fanfare: macro
 	db TX_SOUND_12
 	endm
 
 	enum TX_SOUND_13
-sound0x2C: macro
-	db $13
+sound_slot_machine_start: macro
+	db TX_SOUND_13
 	endm
 
 	enum TX_STRINGBUFFER
--- a/maps/BattleTower1F.asm
+++ b/maps/BattleTower1F.asm
@@ -525,7 +525,7 @@
 	line "@"
 	text_from_ram StringBuffer4
 	text "!@"
-	sound0x0F
+	sound_item
 	text_waitbutton
 	db "@"
 
--- a/text/battle.asm
+++ b/text/battle.asm
@@ -396,7 +396,7 @@
 	line "level @"
 	deciram CurPartyLevel, 1, 3
 	text "!@"
-	sound0
+	sound_dex_fanfare_50_79
 	db "@"
 ; 0x80cb9
 
--- a/text/common_2.asm
+++ b/text/common_2.asm
@@ -108,7 +108,7 @@
 	line "level @"
 	deciram CurPartyLevel, 1, 3
 	text "!@"
-	sound0
+	sound_dex_fanfare_50_79
 	text_waitbutton
 	db "@"
 ; 0x1bc16d
@@ -1575,7 +1575,7 @@
 	line "@"
 	text_from_ram StringBuffer1
 	text "!@"
-	sound0x0F
+	sound_item
 	text_waitbutton
 	db "@"
 ; 0x1bd3d6
@@ -1613,7 +1613,7 @@
 ; 0x1bd445
 
 UnknownText_0x1bd445: ; 0x1bd445
-	sound0x0A
+	sound_dex_fanfare_80_109
 	interpret_data
 	db "@"
 ; 0x1bd448
--- a/text/common_3.asm
+++ b/text/common_3.asm
@@ -931,7 +931,7 @@
 	text_from_ram StringBuffer1
 	text " came"
 	line "out of its EGG!@"
-	sound0x02
+	sound_caught_mon
 	text_waitbutton
 	db "@"
 ; 1c0dd7
@@ -1145,7 +1145,7 @@
 	interpret_data
 	text "…"
 	para "@"
-	text_from_ram wd016
+	text_from_ram wBugContestWinnerName
 	text ","
 	line "who caught a"
 	cont "@"
@@ -1158,7 +1158,7 @@
 	text ""
 	para "The winning score"
 	line "was @"
-	deciram wd004, 2, 3
+	deciram wBugContestFirstPlaceScore, 2, 3
 	text " points!"
 	prompt
 ; 1c1166
@@ -1166,7 +1166,7 @@
 ContestJudging_SecondPlaceText: ; 1c1166
 	text "Placing second was"
 	line "@"
-	text_from_ram wd016
+	text_from_ram wBugContestWinnerName
 	text ","
 	para "who caught a"
 	line "@"
@@ -1179,7 +1179,7 @@
 	text ""
 	para "The score was"
 	line "@"
-	deciram wd008, 2, 3
+	deciram wBugContestSecondPlaceScore, 2, 3
 	text " points!"
 	prompt
 ; 1c11b5
@@ -1187,7 +1187,7 @@
 ContestJudging_ThirdPlaceText: ; 1c11b5
 	text "Placing third was"
 	line "@"
-	text_from_ram wd016
+	text_from_ram wBugContestWinnerName
 	text ","
 	para "who caught a"
 	line "@"
@@ -1200,7 +1200,7 @@
 	text ""
 	para "The score was"
 	line "@"
-	deciram wd00c, 2, 3
+	deciram wBugContestThirdPlaceScore, 2, 3
 	text " points!"
 	prompt
 ; 1c1203
@@ -1641,7 +1641,7 @@
 
 UnknownText_0x1c1b2c: ; 1c1b2c
 	text "Took @"
-	text_from_ram wd050
+	text_from_ram wd050_MonNick
 	text "'s"
 	line "@"
 	text_from_ram StringBuffer1
@@ -1656,7 +1656,7 @@
 
 UnknownText_0x1c1b57: ; 1c1b57
 	text "Made @"
-	text_from_ram wd050
+	text_from_ram wd050_MonNick
 	text ""
 	line "hold @"
 	text_from_ram StringBuffer2
@@ -1671,7 +1671,7 @@
 ; 1c1b8e
 
 UnknownText_0x1c1b8e: ; 1c1b8e
-	text_from_ram wd050
+	text_from_ram wd050_MonNick
 	text " isn't"
 	line "holding anything."
 	prompt
@@ -1688,13 +1688,13 @@
 	text_from_ram StringBuffer1
 	text ""
 	line "from @"
-	text_from_ram wd050
+	text_from_ram wd050_MonNick
 	text "."
 	prompt
 ; 1c1bdc
 
 UnknownText_0x1c1bdc: ; 1c1bdc
-	text_from_ram wd050
+	text_from_ram wd050_MonNick
 	text " is"
 	line "already holding"
 
--- a/text/common_4.asm
+++ b/text/common_4.asm
@@ -338,10 +338,10 @@
 UnknownText_0x1c47d4: ; 0x1c47d4
 	text "Hm… I see you met"
 	line "@"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text " here:"
 	cont "@"
-	text_from_ram wd00e
+	text_from_ram wSeerCaughtLocation
 	text "!"
 	prompt
 ; 0x1c47fa
@@ -349,11 +349,11 @@
 UnknownText_0x1c47fa: ; 0x1c47fa
 	text "The time was"
 	line "@"
-	text_from_ram wd01f
+	text_from_ram wSeerTimeOfDay
 	text "!"
 
 	para "Its level was @"
-	text_from_ram wd036
+	text_from_ram wSeerCaughtLevelString
 	text "!"
 
 	para "Am I good or what?"
@@ -362,21 +362,21 @@
 
 UnknownText_0x1c4837: ; 0x1c4837
 	text "Hm… @"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text ""
 	line "came from @"
-	text_from_ram wd02a
+	text_from_ram wSeerOTName
 	text ""
 	cont "in a trade?"
 
 	para "@"
-	text_from_ram wd00e
+	text_from_ram wSeerCaughtLocation
 	text ""
 	line "was where @"
-	text_from_ram wd02a
+	text_from_ram wSeerOTName
 	text ""
 	cont "met @"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text "!"
 	prompt
 ; 0x1c487f
@@ -393,7 +393,7 @@
 	para "I can't tell where"
 	line "you met it, but it"
 	cont "was at level @"
-	text_from_ram wd036
+	text_from_ram wSeerCaughtLevelString
 	text "."
 
 	para "Am I good or what?"
@@ -434,7 +434,7 @@
 	line "grown a little."
 
 	para "@"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text " seems"
 	line "to be becoming"
 	cont "more confident."
@@ -445,7 +445,7 @@
 	text "Incidentally…"
 
 	para "@"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text " has"
 	line "grown. It's gained"
 	cont "much strength."
@@ -459,7 +459,7 @@
 	line "grown mighty!"
 
 	para "This @"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text ""
 	line "must have come"
 
@@ -483,12 +483,12 @@
 	para "seen a #MON as"
 	line "mighty as this"
 	cont "@"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text "."
 
 	para "I'm sure that"
 	line "seeing @"
-	text_from_ram wd003
+	text_from_ram wSeerNickname
 	text ""
 	para "in battle would"
 	line "excite anyone."
@@ -859,13 +859,13 @@
 ; 0x1c51f4
 
 UnknownText_0x1c51f4: ; 0x1c51f4
-	text_from_ram wd006
+	text_from_ram wMobileParticipant1Nickname
 	text ","
 	line "@"
-	text_from_ram wd00c
+	text_from_ram wMobileParticipant2Nickname
 	text " and"
 	cont "@"
-	text_from_ram wd012
+	text_from_ram wMobileParticipant3Nickname
 	text "."
 
 	para "Use these three?"
@@ -989,7 +989,7 @@
 ; 0x1c5588
 
 UnknownText_0x1c5588: ; 0x1c5588
-	text $56
+	text "<......>"
 	done
 ; 0x1c558b
 
@@ -1050,7 +1050,7 @@
 	line "@"
 	text_from_ram StringBuffer2
 	text "!@"
-	sound0
+	sound_dex_fanfare_50_79
 	text_waitbutton
 	db "@"
 ; 0x1c5677
@@ -1189,7 +1189,7 @@
 ; 0x1c5824
 
 UnknownText_0x1c5824: ; 0x1c5824
-	text $56
+	text "<......>"
 	done
 ; 0x1c5827
 
@@ -1367,7 +1367,7 @@
 	text_from_ram EnemyMonNick
 	text ""
 	line "was caught!@"
-	sound0x02
+	sound_caught_mon
 	db "@"
 ; 0x1c5b34
 
@@ -1396,7 +1396,7 @@
 	text "'s data"
 	line "was newly added to"
 	cont "the #DEX.@"
-	sound0x2C
+	sound_slot_machine_start
 	text_waitbutton
 	db "@"
 ; 0x1c5b7e
@@ -1514,7 +1514,7 @@
 UnknownText_0x1c5d03: ; 0x1c5d03
 	text "There was a trophy"
 	line "inside!@"
-	sound0
+	sound_dex_fanfare_50_79
 	text ""
 	para "@"
 	text_from_ram PlayerName
--- a/wram.asm
+++ b/wram.asm
@@ -1528,6 +1528,7 @@
 wCurrentRadioLine::
 wMovementBufferCount::
 wMartItem1BCD::
+wBugContestFirstPlacePersonID::
 	ds 1
 wd003::
 LuckyNumberDigit2Buffer::
@@ -1534,11 +1535,13 @@
 PhoneCallerLo::
 wNextRadioLine::
 wMovementBufferPerson::
+wBugContestFirstPlaceMon::
 	ds 1
 wd004::
 LuckyNumberDigit3Buffer::
 PhoneCallerHi::
 wRadioTextDelay::
+wBugContestFirstPlaceScore::
 	ds 1
 wd005::
 LuckyNumberDigit4Buffer::
@@ -1547,18 +1550,24 @@
 wMartItem2BCD::
 	ds 1
 wd006::
+wMobileParticipant1Nickname::
 LuckyNumberDigit5Buffer::
 EndFlypoint:: ; d006
 wOaksPkmnTalkSegmentCounter::
+wBugContestSecondPlacePersonID::
 	ds 1
 
 wd007::
 MovementBuffer:: ; d007
+wBugContestSecondPlaceMon::
 	ds 1
 
 wMartItem3BCD::
+wBugContestSecondPlaceScore::
 wd008:: ds 2
+wBugContestThirdPlacePersonID::
 wd00a:: ds 1
+wBugContestThirdPlaceMon::
 wMartItem4BCD::
 wd00b:: ds 1
 
@@ -1566,18 +1575,25 @@
 wRadioTextEnd::
 	ds wRadioText - @
 
+wMobileParticipant2Nickname::
+wBugContestThirdPlaceScore::
 wd00c:: ds 1
 wd00d:: ds 1
 wMartItem5BCD::
+wBugContestTempPersonID::
 wd00e:: ds 1
+wBugContestTempMon::
 wd00f:: ds 1
+wBugContestTempScore::
 wd010:: ds 1
 wMartItem6BCD::
 wd011:: ds 1
+wMobileParticipant3Nickname::
 wd012:: ds 1
 wd013:: ds 1
 wMartItem7BCD::
 wd014:: ds 2
+wBugContestWinnerName::
 wd016:: ds 1
 wMartItem8BCD::
 wd017:: ds 1