Skip to content

Commit

Permalink
Add wLineSeparation constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Sha0den committed Sep 24, 2024
1 parent 0285528 commit d1dd98c
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 17 deletions.
4 changes: 4 additions & 0 deletions src/constants/text_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ DEF TX_CTRL_END EQU $10
; wFontWidth constants
DEF FULL_WIDTH EQU $0
DEF HALF_WIDTH EQU $1 ; non-0

; wLineSeparation constants
DEF DOUBLE_SPACED EQU 0
DEF SINGLE_SPACED EQU 1 ; non-0
2 changes: 1 addition & 1 deletion src/engine/bank20.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ Func_80baa:
Func_80c64: ; unreferenced
ld a, [wLineSeparation]
push af
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
ld [wLineSeparation], a
; load opponent's name
ld a, [wOpponentName]
Expand Down
2 changes: 1 addition & 1 deletion src/engine/challenge_machine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ChallengeMachine_Reset:
; if a challenge is already in progress, then resume
; otherwise, start a new 5 round challenge
ChallengeMachine_Start::
ld a, 0 ; text is double-spaced
ld a, DOUBLE_SPACED
ld [wLineSeparation], a
call LoadConsolePaletteData
call ChallengeMachine_Initialize
Expand Down
4 changes: 2 additions & 2 deletions src/engine/duel/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4765,7 +4765,7 @@ LargeCardTileData:

; print lines of text with no separation between them
SetNoLineSeparation:
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
; fallthrough

SetLineSeparation:
Expand All @@ -4774,7 +4774,7 @@ SetLineSeparation:

; separate lines of text by an empty line
SetOneLineSeparation:
xor a ; text is double-spaced
xor a ; DOUBLE_SPACED
jr SetLineSeparation

; given a number in hl, print it divided by 10 at b,c, with decimal part
Expand Down
2 changes: 1 addition & 1 deletion src/engine/menus/config.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _PauseMenu_Config:
push af
xor a
ld [wConfigExitSettingsCursorPos], a
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
ld [wLineSeparation], a
call InitMenuScreen
lb de, 0, 3
Expand Down
4 changes: 2 additions & 2 deletions src/engine/menus/debug_main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Func_12661:
call SetupText
call EnableAndClearSpriteAnimations
call Func_12871
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
ld [wLineSeparation], a
ld a, [wDebugMenuSelection]
ld hl, Unknown_128f7
Expand All @@ -29,7 +29,7 @@ Func_12661:
bit 7, a
jr nz, .asm_12698
ld [wDebugMenuSelection], a
xor a ; text is double-spaced
xor a ; DOUBLE_SPACED
ld [wLineSeparation], a
call Func_126b3
jr c, .asm_1266d
Expand Down
4 changes: 2 additions & 2 deletions src/engine/menus/deck_machine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ GiftCenter_SendCard:
lb de, 1, 3
call InitTextPrinting
ldtx hl, CardSendingProceduresText
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
ld [wLineSeparation], a
call ProcessTextFromID
xor a ; text is double-spaced
xor a ; DOUBLE_SPACED
ld [wLineSeparation], a
ldtx hl, PleaseReadTheProceduresForSendingCardsText
call DrawWideTextBox_WaitForInput
Expand Down
4 changes: 2 additions & 2 deletions src/engine/menus/glossary.asm
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ OpenGlossaryScreen:
ld a, [hli]
ld h, [hl]
ld l, a
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
ld [wLineSeparation], a
call ProcessTextFromID
xor a ; text is double-spaced
xor a ; DOUBLE_SPACED
ld [wLineSeparation], a
call EnableLCD
.loop
Expand Down
2 changes: 1 addition & 1 deletion src/engine/menus/start.asm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ HandleStartMenu:
lb de, $30, $8f
call SetupText
call EnableAndClearSpriteAnimations
xor a ; text is double-spaced
xor a ; DOUBLE_SPACED
ld [wLineSeparation], a
call .DrawPlayerPortrait
call .SetStartMenuParams
Expand Down
2 changes: 1 addition & 1 deletion src/engine/overworld/overworld.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LoadMap::
ld [wTileMapFill], a
call LoadSymbolsFont
call Set_OBJ_8x8
xor a ; text is double-spaced
xor a ; DOUBLE_SPACED
ld [wLineSeparation], a
xor a
ld [wd291], a
Expand Down
4 changes: 2 additions & 2 deletions src/engine/sequences/credits_sequence_commands.asm
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ CreditsSequenceCmd_DrawRectangle:
jp AdvanceCreditsSequenceCmdPtrBy4

CreditsSequenceCmd_PrintText:
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
ld [wLineSeparation], a
push de
ld d, c
Expand All @@ -339,7 +339,7 @@ CreditsSequenceCmd_PrintText:
jp AdvanceCreditsSequenceCmdPtrBy6

CreditsSequenceCmd_PrintTextBox:
ld a, $01 ; text isn't double-spaced
ld a, SINGLE_SPACED
ld [wLineSeparation], a
push de
ld d, c
Expand Down
2 changes: 1 addition & 1 deletion src/home/process_text.asm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ProcessSpecialTextCharacter::
call TerminateHalfWidthText
ld a, [wLineSeparation]
or a
call z, .next_line
call z, .next_line ; extra line if DOUBLE_SPACED
.next_line
xor a
ldh [hTextLineCurPos], a
Expand Down
3 changes: 2 additions & 1 deletion src/wram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,8 @@ wTilePatternSelector:: ; cd06
wTilePatternSelectorCorrection:: ; cd07
ds $1

; if 0, text lines are separated by a blank line
; if 0 (DOUBLE_SPACED), text lines are separated by a blank line
; uses constants DOUBLE_SPACED and SINGLE_SPACED
wLineSeparation:: ; cd08
ds $1

Expand Down

0 comments on commit d1dd98c

Please sign in to comment.