Skip to content

Commit

Permalink
Add wLetterPrintingDelayFlags flag constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jun 24, 2024
1 parent f38e75c commit 10346b0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
5 changes: 5 additions & 0 deletions constants/ram_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ DEF TEXT_DELAY_FAST EQU %001 ; 1
DEF TEXT_DELAY_MEDIUM EQU %011 ; 3
DEF TEXT_DELAY_SLOW EQU %101 ; 5

; wLetterPrintingDelayFlags::
const_def
const BIT_FAST_TEXT_DELAY ; 0
const BIT_TEXT_DELAY ; 1

; wObtainedBadges::
; wBeatGymFlags::
const_def
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6794,7 +6794,7 @@ InitBattleCommon:
ld hl, wLetterPrintingDelayFlags
ld a, [hl]
push af
res 1, [hl]
res BIT_TEXT_DELAY, [hl] ; no delay
callfar InitBattleVariables
ld a, [wEnemyMonSpecies2]
sub OPP_ID_OFFSET
Expand Down
5 changes: 3 additions & 2 deletions engine/menus/main_menu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ MainMenu:
jp SpecialEnterMap

InitOptions:
ld a, TEXT_DELAY_FAST
ld a, 1 << BIT_FAST_TEXT_DELAY
ld [wLetterPrintingDelayFlags], a
ld a, TEXT_DELAY_MEDIUM
ld [wOptions], a
Expand Down Expand Up @@ -468,7 +468,8 @@ DisplayOptionMenu:
xor a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
inc a
assert BIT_FAST_TEXT_DELAY == 0
inc a ; 1 << BIT_FAST_TEXT_DELAY
ld [wLetterPrintingDelayFlags], a
ld [wOptionsCancelCursorX], a
ld a, 3 ; text speed cursor Y coordinate
Expand Down
4 changes: 2 additions & 2 deletions engine/movie/title.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ PrepareTitleScreen::
ld [wLetterPrintingDelayFlags], a
ld hl, wStatusFlags6
ld [hli], a
ld [hli], a
ld [hl], a
ld [hli], a ; wStatusFlags7
ld [hl], a ; wElite4Flags
ld a, BANK(Music_TitleScreen)
ld [wAudioROMBank], a
ld [wAudioSavedROMBank], a
Expand Down
4 changes: 2 additions & 2 deletions home/print_text.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ PrintLetterDelay::
bit BIT_NO_TEXT_DELAY, a
ret nz
ld a, [wLetterPrintingDelayFlags]
bit 1, a
bit BIT_TEXT_DELAY, a
ret z
push hl
push de
push bc
ld a, [wLetterPrintingDelayFlags]
bit 0, a
bit BIT_FAST_TEXT_DELAY, a
jr z, .waitOneFrame
ld a, [wOptions]
and $f
Expand Down
2 changes: 1 addition & 1 deletion home/text.asm
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ ProtectedDelay3::
TextCommandProcessor::
ld a, [wLetterPrintingDelayFlags]
push af
set 1, a
set BIT_TEXT_DELAY, a
ld e, a
ldh a, [hClearLetterPrintingDelayFlags]
xor e
Expand Down
4 changes: 0 additions & 4 deletions ram/wram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1721,10 +1721,6 @@ wObtainedBadges:: flag_array NUM_BADGES

ds 1

; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if
; the delay has been disabled entirely through bit 1 of this variable
; or BIT_NO_TEXT_DELAY of wStatusFlags5.
; bit 1: If 0, no delay.
wLetterPrintingDelayFlags:: db

wPlayerID:: dw
Expand Down

0 comments on commit 10346b0

Please sign in to comment.