Skip to content

Commit d874acd

Browse files
authored
Merge pull request #167 from Sha0den/master
Create text speed constants
2 parents f9d5c5b + 49cd6b4 commit d874acd

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/constants/menu_constants.asm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,10 @@ DEF NUM_CARDS_PROMOTIONAL EQU 20
7070
const START_MENU_CONTINUE_DUEL ; 3
7171

7272
DEF NUM_MAILS EQU 15
73+
74+
; TextDelaySettings constants
75+
DEF TEXT_SPEED_1 EQU 6
76+
DEF TEXT_SPEED_2 EQU 4
77+
DEF TEXT_SPEED_3 EQU 2
78+
DEF TEXT_SPEED_4 EQU 1
79+
DEF TEXT_SPEED_5 EQU 0

src/engine/menus/config.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ DuelAnimationSettings:
147147
; text printing delay
148148
TextDelaySettings:
149149
; slow to fast
150-
db 6, 4, 2, 1, 0
150+
db TEXT_SPEED_1, TEXT_SPEED_2, TEXT_SPEED_3, TEXT_SPEED_4, TEXT_SPEED_5
151151

152152
UpdateConfigMenuCursor:
153153
push af

src/engine/starter_deck.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ InitSaveData:
116116
; saved configuration options
117117
ld a, 2
118118
ld [sPrinterContrastLevel], a
119-
ld a, $2
119+
ld a, TEXT_SPEED_3
120120
ld [sTextSpeed], a
121121
ld [wTextSpeed], a
122122

src/home/print_text.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ PrintScrollableText::
135135
jr .go
136136
.nonzero_text_speed
137137
ld a, [wTextSpeed]
138-
cp 2
138+
cp TEXT_SPEED_3
139139
jr nc, .apply_delay
140-
; if text speed is 1, pressing b ignores it
140+
; if TEXT_SPEED_4, pressing B ignores the delay
141141
ldh a, [hKeysHeld]
142142
and PAD_B
143143
jr nz, .skip_delay
@@ -455,9 +455,9 @@ PrintText::
455455
ld b, a
456456
ld a, [wTextSpeed]
457457
inc a
458-
cp 3
458+
cp TEXT_SPEED_3 + 1
459459
jr nc, .apply_delay
460-
; if text speed is 1, pressing b ignores it
460+
; if TEXT_SPEED_4, pressing B ignores the delay
461461
bit B_PAD_B, b
462462
jr nz, .skip_delay
463463
jr .apply_delay

0 commit comments

Comments
 (0)