summaryrefslogtreecommitdiff
path: root/home/text.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/text.asm')
-rw-r--r--home/text.asm108
1 files changed, 54 insertions, 54 deletions
diff --git a/home/text.asm b/home/text.asm
index 4996c99..18722b0 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -2,17 +2,17 @@ INCLUDE "constants.asm"
SECTION "home/text.asm", ROM0
-ClearBox:: ; 00:0e18
+ClearBox::
; Fill a c*b box at hl with blank tiles.
ld a, " "
; fallthrough
FillBoxWithByte::
ld de, SCREEN_WIDTH
-.asm_0e1d: ; 00:0e1d
+.asm_0e1d:
push hl
push bc
-.asm_0e1f: ; 00:0e1f
+.asm_0e1f:
ld [hli], a
dec c
jr nz, .asm_0e1f
@@ -23,7 +23,7 @@ FillBoxWithByte::
jr nz, .asm_0e1d
ret
-ClearTileMap:: ; 00:0e2a
+ClearTileMap::
; Fill wTileMap with blank tiles.
hlcoord 0, 0
@@ -35,7 +35,7 @@ ClearTileMap:: ; 00:0e2a
ret z
jp WaitBGMap
-DrawTextBox:: ; 00:0e3d
+DrawTextBox::
; Top
push hl
@@ -74,7 +74,7 @@ DrawTextBox:: ; 00:0e3d
ret
; e6a
-.PlaceChars: ; e6a
+.PlaceChars:
; Place char a c times.
ld d, c
.loop
@@ -105,9 +105,9 @@ SpeechTextBox::
ld c, TEXTBOX_INNERW
jp DrawTextBox
-PlaceString:: ; 00:0e93
+PlaceString::
push hl
-PlaceNextChar:: ; 00:0e94
+PlaceNextChar::
ld a, [de]
cp "@"
jr nz, CheckDict
@@ -116,7 +116,7 @@ PlaceNextChar:: ; 00:0e94
pop hl
ret
-CheckDict:: ; 00:0e9d
+CheckDict::
dict: MACRO
if \1 == 0
and a
@@ -134,7 +134,7 @@ ENDM
push hl
jp NextChar
-.asm_0eaa: ; 00:0eaa
+.asm_0eaa:
cp "<LINE>"
jr nz, .asm_0eb6
pop hl
@@ -142,7 +142,7 @@ ENDM
push hl
jp NextChar
-.asm_0eb6: ; 00:0eb6
+.asm_0eb6:
dict 0, NullChar
dict "<SCROLL>", _ContTextNoPause
dict "<_CONT>", _ContText
@@ -168,7 +168,7 @@ ENDM
jr z, .diacritic
cp "゙"
jr nz, .not_diacritic
-.diacritic: ; 00:0f21
+.diacritic:
push hl
ld bc, -SCREEN_WIDTH
add hl, bc
@@ -176,7 +176,7 @@ ENDM
pop hl
jr NextChar
-.not_diacritic: ; 00:0f2a
+.not_diacritic:
cp FIRST_REGULAR_TEXT_CHAR
jr nc, .place
cp "パ"
@@ -186,9 +186,9 @@ ENDM
add "カ" - "ガ"
jr .katakana_dakuten
-.hiragana_dakuten: ; 00:0f3a
+.hiragana_dakuten:
add "か" - "が"
-.katakana_dakuten: ; 00:0f3c
+.katakana_dakuten:
push af
ld a, "゙"
push hl
@@ -199,15 +199,15 @@ ENDM
pop af
jr .place
-.handakuten: ; 00:0f49
+.handakuten:
cp "ぱ"
jr nc, .hiragana_handakuten
add "ハ" - "パ"
jr .katakana_handakuten
-.hiragana_handakuten: ; 00:0f51
+.hiragana_handakuten:
add "は" - "ぱ"
-.katakana_handakuten: ; 00:0f53
+.katakana_handakuten:
push af
ld a, "゚"
push hl
@@ -216,14 +216,14 @@ ENDM
ld [hl], a
pop hl
pop af
-.place: ; 00:0f5e
+.place:
ld [hli], a
call PrintLetterDelay
-NextChar:: ; 00:0f62
+NextChar::
inc de
jp PlaceNextChar
-NullChar:: ; 00:0f66
+NullChar::
ld b, h
ld c, l
pop hl
@@ -254,27 +254,27 @@ PlacePOKe:: print_name POKeCharText
SixDotsChar:: print_name SixDotsCharText
GaCharacter:: print_name GaCharacterTExt
-PlaceMoveTargetsName:: ; 00:0fb3
+PlaceMoveTargetsName::
ldh a, [hBattleTurn]
xor $1
jr asm_0fbb
-PlaceMoveUsersName:: ; 00:0fb9
+PlaceMoveUsersName::
ldh a, [hBattleTurn]
-asm_0fbb: ; 00:0fbb
+asm_0fbb:
push de
and a
jr nz, .asm_0fc4
ld de, wEnemyMonNickname
jr PlaceCommandCharacter
-.asm_0fc4: ; 00:0fc4
+.asm_0fc4:
ld de, EnemyText
call PlaceString
ld h, b
ld l, c
ld de, wBattleMonNickname
-PlaceCommandCharacter: ; 00:0fcf
+PlaceCommandCharacter:
call PlaceString
ld h, b
ld l, c
@@ -291,7 +291,7 @@ SixDotsCharText:: db "⋯⋯@"
EnemyText:: db "てきの @"
GaCharacterTExt:: db "が @"
-ContText:: ; 00:1001
+ContText::
push de
ld b, h
ld c, l
@@ -307,32 +307,32 @@ ContText:: ; 00:1001
text "<_CONT>@"
db "@"
-PlaceDexEnd:: ; 00:1015
+PlaceDexEnd::
ld [hl], "。"
pop hl
ret
-PromptText:: ; 00:1019
+PromptText::
ld a, [wLinkMode]
cp $3
jp z, Function1026
ld a, "▼"
ldcoord_a 18, 17
-Function1026:: ; 00:1026
+Function1026::
call ProtectedWaitBGMap
call ButtonSound
ld a, "─"
ldcoord_a 18, 17
-DoneText:: ; 00:1031
+DoneText::
pop hl
ld de, .Text
dec de
ret
-.Text:: ; 00:1037
+.Text::
db "@"
-Paragraph:: ; 00:1038
+Paragraph::
push de
ld a, "▼"
ldcoord_a 18, 17
@@ -349,7 +349,7 @@ Paragraph:: ; 00:1038
hlcoord 1, 14
jp NextChar
-_ContText:: ; 00:105e
+_ContText::
ld a, "▼"
ldcoord_a 18, 17
call ProtectedWaitBGMap
@@ -358,7 +358,7 @@ _ContText:: ; 00:105e
pop de
ld a, "─"
ldcoord_a 18, 17
-_ContTextNoPause:: ; 00:1070
+_ContTextNoPause::
push de
call ScrollTextUpOneLine
call ScrollTextUpOneLine
@@ -366,7 +366,7 @@ _ContTextNoPause:: ; 00:1070
pop de
jp NextChar
-ScrollTextUpOneLine:: ; 107e (0:107e)
+ScrollTextUpOneLine::
; move both rows of text in the normal text box up one row
; always called twice in a row
; first time, copy the two rows of text to the "in between" rows that are usually emtpy
@@ -394,13 +394,13 @@ ScrollTextUpOneLine:: ; 107e (0:107e)
jr nz, .waitFrame
ret
-ProtectedWaitBGMap:: ; 10a0 (0:10a0)
+ProtectedWaitBGMap::
push bc
call WaitBGMap
pop bc
ret
-TextCommandProcessor:: ; 10a6 (0:10a6)
+TextCommandProcessor::
; Process a string of text commands
; at hl and write text to bc
ld a, [wTextBoxFlags]
@@ -413,7 +413,7 @@ TextCommandProcessor:: ; 10a6 (0:10a6)
ld [wTextDest + 1], a
; fall through
-NextTextCommand:: ; 10b7 (0:10b7)
+NextTextCommand::
ld a, [hli]
cp "@" ; terminator
jr nz, .doTextCommand
@@ -434,7 +434,7 @@ NextTextCommand:: ; 10b7 (0:10b7)
ld l, a
jp hl
-Text_TX_BOX:: ; 10d0 (0:10d0)
+Text_TX_BOX::
; TX_BOX
; draw a box
; little endian
@@ -455,7 +455,7 @@ Text_TX_BOX:: ; 10d0 (0:10d0)
pop hl
jr NextTextCommand
-Text_TX:: ; 10e2 (0:10e2)
+Text_TX::
; TX
; write text until "@"
; [$00]["...@"]
@@ -470,7 +470,7 @@ Text_TX:: ; 10e2 (0:10e2)
inc hl
jr NextTextCommand
-Text_TX_RAM:: ; 10ef (0:10ef)
+Text_TX_RAM::
; text_from_ram
; write text from a ram address
; little endian
@@ -487,7 +487,7 @@ Text_TX_RAM:: ; 10ef (0:10ef)
pop hl
jr NextTextCommand
-Text_TX_BCD:: ; 10fd (0:10fd)
+Text_TX_BCD::
; TX_BCD
; write bcd from address, typically ram
; [$02][addr][flags]
@@ -508,7 +508,7 @@ Text_TX_BCD:: ; 10fd (0:10fd)
pop hl
jr NextTextCommand
-Text_TX_MOVE:: ; 110f (0:110f)
+Text_TX_MOVE::
; TX_MOVE
; move to a new tile
; [$03][addr]
@@ -521,7 +521,7 @@ Text_TX_MOVE:: ; 110f (0:110f)
ld b, a
jp NextTextCommand
-Text_TX_LOW:: ; 111d (0:111d)
+Text_TX_LOW::
; TX_LOW
; write text at (1,16)
; [$05]
@@ -530,7 +530,7 @@ Text_TX_LOW:: ; 111d (0:111d)
jp NextTextCommand
; 0x1124
-Text_WAIT_BUTTON:: ; 1124 (0:1124)
+Text_WAIT_BUTTON::
; TX_WAITBUTTON
; wait for button press
; show arrow
@@ -548,7 +548,7 @@ Text_WAIT_BUTTON:: ; 1124 (0:1124)
pop hl
jp NextTextCommand
-Text_TX_SCROLL:: ; 113f (0:113f)
+Text_TX_SCROLL::
; TX_SCROLL
; pushes text up two lines and sets the BC cursor to the border tile
; below the first character column of the text box.
@@ -561,7 +561,7 @@ Text_TX_SCROLL:: ; 113f (0:113f)
coord bc, TEXTBOX_INNERX, TEXTBOX_INNERY + 2
jp NextTextCommand
-Text_START_ASM:: ; 1151 (0:1151)
+Text_START_ASM::
; TX_ASM
; Executes code following this command.
; Text processing is resumed upon returning.
@@ -571,7 +571,7 @@ Text_START_ASM:: ; 1151 (0:1151)
push de
jp hl
-Text_TX_NUM:: ; 1157 (0:1157)
+Text_TX_NUM::
; TX_NUM
; [$09][addr][hi:bytes lo:digits]
pop hl
@@ -598,7 +598,7 @@ Text_TX_NUM:: ; 1157 (0:1157)
jp NextTextCommand
; 0x1175
-Text_TX_EXIT: ; 1175 (0:1175)
+Text_TX_EXIT:
; TX_EXIT
; [$0A]
push bc
@@ -614,7 +614,7 @@ Text_TX_EXIT: ; 1175 (0:1175)
jp NextTextCommand
; 0x1189
-Text_PlaySound:: ; 1189 (0:1189)
+Text_PlaySound::
; Text_PlaySound
; [0B|0E..13] Play Sound Effects
; [14..16] Play Pokémon Cries
@@ -672,7 +672,7 @@ Text_PlaySound:: ; 1189 (0:1189)
dbw TX_CRY_15, MON_PIGEOT
dbw TX_CRY_16, MON_JUGON
-Text_TX_DOTS: ; 11e1 (0:11e1)
+Text_TX_DOTS:
pop hl
ld a, [hli]
ld d, a
@@ -698,7 +698,7 @@ Text_TX_DOTS: ; 11e1 (0:11e1)
pop hl
jp NextTextCommand
-Text_TX_LINK_WAIT_BUTTON:: ; 1203 (0:1203)
+Text_TX_LINK_WAIT_BUTTON::
push bc
call ButtonSound
pop bc
@@ -706,7 +706,7 @@ Text_TX_LINK_WAIT_BUTTON:: ; 1203 (0:1203)
jp NextTextCommand
; 0x120c
-TextCommands:: ; 120c
+TextCommands::
dw Text_TX
dw Text_TX_RAM
dw Text_TX_BCD