diff options
author | mid-kid <esteve.varela@gmail.com> | 2018-07-17 23:08:04 +0200 |
---|---|---|
committer | mid-kid <esteve.varela@gmail.com> | 2018-07-18 10:55:30 +0200 |
commit | 1fc7430a2baa2835f4dad4676a3e7ae513275a7d (patch) | |
tree | 9ea4f88527995b7b7790e988fc4c495d0e7dbe85 | |
parent | 778d57ba217e9f0da9af03beceab0cc5fbd153b5 (diff) |
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.
-rw-r--r-- | charmap.asm | 5 | ||||
-rw-r--r-- | data/phone/non_trainer_names.asm | 2 | ||||
-rw-r--r-- | engine/battle/core.asm | 2 | ||||
-rw-r--r-- | engine/menus/options_menu.asm | 28 | ||||
-rw-r--r-- | engine/pokegear/townmap_convertlinebreakcharacters.asm | 8 | ||||
-rw-r--r-- | home/text.asm | 39 | ||||
-rw-r--r-- | mobile/mobile_22.asm | 2 | ||||
-rw-r--r-- | mobile/mobile_5f.asm | 16 |
8 files changed, 53 insertions, 49 deletions
diff --git a/charmap.asm b/charmap.asm index e04091a88..d5bd2bcf1 100644 --- a/charmap.asm +++ b/charmap.asm @@ -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 diff --git a/data/phone/non_trainer_names.asm b/data/phone/non_trainer_names.asm index d7648fa7f..1792c506a 100644 --- a/data/phone/non_trainer_names.asm +++ b/data/phone/non_trainer_names.asm @@ -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@" diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 57c0d7990..d1bd41b84 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -8578,7 +8578,7 @@ ReadAndPrintLinkBattleRecord: db " 0 0 0@" .Format: - db " --- <LNBRK>" + db " --- <LF>" db " - - -@" .Record: db "<PLAYER>'s RECORD@" diff --git a/engine/menus/options_menu.asm b/engine/menus/options_menu.asm index 370eba3f6..4dc6c0fe1 100644 --- a/engine/menus/options_menu.asm +++ b/engine/menus/options_menu.asm @@ -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: diff --git a/engine/pokegear/townmap_convertlinebreakcharacters.asm b/engine/pokegear/townmap_convertlinebreakcharacters.asm index e0ed55131..a881b9260 100644 --- a/engine/pokegear/townmap_convertlinebreakcharacters.asm +++ b/engine/pokegear/townmap_convertlinebreakcharacters.asm @@ -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 diff --git a/home/text.asm b/home/text.asm index d74af02af..b95a619dd 100644 --- a/home/text.asm +++ b/home/text.asm @@ -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 diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm index da8fee07c..5f0f3e86e 100644 --- a/mobile/mobile_22.asm +++ b/mobile/mobile_22.asm @@ -3894,7 +3894,7 @@ Function8aab6: ret String_8aaf0: - db "あたらしい めいし<PKMN>できまし<LNBRK>@" + db "あたらしい めいし<PKMN>できまし<LF>@" Function8ab00: ld de, String_8911c diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm index 505d6cdbd..6e47e4b6c 100644 --- a/mobile/mobile_5f.asm +++ b/mobile/mobile_5f.asm @@ -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 |