Define more charmap characters and use them in place of hard-coded numbers

This commit is contained in:
Remy Oukaour 2017-12-09 12:24:50 -05:00
parent 512863989f
commit 6a41d4f63e
15 changed files with 125 additions and 92 deletions

View File

@ -256,9 +256,9 @@ _ShowLinkBattleParticipants: ; 2c1b2
ld de, OTPlayerName ld de, OTPlayerName
call PlaceString call PlaceString
hlcoord 9, 8 hlcoord 9, 8
ld a, $69 ; "V" ld a, "<BOLD_V>"
ld [hli], a ld [hli], a
ld [hl], $6a ; "S" ld [hl], "<BOLD_S>"
callba LinkBattle_TrainerHuds ; no need to callba callba LinkBattle_TrainerHuds ; no need to callba
ld b, SCGB_DIPLOMA ld b, SCGB_DIPLOMA
call GetSGBLayout call GetSGBLayout

View File

@ -627,7 +627,7 @@ CmdQueue_StoneTable: ; 97f42
ld hl, OBJECT_MOVEMENTTYPE ld hl, OBJECT_MOVEMENTTYPE
add hl, de add hl, de
ld a, [hl] ld a, [hl]
cp STEP_TYPE_SKYFALL_TOP cp SPRITEMOVEDATA_STRENGTH_BOULDER
jr nz, .next jr nz, .next
ld hl, OBJECT_NEXT_TILE ld hl, OBJECT_NEXT_TILE

View File

@ -518,7 +518,7 @@ Phone_FirstOfTwoRings: ; 902b3
Phone_CallerTextboxWithName2: ; 902c9 Phone_CallerTextboxWithName2: ; 902c9
call Phone_CallerTextbox call Phone_CallerTextbox
hlcoord 1, 2 hlcoord 1, 2
ld [hl], $62 ld [hl], "<PHONE>"
inc hl inc hl
inc hl inc hl
ld a, [PhoneScriptBank] ld a, [PhoneScriptBank]
@ -618,7 +618,7 @@ Function90363: ; 90363 (24:4363)
push bc push bc
call Phone_CallerTextbox call Phone_CallerTextbox
hlcoord 1, 1 hlcoord 1, 1
ld [hl], $62 ld [hl], "<PHONE>"
inc hl inc hl
inc hl inc hl
ld d, h ld d, h

View File

@ -275,7 +275,7 @@ _PrintNum:: ; c4c7
dec e dec e
ret nz ret nz
inc hl inc hl
ld [hl], "·" ld [hl], "<PERIOD>"
ret ret
.PrintLeadingZero: ; c644 .PrintLeadingZero: ; c644

View File

@ -453,7 +453,7 @@ Function4df7f: ; 4df7f
ld bc, SCREEN_WIDTH ld bc, SCREEN_WIDTH
ld d, SCREEN_HEIGHT ld d, SCREEN_HEIGHT
.loop .loop
ld a, $31 ld a, "|"
ld [hl], a ld [hl], a
add hl, bc add hl, bc
dec d dec d
@ -583,7 +583,7 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
hlcoord 9, 8 hlcoord 9, 8
ld de, SCREEN_WIDTH ld de, SCREEN_WIDTH
ld b, 10 ld b, 10
ld a, $31 ld a, "|"
.vertical_divider .vertical_divider
ld [hl], a ld [hl], a
add hl, de add hl, de
@ -743,7 +743,7 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
hlcoord 10, 8 hlcoord 10, 8
ld de, SCREEN_WIDTH ld de, SCREEN_WIDTH
ld b, 10 ld b, 10
ld a, $31 ld a, "|"
.BluePageVerticalDivider: .BluePageVerticalDivider:
ld [hl], a ld [hl], a
add hl, de add hl, de

View File

@ -448,7 +448,7 @@ TrainerCard_Page1_PrintGameTime: ; 25415 (9:5415)
ret nz ret nz
hlcoord 15, 12 hlcoord 15, 12
ld a, [hl] ld a, [hl]
xor %01010001 ; $7F <--> $2E xor %01010001 ; $7F (space) <--> $2E (colon)
ld [hl], a ld [hl], a
ret ret

View File

@ -254,7 +254,7 @@ LoadMapTimeOfDay: ; 104750
pop af pop af
ld [rVBK], a ld [rVBK], a
ld a, $60 ld a, "<BLACK>"
ld bc, VBGMap1 - VBGMap0 ld bc, VBGMap1 - VBGMap0
hlbgcoord 0, 0 hlbgcoord 0, 0
call ByteFill call ByteFill

View File

@ -1,3 +1,5 @@
HALLOFFAME_COLON EQU $63
HallOfFame:: ; 0x8640e HallOfFame:: ; 0x8640e
call HallOfFame_FadeOutMusic call HallOfFame_FadeOutMusic
ld a, [StatusFlags] ld a, [StatusFlags]
@ -487,7 +489,7 @@ DisplayHOFMon: ; 86748
hlcoord 1, 13 hlcoord 1, 13
ld a, "№" ld a, "№"
ld [hli], a ld [hli], a
ld [hl], "·" ld [hl], "<PERIOD>"
hlcoord 3, 13 hlcoord 3, 13
ld de, wd265 ld de, wd265
lb bc, PRINTNUM_LEADINGZEROS | 1, 3 lb bc, PRINTNUM_LEADINGZEROS | 1, 3
@ -531,8 +533,8 @@ DisplayHOFMon: ; 86748
HOF_AnimatePlayerPic: ; 86810 HOF_AnimatePlayerPic: ; 86810
call ClearBGPalettes call ClearBGPalettes
ld hl, VTiles2 tile $63 ld hl, VTiles2 tile HALLOFFAME_COLON
ld de, FontExtra + 13 tiles ld de, FontExtra + 13 tiles ; "<COLON>"
lb bc, BANK(FontExtra), 1 lb bc, BANK(FontExtra), 1
call Request2bpp call Request2bpp
hlcoord 0, 0 hlcoord 0, 0
@ -604,7 +606,7 @@ HOF_AnimatePlayerPic: ; 86810
ld de, GameTimeHours ld de, GameTimeHours
lb bc, 2, 3 lb bc, 2, 3
call PrintNum call PrintNum
ld [hl], 99 ld [hl], HALLOFFAME_COLON
inc hl inc hl
ld de, GameTimeMinutes ld de, GameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2 lb bc, PRINTNUM_LEADINGZEROS | 1, 2

View File

@ -79,7 +79,7 @@ Special_CheckMagikarpLength: ; fbb32
; 0xfbbae ; 0xfbbae
Magikarp_LoadFeetInchesChars: ; fbbae Magikarp_LoadFeetInchesChars: ; fbbae
ld hl, VTiles2 tile "" ld hl, VTiles2 tile "" ; $6e
ld de, .feetinchchars ld de, .feetinchchars
lb bc, BANK(.feetinchchars), 2 lb bc, BANK(.feetinchchars), 2
call Request2bpp call Request2bpp

View File

@ -131,11 +131,11 @@ _LoadStandardFont:: ; fb449
_LoadFontsExtra1:: ; fb48a _LoadFontsExtra1:: ; fb48a
ld de, MobilePhoneTilesGFX ld de, MobilePhoneTilesGFX
ld hl, VTiles2 tile $60 ld hl, VTiles2 tile "<BLACK>" ; $60
lb bc, BANK(MobilePhoneTilesGFX), 1 lb bc, BANK(MobilePhoneTilesGFX), 1
call Get1bpp_2 call Get1bpp_2
ld de, OverworldPhoneIconGFX ld de, OverworldPhoneIconGFX
ld hl, VTiles2 tile $62 ld hl, VTiles2 tile "<PHONE>" ; $62
lb bc, BANK(OverworldPhoneIconGFX), 1 lb bc, BANK(OverworldPhoneIconGFX), 1
call Get2bpp_2 call Get2bpp_2
ld de, FontExtra + 3 * LEN_2BPP_TILE ld de, FontExtra + 3 * LEN_2BPP_TILE
@ -147,7 +147,7 @@ _LoadFontsExtra1:: ; fb48a
_LoadFontsExtra2:: ; fb4b0 _LoadFontsExtra2:: ; fb4b0
ld de, FontsExtra2_UpArrowGFX ld de, FontsExtra2_UpArrowGFX
ld hl, VTiles2 tile $61 ld hl, VTiles2 tile "▲" ; $61
ld b, BANK(FontsExtra2_UpArrowGFX) ld b, BANK(FontsExtra2_UpArrowGFX)
ld c, 1 ld c, 1
call Get2bpp_2 call Get2bpp_2
@ -170,10 +170,10 @@ LoadFrame: ; fb4cc
call AddNTimes call AddNTimes
ld d, h ld d, h
ld e, l ld e, l
ld hl, VTiles2 tile $79 ld hl, VTiles2 tile "┌" ; $79
lb bc, BANK(Frames), TILES_PER_FRAME lb bc, BANK(Frames), TILES_PER_FRAME
call Get1bpp_2 call Get1bpp_2
ld hl, VTiles2 tile $7f ld hl, VTiles2 tile " " ; $7f
ld de, TextBoxSpaceGFX ld de, TextBoxSpaceGFX
lb bc, BANK(TextBoxSpaceGFX), 1 lb bc, BANK(TextBoxSpaceGFX), 1
call Get1bpp_2 call Get1bpp_2
@ -186,7 +186,7 @@ LoadBattleFontsHPBar: ; fb4f2
lb bc, BANK(FontBattleExtra), $c lb bc, BANK(FontBattleExtra), $c
call Get2bpp_2 call Get2bpp_2
ld hl, VTiles2 tile $70 ld hl, VTiles2 tile $70
ld de, FontBattleExtra + $10 * LEN_2BPP_TILE ld de, FontBattleExtra tile $10
lb bc, BANK(FontBattleExtra), 3 lb bc, BANK(FontBattleExtra), 3
call Get2bpp_2 call Get2bpp_2
call LoadFrame call LoadFrame

View File

@ -1,53 +1,63 @@
; Control characters ; Control characters
charmap "<START>", $00 charmap "<START>", $00
charmap "<PLAY_G>", $14 ; <PLAYER> + gender charmap "<PLAY_G>", $14 ; gendered PlayerName; same as "<PLAYER>" in English
charmap "<DAY>", $15 charmap "<DAY>", $15
charmap "¯", $1f charmap "¯", $1f ; soft linebreak
charmap "<LNBRK>", $22 charmap "<LNBRK>", $22
charmap "<POKE>", $24 charmap "<POKE>", $24 ; "<PO><KE>"
charmap "%", $25 charmap "%", $25
charmap "<RED>", $38 charmap "<RED>", $38 ; RedsName
charmap "<GREEN>", $39 charmap "<GREEN>", $39 ; GreensName
charmap "<ENEMY>", $3f charmap "<ENEMY>", $3f
charmap "<SHINY>", $3f charmap "<MOM>", $49 ; MomsName
charmap "<MOM>", $49 charmap "<PKMN>", $4a ; "<PK><MN>"
charmap "<PKMN>", $4a
charmap "<NEXT>", $4e charmap "<NEXT>", $4e
charmap "<LINE>", $4f charmap "<LINE>", $4f
charmap "@", $50 charmap "@", $50
charmap "<PARA>", $51 charmap "<PARA>", $51
charmap "<PLAYER>", $52 charmap "<PLAYER>", $52 ; PlayerName
charmap "<RIVAL>", $53 charmap "<RIVAL>", $53
charmap "#", $54 charmap "#", $54
charmap "<CONT>", $55 charmap "<CONT>", $55
charmap "<......>", $56 charmap "<......>", $56 ; "……"
charmap "<DONE>", $57 charmap "<DONE>", $57
charmap "<PROMPT>", $58 charmap "<PROMPT>", $58
charmap "<TARGET>", $59 charmap "<TARGET>", $59
charmap "<USER>", $5a charmap "<USER>", $5a
charmap "<PC>", $5b charmap "<PC>", $5b ; "PC"
charmap "<TM>", $5c charmap "<TM>", $5c ; "TM"
charmap "<TRNER>", $5d charmap "<TRNER>", $5d ; "TRAINER"
charmap "<ROCKET>", $5e charmap "<ROCKET>", $5e ; "ROCKET"
charmap "<DEXEND>", $5f charmap "<DEXEND>", $5f
; Actual characters ; Actual characters (from gfx/misc/font_extra.png)
charmap "▲", $61
charmap "_", $62
charmap "<COLON>", $6d ; necessary because ":" is already used
charmap "", $6e
charmap "<LV>", $6e
charmap "″", $6f
charmap "<BOLD_A>", $60 ; unused
charmap "<BOLD_B>", $61 ; unused
charmap "<BOLD_C>", $62 ; unused
charmap "<BOLD_D>", $63 ; unused
charmap "<BOLD_E>", $64 ; unused
charmap "<BOLD_F>", $65 ; unused
charmap "<BOLD_G>", $66 ; unused
charmap "<BOLD_H>", $67 ; unused
charmap "<BOLD_I>", $68 ; unused
charmap "<BOLD_V>", $69
charmap "<BOLD_S>", $6a
charmap "<BOLD_L>", $6b ; unused
charmap "<BOLD_M>", $6c ; unused
charmap "<COLON>", $6d ; colon with tinier dots than ":"
charmap "ぃ", $6e ; hiragana small i, unused
charmap "ぅ", $6f ; hiragana small u, unused
charmap "<PO>", $70 charmap "<PO>", $70
charmap "<KE>", $71 charmap "<KE>", $71
charmap "◀", $71 charmap "<``>", $72 ; opening quote
charmap "<``>", $72 charmap "<''>", $73 ; closing quote
charmap "<''>", $73 charmap "·", $74 ; middle dot, unused
charmap "<ID>", $73 charmap "…", $75 ; ellipsis
charmap "№", $74 charmap "ぁ", $76 ; hiragana small a, unused
charmap "…", $75 charmap "ぇ", $77 ; hiragana small e, unused
charmap "ぉ", $78 ; hiragana small o, unused
charmap "┌", $79 charmap "┌", $79
charmap "─", $7a charmap "─", $7a
@ -57,6 +67,32 @@
charmap "┘", $7e charmap "┘", $7e
charmap " ", $7f charmap " ", $7f
; Actual characters (from gfx/misc/font_battle_extra.png)
charmap "<LV>", $6e
charmap "<ど>", $70 ; hiragana small do, unused
charmap "◀", $71
charmap "『", $72 ; Japanese opening quote, unused
charmap "<ID>", $73
charmap "№", $74
; Actual characters (from other graphics files)
charmap "|", $31 ; StatsScreenPageTilesGFX
charmap "<SHINY>", $3f ; ShinyIcon
charmap "<BLACK>", $60 ; MobilePhoneTilesGFX
charmap "▲", $61 ; FontsExtra2_UpArrowGFX
charmap "<PHONE>", $62 ; OverworldPhoneIconGFX
charmap "_", $62 ; HPExpBarBorderGFX
charmap "", $6e ; Magikarp_LoadFeetInchesChars.feetinchchars
charmap "″", $6f ; Magikarp_LoadFeetInchesChars.feetinchchars
; Actual characters (from gfx/misc/font.png)
charmap "A", $80 charmap "A", $80
charmap "B", $81 charmap "B", $81
charmap "C", $82 charmap "C", $82
@ -152,7 +188,7 @@
charmap "♂", $ef charmap "♂", $ef
charmap "¥", $f0 charmap "¥", $f0
charmap "×", $f1 charmap "×", $f1
charmap "·", $f2 charmap "<PERIOD>", $f2 ; same as "." in English
charmap "/", $f3 charmap "/", $f3
charmap ",", $f4 charmap ",", $f4
charmap "♀", $f5 charmap "♀", $f5
@ -168,8 +204,7 @@
charmap "8", $fe charmap "8", $fe
charmap "9", $ff charmap "9", $ff
; Japanese, for those bits of text that ; Japanese kana, for those bits of text that were not translated to English
; were not translated to English.
charmap "ガ", $5 charmap "ガ", $5
charmap "ギ", $6 charmap "ギ", $6

View File

@ -1,16 +1,12 @@
text EQUS "db $00," ; Start writing text. text EQUS "db $00," ; Start writing text.
next EQUS "db $4e," ; Move a line down. next EQUS "db $4e," ; Move a line down.
line EQUS "db $4f," ; Start writing at the bottom line. line EQUS "db $4f," ; Start writing at the bottom line.
page EQUS "db $50," ; Start a new Pokedex page.
para EQUS "db $51," ; Start a new paragraph. para EQUS "db $51," ; Start a new paragraph.
cont EQUS "db $55," ; Scroll to the next line. cont EQUS "db $55," ; Scroll to the next line.
done EQUS "db $57" ; End a text box. done EQUS "db $57" ; End a text box.
prompt EQUS "db $58" ; Prompt the player to end a text box (initiating some other event). prompt EQUS "db $58" ; Prompt the player to end a text box (initiating some other event).
; Pokedex text commands are only used with pokered.
; They are included for compatibility.
page EQUS "db $50," ; Start a new Pokedex page.
dex EQUS "db $e8, $50" ; End a Pokedex entry.
; TX_RAM EQU $01 ; TX_RAM EQU $01
; TX_FAR EQU $16 ; TX_FAR EQU $16
enum_start 1 enum_start 1

View File

@ -92,7 +92,7 @@ ReanchorBGMap_NoOAMUpdate:: ; 6454
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
ld [hWY], a ld [hWY], a
callba HDMATransfer_FillBGMap0WithTile60 ; no need to farcall callba HDMATransfer_FillBGMap0WithBlack ; no need to farcall
ld a, VBGMap0 / $100 ld a, VBGMap0 / $100
call .LoadBGMapAddrIntoHRAM call .LoadBGMapAddrIntoHRAM
xor a xor a
@ -131,13 +131,13 @@ LoadFonts_NoOAMUpdate:: ; 64bf
call LoadStandardFont call LoadStandardFont
ret ret
HDMATransfer_FillBGMap0WithTile60: ; 64db HDMATransfer_FillBGMap0WithBlack: ; 64db
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, $6
ld [rSVBK], a ld [rSVBK], a
ld a, $60 ld a, "<BLACK>" ; $60
ld hl, wDecompressScratch ld hl, wDecompressScratch
ld bc, wScratchAttrMap - wDecompressScratch ld bc, wScratchAttrMap - wDecompressScratch
call ByteFill call ByteFill

View File

@ -1313,7 +1313,7 @@ MobileTradeAnim_DisplayEggData
.EggTemplate: ; 108a1d .EggTemplate: ; 108a1d
db "タマゴ" db "タマゴ"
next "おや/?????" next "おや/?????"
next "<ID>№·?????" next "<ID>№<PERIOD>?????"
db "@" db "@"
; 108a33 ; 108a33
@ -1353,10 +1353,10 @@ MobileTradeAnim_LoadMonTemplate: ; 108a5b
; 108a79 ; 108a79
.MonTemplate: ; 108a79 .MonTemplate: ; 108a79
db "─ №·" db "─ №<PERIOD>"
next "" next ""
next "おや/" next "おや/"
next "<ID>№·" next "<ID>№<PERIOD>"
db "@" db "@"
; 108a87 ; 108a87