Complete and improve debug name labels (#408)

This commit is contained in:
SatoMew 2023-02-26 16:14:21 +00:00 committed by GitHub
parent e076ee0a40
commit 5c4795d5bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 18 deletions

View file

@ -2,12 +2,14 @@ DebugMenu:
IF DEF(_DEBUG) IF DEF(_DEBUG)
call ClearScreen call ClearScreen
ld hl, DebugPlayerName ; These debug names are used for TestBattle.
; StartNewGameDebug uses the debug names from PrepareOakSpeech.
ld hl, DebugBattlePlayerName
ld de, wPlayerName ld de, wPlayerName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyData call CopyData
ld hl, DebugRivalName ld hl, DebugBattleRivalName
ld de, wRivalName ld de, wRivalName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyData call CopyData
@ -57,10 +59,10 @@ IF DEF(_DEBUG)
set 1, [hl] set 1, [hl]
jp StartNewGameDebug jp StartNewGameDebug
DebugPlayerName: DebugBattlePlayerName:
db "Tom@" db "Tom@"
DebugRivalName: DebugBattleRivalName:
db "Juerry@" db "Juerry@"
DebugMenuOptions: DebugMenuOptions:

View file

@ -309,6 +309,7 @@ LinkCanceledText:
StartNewGame: StartNewGame:
ld hl, wd732 ld hl, wd732
res 1, [hl] res 1, [hl]
; fallthrough
StartNewGameDebug: StartNewGameDebug:
call OakSpeech call OakSpeech
ld c, 20 ld c, 20

View file

@ -1,4 +1,4 @@
SetDefaultNames: PrepareOakSpeech:
ld a, [wLetterPrintingDelayFlags] ld a, [wLetterPrintingDelayFlags]
push af push af
ld a, [wOptions] ld a, [wOptions]
@ -22,11 +22,13 @@ SetDefaultNames:
ld a, [wOptionsInitialized] ld a, [wOptionsInitialized]
and a and a
call z, InitOptions call z, InitOptions
ld hl, NintenText ; These debug names are used for StartNewGameDebug.
; TestBattle uses the debug names from DebugMenu.
ld hl, DebugNewGamePlayerName
ld de, wPlayerName ld de, wPlayerName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyData call CopyData
ld hl, SonyText ld hl, DebugNewGameRivalName
ld de, wRivalName ld de, wRivalName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
jp CopyData jp CopyData
@ -40,7 +42,7 @@ OakSpeech:
call PlayMusic call PlayMusic
call ClearScreen call ClearScreen
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
call SetDefaultNames call PrepareOakSpeech
predef InitPlayerData2 predef InitPlayerData2
ld hl, wNumBoxItems ld hl, wNumBoxItems
ld a, POTION ld a, POTION

View file

@ -1,15 +1,17 @@
; copy text of fixed length NAME_LENGTH (like player name, rival name, mon names, ...) CopyDebugName:
CopyFixedLengthText:
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
jp CopyData jp CopyData
SetDefaultNamesBeforeTitlescreen:: PrepareTitleScreen::
ld hl, NintenText ; These debug names are already copied later in PrepareOakSpeech.
; Removing the unused copies below has no apparent impact.
; CopyDebugName can also be safely deleted afterwards.
ld hl, DebugNewGamePlayerName
ld de, wPlayerName ld de, wPlayerName
call CopyFixedLengthText call CopyDebugName
ld hl, SonyText ld hl, DebugNewGameRivalName
ld de, wRivalName ld de, wRivalName
call CopyFixedLengthText call CopyDebugName
xor a xor a
ldh [hWY], a ldh [hWY], a
ld [wLetterPrintingDelayFlags], a ld [wLetterPrintingDelayFlags], a
@ -405,5 +407,8 @@ IF DEF(_BLUE)
db $61,$62,$63,$64,$65,$66,$67,$68,"@" ; "Blue Version" db $61,$62,$63,$64,$65,$66,$67,$68,"@" ; "Blue Version"
ENDC ENDC
NintenText: db "NINTEN@" DebugNewGamePlayerName:
SonyText: db "SONY@" db "NINTEN@"
DebugNewGameRivalName:
db "SONY@"

View file

@ -116,7 +116,7 @@ DEF rLCDC_DEFAULT EQU %11100011
ld a, rLCDC_DEFAULT ld a, rLCDC_DEFAULT
ldh [rLCDC], a ldh [rLCDC], a
jp SetDefaultNamesBeforeTitlescreen jp PrepareTitleScreen
ClearVram:: ClearVram::
ld hl, VRAM_Begin ld hl, VRAM_Begin