Separate constants for name types and naming screen types

This commit is contained in:
Rangi42
2025-03-12 12:26:21 -04:00
parent 3e2121b21a
commit 15ae47a61e
4 changed files with 14 additions and 9 deletions

View File

@@ -126,4 +126,4 @@ DEF NUM_PARTYMENUACTIONS EQU const_value
const NAME_FRIEND const NAME_FRIEND
const NAME_6 ; duplicate of NAME_MON const NAME_6 ; duplicate of NAME_MON
const NAME_7 ; duplicate of NAME_MON const NAME_7 ; duplicate of NAME_MON
DEF NUM_NAME_TYPES EQU const_value DEF NUM_NAMING_SCREEN_TYPES EQU const_value

View File

@@ -18,6 +18,7 @@ DEF NAME_LENGTH_JAPANESE EQU 6
const ENEMY_OT_NAME ; 6 const ENEMY_OT_NAME ; 6
const TRAINER_NAME ; 7 const TRAINER_NAME ; 7
const MOVE_DESC_NAME_BROKEN ; 8 const MOVE_DESC_NAME_BROKEN ; 8
DEF NUM_NAME_TYPES EQU const_value - 1
; see home/text.asm ; see home/text.asm
DEF BORDER_WIDTH EQU 2 DEF BORDER_WIDTH EQU 2

View File

@@ -61,10 +61,10 @@ NamingScreen:
.GetNamingScreenSetup: .GetNamingScreenSetup:
ld a, [wNamingScreenType] ld a, [wNamingScreenType]
maskbits NUM_NAME_TYPES maskbits NUM_NAMING_SCREEN_TYPES
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .Jumptable ld hl, NamingScreenJumptable
add hl, de add hl, de
add hl, de add hl, de
ld a, [hli] ld a, [hli]
@@ -72,16 +72,18 @@ NamingScreen:
ld l, a ld l, a
jp hl jp hl
.Jumptable: NamingScreenJumptable:
; entries correspond to NAME_* constants ; entries correspond to NAME_* constants (see constants/menu_constants.asm)
table_width 2
dw .Pokemon dw .Pokemon
dw .Player dw .Player
dw .Rival dw .Rival
dw .Mom dw .Mom
dw .Box dw .Box
dw .Tomodachi dw .Friend
dw .Pokemon dw .Pokemon
dw .Pokemon dw .Pokemon
assert_table_length NUM_NAMING_SCREEN_TYPES
.Pokemon: .Pokemon:
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
@@ -180,14 +182,14 @@ NamingScreen:
.BoxNameString: .BoxNameString:
db "BOX NAME?@" db "BOX NAME?@"
.Tomodachi: .Friend:
hlcoord 3, 2 hlcoord 3, 2
ld de, .oTomodachi_no_namae_sutoringu ld de, .FriendsNameString
call PlaceString call PlaceString
call .StoreSpriteIconParams call .StoreSpriteIconParams
ret ret
.oTomodachi_no_namae_sutoringu .FriendsNameString:
db "おともだち の なまえは?@" db "おともだち の なまえは?@"
.LoadSprite: .LoadSprite:

View File

@@ -1,5 +1,6 @@
NamesPointers:: NamesPointers::
; entries correspond to GetName constants (see constants/text_constants.asm) ; entries correspond to GetName constants (see constants/text_constants.asm)
table_width 3
dba PokemonNames ; MON_NAME (not used; jumps to GetPokemonName) dba PokemonNames ; MON_NAME (not used; jumps to GetPokemonName)
dba MoveNames ; MOVE_NAME dba MoveNames ; MOVE_NAME
dba NULL ; DUMMY_NAME dba NULL ; DUMMY_NAME
@@ -8,6 +9,7 @@ NamesPointers::
dbw 0, wOTPartyMonOTs ; ENEMY_OT_NAME dbw 0, wOTPartyMonOTs ; ENEMY_OT_NAME
dba TrainerClassNames ; TRAINER_NAME dba TrainerClassNames ; TRAINER_NAME
dbw 4, MoveDescriptions ; MOVE_DESC_NAME_BROKEN (wrong bank) dbw 4, MoveDescriptions ; MOVE_DESC_NAME_BROKEN (wrong bank)
assert_table_length NUM_NAME_TYPES
GetName:: GetName::
; Return name wCurSpecies from name list wNamedObjectType in wStringBuffer1. ; Return name wCurSpecies from name list wNamedObjectType in wStringBuffer1.