Clean up TX_ commands

Some of the TX_ commands didn't use the TX_ prefix for their
constants, and the label names were inconsistent. I've chosen to adopt
the `TextCommand_` prefix as opposed to `Text_`, as it has a clear
difference in namespace compared to the possibly-used `Text_` namespace
for actual dialogue text.
This commit is contained in:
mid-kid 2018-07-17 23:11:17 +02:00
parent 1fc7430a2b
commit ffa63c51df
2 changed files with 61 additions and 56 deletions

View File

@ -682,32 +682,32 @@ DoTextUntilTerminator::
TextCommands:: TextCommands::
; entries correspond to TX_* constants (see macros/scripts/text.asm) ; entries correspond to TX_* constants (see macros/scripts/text.asm)
dw Text_TX ; TX_START dw TextCommand_START ; TX_START
dw Text_TX_RAM ; TX_RAM dw TextCommand_RAM ; TX_RAM
dw Text_TX_BCD ; TX_BCD dw TextCommand_BCD ; TX_BCD
dw Text_TX_MOVE ; TX_MOVE dw TextCommand_MOVE ; TX_MOVE
dw Text_TX_BOX ; TX_BOX dw TextCommand_BOX ; TX_BOX
dw Text_TX_LOW ; TX_LOW dw TextCommand_LOW ; TX_LOW
dw Text_WAIT_BUTTON ; WAIT_BUTTON dw TextCommand_WAIT_BUTTON ; TX_WAIT_BUTTON
dw Text_TX_SCROLL ; TX_SCROLL dw TextCommand_SCROLL ; TX_SCROLL
dw Text_START_ASM ; START_ASM dw TextCommand_START_ASM ; TX_START_ASM
dw Text_TX_NUM ; TX_NUM dw TextCommand_NUM ; TX_NUM
dw Text_TX_EXIT ; TX_EXIT dw TextCommand_EXIT ; TX_EXIT
dw Text_PlaySound ; TX_SOUND_DEX_FANFARE_50_79 dw TextCommand_SOUND ; TX_SOUND_DEX_FANFARE_50_79
dw Text_TX_DOTS ; TX_DOTS dw TextCommand_DOTS ; TX_DOTS
dw Text_LINK_WAIT_BUTTON ; TX_LINK_WAIT_BUTTON dw TextCommand_LINK_WAIT_BUTTON ; TX_LINK_WAIT_BUTTON
dw Text_PlaySound ; TX_SOUND_DEX_FANFARE_20_49 dw TextCommand_SOUND ; TX_SOUND_DEX_FANFARE_20_49
dw Text_PlaySound ; TX_SOUND_ITEM dw TextCommand_SOUND ; TX_SOUND_ITEM
dw Text_PlaySound ; TX_SOUND_CAUGHT_MON dw TextCommand_SOUND ; TX_SOUND_CAUGHT_MON
dw Text_PlaySound ; TX_SOUND_DEX_FANFARE_80_109 dw TextCommand_SOUND ; TX_SOUND_DEX_FANFARE_80_109
dw Text_PlaySound ; TX_SOUND_FANFARE dw TextCommand_SOUND ; TX_SOUND_FANFARE
dw Text_PlaySound ; TX_SOUND_SLOT_MACHINE_START dw TextCommand_SOUND ; TX_SOUND_SLOT_MACHINE_START
dw Text_TX_STRINGBUFFER ; TX_STRINGBUFFER dw TextCommand_STRINGBUFFER ; TX_STRINGBUFFER
dw Text_TX_DAY ; TX_DAY dw TextCommand_DAY ; TX_DAY
dw Text_TX_FAR ; TX_FAR dw TextCommand_FAR ; TX_FAR
Text_TX:: TextCommand_START::
; TX ; text_start
; write text until "@" ; write text until "@"
; [$00]["...@"] ; [$00]["...@"]
@ -721,7 +721,7 @@ Text_TX::
inc hl inc hl
ret ret
Text_TX_RAM:: TextCommand_RAM::
; text_from_ram ; text_from_ram
; write text from a ram address ; write text from a ram address
; little endian ; little endian
@ -738,7 +738,7 @@ Text_TX_RAM::
pop hl pop hl
ret ret
Text_TX_FAR:: TextCommand_FAR::
; text_jump ; text_jump
; write text from a different bank ; write text from a different bank
; little endian ; little endian
@ -767,8 +767,8 @@ Text_TX_FAR::
ld [MBC3RomBank], a ld [MBC3RomBank], a
ret ret
Text_TX_BCD:: TextCommand_BCD::
; TX_BCD ; text_bcd
; write bcd from address, typically ram ; write bcd from address, typically ram
; [$02][addr][flags] ; [$02][addr][flags]
; flags: see PrintBCDNumber ; flags: see PrintBCDNumber
@ -788,8 +788,8 @@ Text_TX_BCD::
pop hl pop hl
ret ret
Text_TX_MOVE:: TextCommand_MOVE::
; TX_MOVE ; text_move
; move to a new tile ; move to a new tile
; [$03][addr] ; [$03][addr]
@ -801,8 +801,8 @@ Text_TX_MOVE::
ld b, a ld b, a
ret ret
Text_TX_BOX:: TextCommand_BOX::
; TX_BOX ; text_box
; draw a box ; draw a box
; little endian ; little endian
; [$04][addr][height][width] ; [$04][addr][height][width]
@ -822,25 +822,25 @@ Text_TX_BOX::
pop hl pop hl
ret ret
Text_TX_LOW:: TextCommand_LOW::
; TX_LOW ; text_low
; write text at (1,16) ; write text at (1,16)
; [$05] ; [$05]
bccoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2 bccoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
ret ret
Text_WAIT_BUTTON:: TextCommand_WAIT_BUTTON::
; TX_WAITBUTTON ; text_waitbutton
; wait for button press ; wait for button press
; show arrow ; show arrow
; [06] ; [06]
ld a, [wLinkMode] ld a, [wLinkMode]
cp LINK_COLOSSEUM cp LINK_COLOSSEUM
jp z, Text_LINK_WAIT_BUTTON jp z, TextCommand_LINK_WAIT_BUTTON
cp LINK_MOBILE cp LINK_MOBILE
jp z, Text_LINK_WAIT_BUTTON jp z, TextCommand_LINK_WAIT_BUTTON
push hl push hl
call LoadBlinkingCursor call LoadBlinkingCursor
@ -851,7 +851,8 @@ Text_WAIT_BUTTON::
pop hl pop hl
ret ret
Text_TX_SCROLL:: TextCommand_SCROLL::
; text_scroll
; pushes text up two lines and sets the BC cursor to the border tile ; pushes text up two lines and sets the BC cursor to the border tile
; below the first character column of the text box. ; below the first character column of the text box.
push hl push hl
@ -862,8 +863,8 @@ Text_TX_SCROLL::
bccoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2 bccoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
ret ret
Text_START_ASM:: TextCommand_START_ASM::
; TX_ASM ; start_asm
bit 7, h bit 7, h
jr nz, .not_rom jr nz, .not_rom
@ -874,8 +875,8 @@ Text_START_ASM::
ld [hl], a ld [hl], a
ret ret
Text_TX_NUM:: TextCommand_NUM::
; TX_NUM ; deciram
; [$09][addr][hi:bytes lo:digits] ; [$09][addr][hi:bytes lo:digits]
ld a, [hli] ld a, [hli]
ld e, a ld e, a
@ -899,7 +900,8 @@ Text_TX_NUM::
pop hl pop hl
ret ret
Text_TX_EXIT:: TextCommand_EXIT::
; interpret_data
push hl push hl
push bc push bc
call GetJoypad call GetJoypad
@ -913,7 +915,7 @@ Text_TX_EXIT::
pop hl pop hl
ret ret
Text_PlaySound:: TextCommand_SOUND::
; chars: ; chars:
; $0b, $0e, $0f, $10, $11, $12, $13 ; $0b, $0e, $0f, $10, $11, $12, $13
; see TextSFX ; see TextSFX
@ -949,7 +951,7 @@ Text_PlaySound::
ret ret
Unreferenced_Function1522:: Unreferenced_Function1522::
; TX_CRY ; play_cry
push de push de
ld e, [hl] ld e, [hl]
inc hl inc hl
@ -970,7 +972,8 @@ TextSFX::
dbw TX_SOUND_SLOT_MACHINE_START, SFX_SLOT_MACHINE_START dbw TX_SOUND_SLOT_MACHINE_START, SFX_SLOT_MACHINE_START
db -1 db -1
Text_TX_DOTS:: TextCommand_DOTS::
; limited_interpret_data
; [$0C][num] ; [$0C][num]
ld a, [hli] ld a, [hli]
ld d, a ld d, a
@ -998,7 +1001,8 @@ Text_TX_DOTS::
pop hl pop hl
ret ret
Text_LINK_WAIT_BUTTON:: TextCommand_LINK_WAIT_BUTTON::
; link_wait_button
; wait for key down ; wait for key down
; display arrow ; display arrow
push hl push hl
@ -1008,7 +1012,8 @@ Text_LINK_WAIT_BUTTON::
pop hl pop hl
ret ret
Text_TX_STRINGBUFFER:: TextCommand_STRINGBUFFER::
; text_buffer
; Print a string from one of the following: ; Print a string from one of the following:
; 0: wStringBuffer3 ; 0: wStringBuffer3
; 1: wStringBuffer4 ; 1: wStringBuffer4
@ -1036,8 +1041,8 @@ Text_TX_STRINGBUFFER::
pop hl pop hl
ret ret
Text_TX_DAY:: TextCommand_DAY::
; TX_DAY ; current_day
call GetWeekday call GetWeekday
push hl push hl

View File

@ -46,9 +46,9 @@ text_low: MACRO
db TX_LOW db TX_LOW
ENDM ENDM
enum WAIT_BUTTON ; $06 enum TX_WAIT_BUTTON ; $06
text_waitbutton: MACRO text_waitbutton: MACRO
db WAIT_BUTTON db TX_WAIT_BUTTON
ENDM ENDM
enum TX_SCROLL ; $07 enum TX_SCROLL ; $07
@ -56,9 +56,9 @@ text_scroll: MACRO
db TX_SCROLL db TX_SCROLL
ENDM ENDM
enum START_ASM ; $08 enum TX_START_ASM ; $08
start_asm: MACRO start_asm: MACRO
db START_ASM db TX_START_ASM
ENDM ENDM
enum TX_NUM ; $09 enum TX_NUM ; $09