Fix misnamed character codes

Some character codes were erroneously named after their text command
counterparts. This has caused a lot of confusion with naming their
functions and with other things.

I've also removed the `dict2` macro and expanded the `dict` macro. This
really isn't something we should be doing for macros but I can't deny it
looks a lot neater than repeated code.
This commit is contained in:
mid-kid 2018-07-17 23:08:04 +02:00
parent 778d57ba21
commit 1fc7430a2b
8 changed files with 53 additions and 49 deletions

View File

@ -2,9 +2,12 @@
; Control characters (see home/text.asm)
charmap "<NULL>", $00
charmap "<PLAY_G>", $14 ; "<PLAYER>くん" or "<PLAYER>ちゃん"; same as "<PLAYER>" in English
charmap "<MOBILE>", $15
charmap "<CR>", $16
charmap "¯", $1f ; soft linebreak
charmap "<LNBRK>", $22
charmap "<LF>", $22
charmap "<POKE>", $24 ; "<PO><KE>"
charmap "%", $25 ; soft linebreak in landmark names
charmap "<RED>", $38 ; wRedsName

View File

@ -12,4 +12,4 @@ NonTrainerCallerNames:
.bill: db "BILL:@"
.elm: db "PROF.ELM:@"
.bikeshop: db "BIKE SHOP:@"
.buena: db "BUENA:<LNBRK> DISC JOCKEY@"
.buena: db "BUENA:<LF> DISC JOCKEY@"

View File

@ -8578,7 +8578,7 @@ ReadAndPrintLinkBattleRecord:
db " 0 0 0@"
.Format:
db " --- <LNBRK>"
db " --- <LF>"
db " - - -@"
.Record:
db "<PLAYER>'s RECORD@"

View File

@ -61,20 +61,20 @@ _OptionsMenu:
ret
StringOptions:
db "TEXT SPEED<LNBRK>"
db " :<LNBRK>"
db "BATTLE SCENE<LNBRK>"
db " :<LNBRK>"
db "BATTLE STYLE<LNBRK>"
db " :<LNBRK>"
db "SOUND<LNBRK>"
db " :<LNBRK>"
db "PRINT<LNBRK>"
db " :<LNBRK>"
db "MENU ACCOUNT<LNBRK>"
db " :<LNBRK>"
db "FRAME<LNBRK>"
db " :TYPE<LNBRK>"
db "TEXT SPEED<LF>"
db " :<LF>"
db "BATTLE SCENE<LF>"
db " :<LF>"
db "BATTLE STYLE<LF>"
db " :<LF>"
db "SOUND<LF>"
db " :<LF>"
db "PRINT<LF>"
db " :<LF>"
db "MENU ACCOUNT<LF>"
db " :<LF>"
db "FRAME<LF>"
db " :TYPE<LF>"
db "CANCEL@"
GetOptionPointer:

View File

@ -5,14 +5,14 @@ TownMap_ConvertLineBreakCharacters:
cp "@"
jr z, .end
cp "%"
jr z, .line_break
jr z, .line_feed
cp "¯"
jr z, .line_break
jr z, .line_feed
inc hl
jr .loop
.line_break
ld [hl], "<LNBRK>"
.line_feed
ld [hl], "<LF>"
.end
ld de, wStringBuffer1

View File

@ -178,26 +178,30 @@ NextChar::
CheckDict::
dict: MACRO
if \1 == 0
if \1 == "<NULL>"
and a
else
cp \1
endc
jp z, \2
ENDM
dict2: MACRO
cp \1
if STRSUB("\2", 1, 1) == "\""
; Replace a character with another one
jr nz, ._\@
ld a, \2
._\@:
elif STRSUB("\2", 1, 1) == "."
; Locals can use a short jump
jr z, \2
else
jp z, \2
endc
ENDM
dict TX_DAY, DayOfWeekChar
dict "<MOBILE>", MobileScriptChar
dict "<LINE>", LineChar
dict "<NEXT>", NextLineChar
dict TX_FAR, TextFar
dict TX_START, NullChar
dict "<CR>", CarriageReturnChar
dict "<NULL>", NullChar
dict "<SCROLL>", _ContTextNoPause
dict "<_CONT>", _ContText
dict "<PARA>", Paragraph
@ -215,7 +219,7 @@ ENDM
dict "<TM>", TMChar
dict "<TRAINER>", TrainerChar
dict "<KOUGEKI>", PlaceKougeki
dict "<LNBRK>", LineBreakChar
dict "<LF>", LineFeedChar
dict "<CONT>", ContText
dict "<……>", SixDotsChar
dict "<DONE>", DoneText
@ -223,17 +227,14 @@ ENDM
dict "<PKMN>", PlacePKMN
dict "<POKE>", PlacePOKE
dict "%", NextChar
dict2 "¯", " "
dict "¯", " "
dict "<DEXEND>", PlaceDexEnd
dict "<TARGET>", PlaceMoveTargetsName
dict "<USER>", PlaceMoveUsersName
dict "<ENEMY>", PlaceEnemysName
dict "<PLAY_G>", PlaceGenderedPlayerName
cp "゚"
jr z, .place ; should be .diacritic
cp "゙"
jr z, .place ; should be .diacritic
dict "゚", .place ; should be .diacritic
dict "゙", .place ; should be .diacritic
jr .not_diacritic
.diacritic
@ -276,10 +277,10 @@ ENDM
call PrintLetterDelay
jp NextChar
DayOfWeekChar::
MobileScriptChar::
ld c, l
ld b, h
farcall Function17f036
farcall RunMobileScript
jp PlaceNextChar
print_name: MACRO
@ -409,14 +410,14 @@ NextLineChar::
push hl
jp NextChar
LineBreakChar::
LineFeedChar::
pop hl
ld bc, SCREEN_WIDTH
add hl, bc
push hl
jp NextChar
TextFar::
CarriageReturnChar::
pop hl
push de
ld bc, -wTileMap + $10000

View File

@ -3894,7 +3894,7 @@ Function8aab6:
ret
String_8aaf0:
db "あたらしい めいし<PKMN>できまし<LNBRK>@"
db "あたらしい めいし<PKMN>できまし<LF>@"
Function8ab00:
ld de, String_8911c

View File

@ -3570,25 +3570,25 @@ Palette_17eff6:
RGB 24, 16, 3
RGB 0, 0, 0
Function17f036::
RunMobileScript::
ld a, $6
call GetSRAMBank
inc de
.asm_17f03c
call Function17f047
jr c, .asm_17f043
jr .asm_17f03c
.loop
call _RunMobileScript
jr c, .finished
jr .loop
.asm_17f043
.finished
call CloseSRAM
ret
Function17f047:
_RunMobileScript:
ld a, [de]
inc de
cp $50
jr z, .finished
cp $10
cp $10 ; jumptable size
jr nc, .finished
dec a
push de