shithub: pokered

Download patch

ref: d8dae96f35222ababb9688ce2aed3292515f8ca2
parent: 8b3f9b244d72169e04a617eba0b36cae002b31a5
author: pikalaxalt <PikalaxALT@gmail.com>
date: Thu Jun 9 17:20:02 EDT 2016

Implement handy text macros from yellow

--- a/engine/hidden_object_functions17.asm
+++ b/engine/hidden_object_functions17.asm
@@ -11,7 +11,7 @@
 	tx_pre_jump RedBedroomPCText
 
 RedBedroomPCText: ; 5db8e (17:5b8e)
-	db $fc ; FuncTX_ItemStoragePC
+	TX_PLAYERS_PC
 
 Route15GateLeftBinoculars: ; 5db8f (17:5b8f)
 	ld a, [wSpriteStateData1 + 9]
--- a/engine/hidden_object_functions18.asm
+++ b/engine/hidden_object_functions18.asm
@@ -195,4 +195,4 @@
 	tx_pre_jump PokemonCenterPCText
 
 PokemonCenterPCText: ; 62529 (18:6529)
-	db $F9 ; FuncTX_PokemonCenterPC
+	TX_POKECENTER_PC
--- a/macros.asm
+++ b/macros.asm
@@ -205,15 +205,13 @@
 	ENDM
 
 TX_BCD: MACRO
+; \1: RAM address to read from
+; \2: number of bytes + print flags
 	db $2
 	dw \1
 	db \2
 	ENDM
 
-TX_ASM: MACRO
-	db $08
-	ENDM
-
 TX_MART: MACRO
 	db $FE, _NARG
 	rept _NARG
@@ -223,6 +221,22 @@
 	db $FF
 	ENDM
 
+TX_LINE EQUS "db $05"
+TX_BUTTON_SOUND EQUS "db $06"
+TX_ASM EQUS "db $08"
+TX_SFX_ITEM EQUS "db $0b"
+TX_WAIT_BUTTON EQUS "db $0d"
+TX_SFX_CONGRATS EQUS "db $10"
+TX_SFX_KEY_ITEM EQUS "db $11"
+
+TX_VENDING_MACHINE         EQUS "db $f5"
+TX_CABLE_CLUB_RECEPTIONIST EQUS "db $f6"
+TX_PRIZE_VENDOR            EQUS "db $f7"
+TX_POKECENTER_PC           EQUS "db $f9"
+TX_PLAYERS_PC              EQUS "db $fc"
+TX_BILLS_PC                EQUS "db $fd"
+TX_POKECENTER_NURSE        EQUS "db $ff"
+
 ; Predef macro.
 add_predef: MACRO
 \1Predef::
@@ -263,14 +277,6 @@
 	jp PrintPredefTextID
 ENDM
 
-TX_SFX_KEY_ITEM: macro
-	db $11
-endm
-
-TX_CONGRATSSFX: macro
-	db $10
-endm
-
 WALK EQU $FE
 STAY EQU $FF
 
@@ -309,6 +315,10 @@
 	ENDC
 ENDM
 
+StopAllMusic: macro
+	ld a, $ff
+	call PlaySound
+	endm
 
 ;1_channel	EQU $00
 ;2_channels	EQU $40
--- a/scripts/billshouse.asm
+++ b/scripts/billshouse.asm
@@ -122,7 +122,7 @@
 	dw BillsHouseText4
 
 BillsHouseText4: ; 1e83c (7:683c)
-	db $fd
+	TX_BILLS_PC
 
 BillsHouseText1: ; 1e83d (7:683d)
 	TX_ASM
@@ -191,7 +191,9 @@
 
 SSTicketReceivedText: ; 1e8bf (7:68bf)
 	TX_FAR _SSTicketReceivedText
-	db $11, $6, "@"
+	TX_SFX_KEY_ITEM
+	TX_BUTTON_SOUND
+	db "@"
 
 SSTicketNoRoomText: ; 1e8c6 (7:68c6)
 	TX_FAR _SSTicketNoRoomText
--- a/scripts/celadongamecorner.asm
+++ b/scripts/celadongamecorner.asm
@@ -267,7 +267,8 @@
 
 Received10CoinsText: ; 48da1 (12:4da1)
 	TX_FAR _Received10CoinsText
-	db $0B, "@"
+	TX_SFX_ITEM
+	db "@"
 
 CeladonGameCornerText_48da7: ; 48da7 (12:4da7)
 	TX_FAR _CeladonGameCornerText_48da7
@@ -344,7 +345,8 @@
 
 Received20CoinsText: ; 48e2b (12:4e2b)
 	TX_FAR _Received20CoinsText
-	db $0B, "@"
+	TX_SFX_ITEM
+	db "@"
 
 CeladonGameCornerText_48e31: ; 48e31 (12:4e31)
 	TX_FAR _CeladonGameCornerText_48e31
@@ -395,7 +397,8 @@
 
 CeladonGameCornerText_48e8d: ; 48e8d (12:4e8d)
 	TX_FAR _CeladonGameCornerText_48e8d
-	db $0B, "@"
+	TX_SFX_ITEM
+	db "@"
 
 CeladonGameCornerText_48e93: ; 48e93 (12:4e93)
 	TX_FAR _CeladonGameCornerText_48e93
--- a/scripts/celadonmartroof.asm
+++ b/scripts/celadonmartroof.asm
@@ -139,48 +139,48 @@
 
 CeladonMartRoofText_484f3:
 	TX_FAR _CeladonMartRoofText_484f3
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 CeladonMartRoofText_484f9:
 	TX_FAR _CeladonMartRoofText_484f9
-	db $0b
+	TX_SFX_ITEM
 	TX_FAR _CeladonMartRoofText_484fe
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 CeladonMartRoofText_48504:
 	TX_FAR _CeladonMartRoofText_48504
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 CeladonMartRoofText_4850a:
 	TX_FAR _CeladonMartRoofText_4850a
-	db $0b
+	TX_SFX_ITEM
 	TX_FAR _CeladonMartRoofText_4850f
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 CeladonMartRoofText_48515:
 	TX_FAR _CeladonMartRoofText_48515
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 ReceivedTM49Text:
 	TX_FAR _ReceivedTM49Text
-	db $0b
+	TX_SFX_ITEM
 	TX_FAR _CeladonMartRoofText_48520
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 CeladonMartRoofText_48526:
 	TX_FAR _CeladonMartRoofText_48526
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 CeladonMartRoofText_4852c:
 	TX_FAR _CeladonMartRoofText_4852c
-	db $0d
+	TX_WAIT_BUTTON
 	db "@"
 
 CeladonMartRoofScript_PrintDrinksInBag:
@@ -248,7 +248,7 @@
 	db "@"
 
 CeladonMartRoofText5:
-	db $f5
+	TX_VENDING_MACHINE
 
 CeladonMartRoofText6:
 	TX_FAR _CeladonMartRoofText6
--- a/scripts/celadonpokecenter.asm
+++ b/scripts/celadonpokecenter.asm
@@ -9,10 +9,10 @@
 	dw CeladonTradeNurseText
 
 CeladonTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
 
 CeladonHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 CeladonPokecenterText2:
 	TX_FAR _CeladonPokecenterText2
--- a/scripts/celadonprizeroom.asm
+++ b/scripts/celadonprizeroom.asm
@@ -17,4 +17,4 @@
 	db "@"
 
 CeladonPrizeRoomText3: ; 49107 (12:5107)
-	db $f7
+	TX_PRIZE_VENDOR
--- a/scripts/ceruleanpokecenter.asm
+++ b/scripts/ceruleanpokecenter.asm
@@ -9,10 +9,10 @@
 	dw CeruleanTradeNurseText
 
 CeruleanTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
 
 CeruleanHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 CeruleanPokecenterText2:
 	TX_FAR _CeruleanPokecenterText2
--- a/scripts/cinnabarpokecenter.asm
+++ b/scripts/cinnabarpokecenter.asm
@@ -9,7 +9,7 @@
 	dw CinnabarTradeNurseText
 
 CinnabarHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 CinnabarPokecenterText2:
 	TX_FAR _CinnabarPokecenterText2
@@ -20,4 +20,4 @@
 	db "@"
 
 CinnabarTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
--- a/scripts/fuchsiapokecenter.asm
+++ b/scripts/fuchsiapokecenter.asm
@@ -9,7 +9,7 @@
 	dw FuchsiaTradeNurseText
 
 FuchsiaHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 FuchsiaPokecenterText2:
 	TX_FAR _FuchsiaPokecenterText1
@@ -20,4 +20,4 @@
 	db "@"
 
 FuchsiaTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
--- a/scripts/indigoplateaulobby.asm
+++ b/scripts/indigoplateaulobby.asm
@@ -22,7 +22,7 @@
 	dw IndigoTradeNurseText
 
 IndigoHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 IndigoPlateauLobbyText2:
 	TX_FAR _IndigoPlateauLobbyText2
@@ -33,4 +33,4 @@
 	db "@"
 
 IndigoTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
--- a/scripts/lavenderpokecenter.asm
+++ b/scripts/lavenderpokecenter.asm
@@ -9,10 +9,10 @@
 	dw LavenderTradeNurseText
 
 LavenderTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
 
 LavenderHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 LavenderPokecenterText2:
 	TX_FAR _LavenderPokecenterText2
--- a/scripts/pewterpokecenter.asm
+++ b/scripts/pewterpokecenter.asm
@@ -9,7 +9,7 @@
 	dw PewterTradeNurseText
 
 PewterHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 PewterPokecenterText2:
 	TX_FAR _PewterPokecenterText2
@@ -21,8 +21,7 @@
 	ld [wDoNotWaitForButtonPressAfterDisplayingText], a
 	ld hl, .Text
 	call PrintText
-	ld a, $ff
-	call PlaySound
+	StopAllMusic
 	ld c, 32
 	call DelayFrames
 	ld hl, JigglypuffFacingDirections
@@ -30,7 +29,7 @@
 	ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
 	call CopyData
 
-	ld a, [wSpriteStateData1 + 3 * $10 + $2]
+	ld a, [Sprite03SpriteImageIdx]
 	ld hl, wJigglypuffFacingDirections
 .findMatchingFacingDirectionLoop
 	cp [hl]
@@ -44,7 +43,7 @@
 	pop hl
 .loop
 	ld a, [hl]
-	ld [wSpriteStateData1 + 3 * $10 + $2], a
+	ld [Sprite03SpriteImageIdx], a
 
 ; rotate the array
 	push hl
@@ -82,4 +81,4 @@
 JigglypuffFacingDirectionsEnd:
 
 PewterTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
--- a/scripts/saffronpokecenter.asm
+++ b/scripts/saffronpokecenter.asm
@@ -9,7 +9,7 @@
 	dw SaffronTradeNurseText
 
 SaffronHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 SaffronPokecenterText2:
 	TX_FAR _SaffronPokecenterText2
@@ -20,4 +20,4 @@
 	db "@"
 
 SaffronTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
--- a/scripts/vermilionpokecenter.asm
+++ b/scripts/vermilionpokecenter.asm
@@ -9,7 +9,7 @@
 	dw VermilionTradeNurseText
 
 VermilionHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 VermilionPokecenterText2:
 	TX_FAR _VermilionPokecenterText2
@@ -20,4 +20,4 @@
 	db "@"
 
 VermilionTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST
--- a/scripts/viridianpokecenter.asm
+++ b/scripts/viridianpokecenter.asm
@@ -9,7 +9,7 @@
 	dw ViridianTradeNurseText
 
 ViridianHealNurseText:
-	db $ff
+	TX_POKECENTER_NURSE
 
 ViridianPokeCenterText2:
 	TX_FAR _ViridianPokeCenterText2
@@ -20,4 +20,4 @@
 	db "@"
 
 ViridianTradeNurseText:
-	db $f6
+	TX_CABLE_CLUB_RECEPTIONIST