Create text speed constants

This commit is contained in:
Sha0den 2025-09-30 19:47:03 -04:00
parent f9d5c5b4a8
commit 49cd6b4998
4 changed files with 13 additions and 6 deletions

View File

@ -70,3 +70,10 @@ DEF NUM_CARDS_PROMOTIONAL EQU 20
const START_MENU_CONTINUE_DUEL ; 3
DEF NUM_MAILS EQU 15
; TextDelaySettings constants
DEF TEXT_SPEED_1 EQU 6
DEF TEXT_SPEED_2 EQU 4
DEF TEXT_SPEED_3 EQU 2
DEF TEXT_SPEED_4 EQU 1
DEF TEXT_SPEED_5 EQU 0

View File

@ -147,7 +147,7 @@ DuelAnimationSettings:
; text printing delay
TextDelaySettings:
; slow to fast
db 6, 4, 2, 1, 0
db TEXT_SPEED_1, TEXT_SPEED_2, TEXT_SPEED_3, TEXT_SPEED_4, TEXT_SPEED_5
UpdateConfigMenuCursor:
push af

View File

@ -116,7 +116,7 @@ InitSaveData:
; saved configuration options
ld a, 2
ld [sPrinterContrastLevel], a
ld a, $2
ld a, TEXT_SPEED_3
ld [sTextSpeed], a
ld [wTextSpeed], a

View File

@ -135,9 +135,9 @@ PrintScrollableText::
jr .go
.nonzero_text_speed
ld a, [wTextSpeed]
cp 2
cp TEXT_SPEED_3
jr nc, .apply_delay
; if text speed is 1, pressing b ignores it
; if TEXT_SPEED_4, pressing B ignores the delay
ldh a, [hKeysHeld]
and PAD_B
jr nz, .skip_delay
@ -455,9 +455,9 @@ PrintText::
ld b, a
ld a, [wTextSpeed]
inc a
cp 3
cp TEXT_SPEED_3 + 1
jr nc, .apply_delay
; if text speed is 1, pressing b ignores it
; if TEXT_SPEED_4, pressing B ignores the delay
bit B_PAD_B, b
jr nz, .skip_delay
jr .apply_delay