shithub: pokered

Download patch

ref: d59dfadf66926ea0c7b5f8bbeaa9b83ee7bb3cb5
parent: 3de9d14d3e1ed14b880c0064a6141d9d9ca9b828
author: yenatch <yenatch@gmail.com>
date: Wed Sep 17 17:15:11 EDT 2014

Add macros for text predefs.

--- a/home.asm
+++ b/home.asm
@@ -4656,69 +4656,69 @@
 	ret
 
 TextPredefs::
-	dw CardKeySuccessText                   ; 01
-	dw CardKeyFailText                      ; 02
-	dw RedBedroomPC                         ; 03
-	dw RedBedroomSNESText                   ; 04
-	dw PushStartText                        ; 05
-	dw SaveOptionText                       ; 06
-	dw StrengthsAndWeaknessesText           ; 07
-	dw OakLabEmailText                      ; 08
-	dw AerodactylFossilText                 ; 09
-	dw Route15UpstairsBinocularsText        ; 0A
-	dw KabutopsFossilText                   ; 0B
-	dw GymStatueText1                       ; 0C
-	dw GymStatueText2                       ; 0D
-	dw BookcaseText                         ; 0E
-	dw ViridianCityPokecenterBenchGuyText   ; 0F
-	dw PewterCityPokecenterBenchGuyText     ; 10
-	dw CeruleanCityPokecenterBenchGuyText   ; 11
-	dw LavenderCityPokecenterBenchGuyText   ; 12
-	dw VermilionCityPokecenterBenchGuyText  ; 13
-	dw CeladonCityPokecenterBenchGuyText    ; 14
-	dw CeladonCityHotelText                 ; 15
-	dw FuchsiaCityPokecenterBenchGuyText    ; 16
-	dw CinnabarIslandPokecenterBenchGuyText ; 17
-	dw SaffronCityPokecenterBenchGuyText    ; 18
-	dw MtMoonPokecenterBenchGuyText         ; 19
-	dw RockTunnelPokecenterBenchGuyText     ; 1A
-	dw UnusedBenchGuyText1                  ; 1B
-	dw UnusedBenchGuyText2                  ; 1C
-	dw UnusedBenchGuyText3                  ; 1D
-	dw TerminatorText_62508                 ; 1E
-	dw PredefText1f                         ; 1F
-	dw ViridianSchoolNotebook               ; 20
-	dw ViridianSchoolBlackboard             ; 21
-	dw JustAMomentText                      ; 22
-	dw PredefText23                         ; 23
-	dw FoundHiddenItemText                  ; 24
-	dw HiddenItemBagFullText                ; 25
-	dw VermilionGymTrashText                ; 26
-	dw IndigoPlateauHQText                  ; 27
-	dw GameCornerOutOfOrderText             ; 28
-	dw GameCornerOutToLunchText             ; 29
-	dw GameCornerSomeonesKeysText           ; 2A
-	dw FoundHiddenCoinsText                 ; 2B
-	dw DroppedHiddenCoinsText               ; 2C
-	dw BillsHouseMonitorText                ; 2D
-	dw BillsHouseInitiatedText              ; 2E
-	dw BillsHousePokemonList                ; 2F
-	dw MagazinesText                        ; 30
-	dw CinnabarGymQuiz                      ; 31
-	dw GameCornerNoCoinsText                ; 32
-	dw GameCornerCoinCaseText               ; 33
-	dw LinkCableHelp                        ; 34
-	dw TMNotebook                           ; 35
-	dw FightingDojoText                     ; 36
-	dw FightingDojoText_52a10               ; 37
-	dw FightingDojoText_52a1d               ; 38
-	dw NewBicycleText                       ; 39
-	dw IndigoPlateauStatues                 ; 3A
-	dw VermilionGymTrashSuccesText1         ; 3B
-	dw VermilionGymTrashSuccesText2         ; 3C
-	dw VermilionGymTrashSuccesText3         ; 3D
-	dw VermilionGymTrashFailText            ; 3E
-	dw TownMapText                          ; 3F
-	dw BookOrSculptureText                  ; 40
-	dw ElevatorText                         ; 41
-	dw PokemonStuffText                     ; 42
+	add_tx_pre CardKeySuccessText                   ; 01
+	add_tx_pre CardKeyFailText                      ; 02
+	add_tx_pre RedBedroomPC                         ; 03
+	add_tx_pre RedBedroomSNESText                   ; 04
+	add_tx_pre PushStartText                        ; 05
+	add_tx_pre SaveOptionText                       ; 06
+	add_tx_pre StrengthsAndWeaknessesText           ; 07
+	add_tx_pre OakLabEmailText                      ; 08
+	add_tx_pre AerodactylFossilText                 ; 09
+	add_tx_pre Route15UpstairsBinocularsText        ; 0A
+	add_tx_pre KabutopsFossilText                   ; 0B
+	add_tx_pre GymStatueText1                       ; 0C
+	add_tx_pre GymStatueText2                       ; 0D
+	add_tx_pre BookcaseText                         ; 0E
+	add_tx_pre ViridianCityPokecenterBenchGuyText   ; 0F
+	add_tx_pre PewterCityPokecenterBenchGuyText     ; 10
+	add_tx_pre CeruleanCityPokecenterBenchGuyText   ; 11
+	add_tx_pre LavenderCityPokecenterBenchGuyText   ; 12
+	add_tx_pre VermilionCityPokecenterBenchGuyText  ; 13
+	add_tx_pre CeladonCityPokecenterBenchGuyText    ; 14
+	add_tx_pre CeladonCityHotelText                 ; 15
+	add_tx_pre FuchsiaCityPokecenterBenchGuyText    ; 16
+	add_tx_pre CinnabarIslandPokecenterBenchGuyText ; 17
+	add_tx_pre SaffronCityPokecenterBenchGuyText    ; 18
+	add_tx_pre MtMoonPokecenterBenchGuyText         ; 19
+	add_tx_pre RockTunnelPokecenterBenchGuyText     ; 1A
+	add_tx_pre UnusedBenchGuyText1                  ; 1B
+	add_tx_pre UnusedBenchGuyText2                  ; 1C
+	add_tx_pre UnusedBenchGuyText3                  ; 1D
+	add_tx_pre TerminatorText_62508                 ; 1E
+	add_tx_pre PredefText1f                         ; 1F
+	add_tx_pre ViridianSchoolNotebook               ; 20
+	add_tx_pre ViridianSchoolBlackboard             ; 21
+	add_tx_pre JustAMomentText                      ; 22
+	add_tx_pre PredefText23                         ; 23
+	add_tx_pre FoundHiddenItemText                  ; 24
+	add_tx_pre HiddenItemBagFullText                ; 25
+	add_tx_pre VermilionGymTrashText                ; 26
+	add_tx_pre IndigoPlateauHQText                  ; 27
+	add_tx_pre GameCornerOutOfOrderText             ; 28
+	add_tx_pre GameCornerOutToLunchText             ; 29
+	add_tx_pre GameCornerSomeonesKeysText           ; 2A
+	add_tx_pre FoundHiddenCoinsText                 ; 2B
+	add_tx_pre DroppedHiddenCoinsText               ; 2C
+	add_tx_pre BillsHouseMonitorText                ; 2D
+	add_tx_pre BillsHouseInitiatedText              ; 2E
+	add_tx_pre BillsHousePokemonList                ; 2F
+	add_tx_pre MagazinesText                        ; 30
+	add_tx_pre CinnabarGymQuiz                      ; 31
+	add_tx_pre GameCornerNoCoinsText                ; 32
+	add_tx_pre GameCornerCoinCaseText               ; 33
+	add_tx_pre LinkCableHelp                        ; 34
+	add_tx_pre TMNotebook                           ; 35
+	add_tx_pre FightingDojoText                     ; 36
+	add_tx_pre FightingDojoText_52a10               ; 37
+	add_tx_pre FightingDojoText_52a1d               ; 38
+	add_tx_pre NewBicycleText                       ; 39
+	add_tx_pre IndigoPlateauStatues                 ; 3A
+	add_tx_pre VermilionGymTrashSuccesText1         ; 3B
+	add_tx_pre VermilionGymTrashSuccesText2         ; 3C
+	add_tx_pre VermilionGymTrashSuccesText3         ; 3D
+	add_tx_pre VermilionGymTrashFailText            ; 3E
+	add_tx_pre TownMapText                          ; 3F
+	add_tx_pre BookOrSculptureText                  ; 40
+	add_tx_pre ElevatorText                         ; 41
+	add_tx_pre PokemonStuffText                     ; 42
--- a/macros.asm
+++ b/macros.asm
@@ -203,6 +203,24 @@
 	ENDM
 
 
+add_tx_pre: MACRO
+\1_id:: dw \1
+ENDM
+
+tx_pre_id: MACRO
+	ld a, (\1_id - TextPredefs) / 2
+ENDM
+
+tx_pre: MACRO
+	tx_pre_id \1
+	call PrintPredefTextID
+ENDM
+
+tx_pre_jump: MACRO
+	tx_pre_id \1
+	jp PrintPredefTextID
+ENDM
+
 
 ;1_channel	EQU $00
 ;2_channels	EQU $40