diff options
author | Daniel Harding <33dannye@gmail.com> | 2018-07-18 17:20:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 17:20:30 -0500 |
commit | 783f5fe610c69006742b4976ab4f183f39512d89 (patch) | |
tree | cdbe7ea8c0430e64a89cad5e93b250f6291677c9 /src | |
parent | 169dc3d8fdd5603efd1766acd9ad1b8c23093e7f (diff) | |
parent | eb87f849ff7a0ec07a27035fb183234ed04ef540 (diff) |
Merge pull request #46 from xCrystal/master
Finish bank 0 disasm ; Text engine and charmaps
Diffstat (limited to 'src')
39 files changed, 2614 insertions, 1003 deletions
diff --git a/src/constants.asm b/src/constants.asm index 7755766..c3af333 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -12,3 +12,4 @@ INCLUDE "constants/music_constants.asm" INCLUDE "constants/npc_constants.asm" INCLUDE "constants/sgb_constants.asm" INCLUDE "constants/text_constants.asm" +INCLUDE "constants/charmaps.asm" diff --git a/src/constants/charmaps.asm b/src/constants/charmaps.asm new file mode 100644 index 0000000..5bd21be --- /dev/null +++ b/src/constants/charmaps.asm @@ -0,0 +1,366 @@ +; control characters + charmap "<RAMNAME>", TX_RAM1 + charmap "<RAMTEXT>", TX_RAM2 + charmap "<RAMNUM>", TX_RAM3 + +; ascii half-width font + charmap "é", "`" + charmap "♂", "$" + charmap "♀", "%" + charmap "”", "\"" + +; TX_FULLWIDTH3 + fwcharmap 3, "A", $30 + fwcharmap 3, "B", $31 + fwcharmap 3, "C", $32 + fwcharmap 3, "D", $33 + fwcharmap 3, "E", $34 + fwcharmap 3, "F", $35 + fwcharmap 3, "G", $36 + fwcharmap 3, "H", $37 + fwcharmap 3, "I", $38 + fwcharmap 3, "J", $39 + fwcharmap 3, "K", $3a + fwcharmap 3, "L", $3b + fwcharmap 3, "M", $3c + fwcharmap 3, "N", $3d + fwcharmap 3, "O", $3e + fwcharmap 3, "P", $3f + fwcharmap 3, "Q", $40 + fwcharmap 3, "R", $41 + fwcharmap 3, "S", $42 + fwcharmap 3, "T", $43 + fwcharmap 3, "U", $44 + fwcharmap 3, "V", $45 + fwcharmap 3, "W", $46 + fwcharmap 3, "X", $47 + fwcharmap 3, "Y", $48 + fwcharmap 3, "Z", $49 + fwcharmap 3, "g", $4a + fwcharmap 3, "c", $4b + fwcharmap 3, "m", $4c + fwcharmap 3, "r.", $4d + fwcharmap 3, "♀", $4e + fwcharmap 3, "♂", $4f + fwcharmap 3, "【", $50 + fwcharmap 3, "】", $51 + fwcharmap 3, "●", $52 + fwcharmap 3, "◆", $53 + fwcharmap 3, "★", $54 + fwcharmap 3, "☆", $55 + fwcharmap 3, "_", $56 + fwcharmap 3, "■", $57 + fwcharmap 3, "ºC", $58 + fwcharmap 3, "“", $59 + fwcharmap 3, "º", $5a + fwcharmap 3, "º(2)", $5b ; duplicate + fwcharmap 3, "̳ ", $5c + fwcharmap 3, "&", $5d + fwcharmap 3, ":", $5e + fwcharmap 3, "○", $5f + fwcharmap 3, "❄", $60 + fwcharmap 3, "^", $62 + fwcharmap 3, "♪", $63 + fwcharmap 3, "a", $64 + fwcharmap 3, "b", $65 + fwcharmap 3, "d", $66 + fwcharmap 3, "e", $67 + fwcharmap 3, "f", $68 + fwcharmap 3, "h", $69 + fwcharmap 3, "i", $6a + fwcharmap 3, "j", $6b + fwcharmap 3, "k", $6c + fwcharmap 3, "l", $6d + fwcharmap 3, "n", $6e + fwcharmap 3, "o", $6f + fwcharmap 3, "p", $70 + fwcharmap 3, "q", $71 + fwcharmap 3, "s", $72 + fwcharmap 3, "t", $73 + fwcharmap 3, "u", $74 + fwcharmap 3, "v", $75 + fwcharmap 3, "w", $76 + fwcharmap 3, "x", $77 + fwcharmap 3, "y", $78 + fwcharmap 3, "z", $79 + fwcharmap 3, "'", $7a + fwcharmap 3, "”", $7b + fwcharmap 3, "r", $8e + fwcharmap 3, "┌", $97 + fwcharmap 3, "\", $98 + fwcharmap 3, "┐", $99 + fwcharmap 3, "|", $9a + fwcharmap 3, "!", $9d + fwcharmap 3, "#", $9f + fwcharmap 3, "$", $a0 + fwcharmap 3, "%", $a1 + fwcharmap 3, "(", $a4 + fwcharmap 3, ")", $a5 + fwcharmap 3, "*", $a6 + fwcharmap 3, "+", $a7 + fwcharmap 3, "、", $a8 + fwcharmap 3, "-", $a9 + fwcharmap 3, "/", $ab + fwcharmap 3, "0", $ac + fwcharmap 3, "1", $ad + fwcharmap 3, "2", $ae + fwcharmap 3, "3", $af + fwcharmap 3, "4", $b0 + fwcharmap 3, "5", $b1 + fwcharmap 3, "6", $b2 + fwcharmap 3, "7", $b3 + fwcharmap 3, "8", $b4 + fwcharmap 3, "9", $b5 + fwcharmap 3, ";", $b7 + fwcharmap 3, "<", $b8 + fwcharmap 3, "=", $b9 + fwcharmap 3, ">", $ba + fwcharmap 3, "?", $bb + fwcharmap 3, "@", $bc + fwcharmap 3, "[", $d7 + fwcharmap 3, "¥", $d8 + fwcharmap 3, "]", $d9 + +; TX_KATAKANA + fwcharmap 0, "ヲ", $10 + fwcharmap 0, "ア", $11 + fwcharmap 0, "イ", $12 + fwcharmap 0, "ウ", $13 + fwcharmap 0, "エ", $14 + fwcharmap 0, "オ", $15 + fwcharmap 0, "カ", $16 + fwcharmap 0, "キ", $17 + fwcharmap 0, "ク", $18 + fwcharmap 0, "ケ", $19 + fwcharmap 0, "コ", $1a + fwcharmap 0, "サ", $1b + fwcharmap 0, "シ", $1c + fwcharmap 0, "ス", $1d + fwcharmap 0, "セ", $1e + fwcharmap 0, "ソ", $1f + fwcharmap 0, "タ", $20 + fwcharmap 0, "チ", $21 + fwcharmap 0, "ツ", $22 + fwcharmap 0, "テ", $23 + fwcharmap 0, "ト", $24 + fwcharmap 0, "ナ", $25 + fwcharmap 0, "ニ", $26 + fwcharmap 0, "ヌ", $27 + fwcharmap 0, "ネ", $28 + fwcharmap 0, "ノ", $29 + fwcharmap 0, "ハ", $2a + fwcharmap 0, "ヒ", $2b + fwcharmap 0, "フ", $2c + fwcharmap 0, "ヘ", $2d + fwcharmap 0, "ホ", $2e + fwcharmap 0, "マ", $2f + fwcharmap 0, "ミ", $30 + fwcharmap 0, "ム", $31 + fwcharmap 0, "メ", $32 + fwcharmap 0, "モ", $33 + fwcharmap 0, "ヤ", $34 + fwcharmap 0, "ユ", $35 + fwcharmap 0, "ヨ", $36 + fwcharmap 0, "ラ", $37 + fwcharmap 0, "リ", $38 + fwcharmap 0, "ル", $39 + fwcharmap 0, "レ", $3a + fwcharmap 0, "ロ", $3b + fwcharmap 0, "ワ", $3c + fwcharmap 0, "ン", $3d + fwcharmap 0, "ガ", $3e + fwcharmap 0, "ギ", $3f + fwcharmap 0, "グ", $40 + fwcharmap 0, "ゲ", $41 + fwcharmap 0, "ゴ", $42 + fwcharmap 0, "ザ", $43 + fwcharmap 0, "ジ", $44 + fwcharmap 0, "ズ", $45 + fwcharmap 0, "ゼ", $46 + fwcharmap 0, "ゾ", $47 + fwcharmap 0, "ダ", $48 + fwcharmap 0, "ヂ", $49 + fwcharmap 0, "ヅ", $4a + fwcharmap 0, "デ", $4b + fwcharmap 0, "ド", $4c + fwcharmap 0, "バ", $4d + fwcharmap 0, "ビ", $4e + fwcharmap 0, "ブ", $4f + fwcharmap 0, "ベ", $50 + fwcharmap 0, "ボ", $51 + fwcharmap 0, "パ", $52 + fwcharmap 0, "ピ", $53 + fwcharmap 0, "プ", $54 + fwcharmap 0, "ペ", $55 + fwcharmap 0, "ポ", $56 + fwcharmap 0, "ァ", $57 + fwcharmap 0, "ィ", $58 + fwcharmap 0, "ゥ", $59 + fwcharmap 0, "ェ", $5a + fwcharmap 0, "ォ", $5b + fwcharmap 0, "ャ", $5c + fwcharmap 0, "ュ", $5d + fwcharmap 0, "ョ", $5e + fwcharmap 0, "ッ", $5f + +; TX_HIRAGANA + fwcharmap 0, "を", $10 + fwcharmap 0, "あ", $11 + fwcharmap 0, "い", $12 + fwcharmap 0, "う", $13 + fwcharmap 0, "え", $14 + fwcharmap 0, "お", $15 + fwcharmap 0, "か", $16 + fwcharmap 0, "き", $17 + fwcharmap 0, "く", $18 + fwcharmap 0, "け", $19 + fwcharmap 0, "こ", $1a + fwcharmap 0, "さ", $1b + fwcharmap 0, "し", $1c + fwcharmap 0, "す", $1d + fwcharmap 0, "せ", $1e + fwcharmap 0, "そ", $1f + fwcharmap 0, "た", $20 + fwcharmap 0, "ち", $21 + fwcharmap 0, "つ", $22 + fwcharmap 0, "て", $23 + fwcharmap 0, "と", $24 + fwcharmap 0, "な", $25 + fwcharmap 0, "に", $26 + fwcharmap 0, "ぬ", $27 + fwcharmap 0, "ね", $28 + fwcharmap 0, "の", $29 + fwcharmap 0, "は", $2a + fwcharmap 0, "ひ", $2b + fwcharmap 0, "ふ", $2c + fwcharmap 0, "へ", $2d + fwcharmap 0, "ほ", $2e + fwcharmap 0, "ま", $2f + fwcharmap 0, "み", $30 + fwcharmap 0, "む", $31 + fwcharmap 0, "め", $32 + fwcharmap 0, "も", $33 + fwcharmap 0, "や", $34 + fwcharmap 0, "ゆ", $35 + fwcharmap 0, "よ", $36 + fwcharmap 0, "ら", $37 + fwcharmap 0, "り", $38 + fwcharmap 0, "る", $39 + fwcharmap 0, "れ", $3a + fwcharmap 0, "ろ", $3b + fwcharmap 0, "わ", $3c + fwcharmap 0, "ん", $3d + fwcharmap 0, "が", $3e + fwcharmap 0, "ぎ", $3f + fwcharmap 0, "ぐ", $40 + fwcharmap 0, "げ", $41 + fwcharmap 0, "ご", $42 + fwcharmap 0, "ざ", $43 + fwcharmap 0, "じ", $44 + fwcharmap 0, "ず", $45 + fwcharmap 0, "ぜ", $46 + fwcharmap 0, "ぞ", $47 + fwcharmap 0, "だ", $48 + fwcharmap 0, "ぢ", $49 + fwcharmap 0, "づ", $4a + fwcharmap 0, "で", $4b + fwcharmap 0, "ど", $4c + fwcharmap 0, "ば", $4d + fwcharmap 0, "び", $4e + fwcharmap 0, "ぶ", $4f + fwcharmap 0, "べ", $50 + fwcharmap 0, "ぼ", $51 + fwcharmap 0, "ぱ", $52 + fwcharmap 0, "ぴ", $53 + fwcharmap 0, "ぷ", $54 + fwcharmap 0, "ぺ", $55 + fwcharmap 0, "ぽ", $56 + fwcharmap 0, "あ", $57 + fwcharmap 0, "い", $58 + fwcharmap 0, "う", $59 + fwcharmap 0, "え", $5a + fwcharmap 0, "お", $5b + fwcharmap 0, "ゃ", $5c + fwcharmap 0, "ゅ", $5d + fwcharmap 0, "ょ", $5e + fwcharmap 0, "っ", $5f + +; TX_KATAKANA, TX_HIRAGANA, and default font + fwcharmap 0, "0", $60 + fwcharmap 0, "1", $61 + fwcharmap 0, "2", $62 + fwcharmap 0, "3", $63 + fwcharmap 0, "4", $64 + fwcharmap 0, "5", $65 + fwcharmap 0, "6", $66 + fwcharmap 0, "7", $67 + fwcharmap 0, "8", $68 + fwcharmap 0, "9", $69 + fwcharmap 0, "+", $6a + fwcharmap 0, "-", $6b + fwcharmap 0, "✕", $6c + fwcharmap 0, "/", $6d + fwcharmap 0, "!", $6e + fwcharmap 0, "?", $6f + fwcharmap 0, " ", $70 + fwcharmap 0, "(", $71 + fwcharmap 0, ")", $72 + fwcharmap 0, "·", $77 + fwcharmap 0, "-(2)", $78 ; duplicate + +FW_SPACE EQU $70 + +; TX_SYMBOL +; TODO: If user-defined functions ever become a thing a symbol(*) syntax +; would probably be preferred over SYM_* + charmap "<", TX_SYMBOL + const_def + txsymbol SPACE ; $00 + txsymbol FIRE ; $01 + txsymbol GRASS ; $02 + txsymbol LIGHTNING ; $03 + txsymbol WATER ; $04 + txsymbol FIGHTING ; $05 + txsymbol PSYCHIC ; $06 + txsymbol COLORLESS ; $07 + txsymbol POISONED ; $08 + txsymbol ASLEEP ; $09 + txsymbol CONFUSED ; $0a + txsymbol PARALYZED ; $0b + txsymbol CURSOR_U ; $0c + txsymbol POKEMON ; $0d + txsymbol UNKNOWN_0E ; $0e + txsymbol CURSOR_R ; $0f + txsymbol HP ; $10 + txsymbol Lv ; $11 + txsymbol E ; $12 + txsymbol No ; $13 + txsymbol PLUSPOWER ; $14 + txsymbol DEFENDER ; $15 + txsymbol HP_OK ; $16 + txsymbol HP_NOK ; $17 + txsymbol BOX_TOP_L ; $18 + txsymbol BOX_TOP_R ; $19 + txsymbol BOX_BTM_L ; $1a + txsymbol BOX_BTM_R ; $1b + txsymbol BOX_TOP ; $1c + txsymbol BOX_BOTTOM ; $1d + txsymbol BOX_LEFT ; $1e + txsymbol BOX_RIGHT ; $1f + txsymbol 0 ; $20 + txsymbol 1 ; $21 + txsymbol 2 ; $22 + txsymbol 3 ; $23 + txsymbol 4 ; $24 + txsymbol 5 ; $25 + txsymbol 6 ; $26 + txsymbol 7 ; $27 + txsymbol 8 ; $28 + txsymbol 9 ; $29 + txsymbol DOT ; $2a + txsymbol PLUS ; $2b + txsymbol MINUS ; $2c + txsymbol CROSS ; $2d + txsymbol SLASH ; $2e + txsymbol CURSOR_D ; $2f + txsymbol PRIZE ; $30 diff --git a/src/constants/gfx_constants.asm b/src/constants/gfx_constants.asm index f5915d3..4ab84d2 100644 --- a/src/constants/gfx_constants.asm +++ b/src/constants/gfx_constants.asm @@ -14,6 +14,9 @@ palettes EQUS "* CGB_PAL_SIZE" TILE_SIZE EQU 16 ; bytes tiles EQUS "* TILE_SIZE" +TILE_SIZE_1BPP EQU 8 ; bytes +tiles_1bpp EQUS "* TILE_SIZE_1BPP" + ; wFlushPaletteFlags constants FLUSH_ONE EQU %10000000 FLUSH_ALL EQU %11000000 diff --git a/src/constants/hardware_constants.asm b/src/constants/hardware_constants.asm index a93e250..fe2731f 100644 --- a/src/constants/hardware_constants.asm +++ b/src/constants/hardware_constants.asm @@ -2,8 +2,6 @@ GBC EQU $11 -LY_VBLANK EQU 145 - ; MBC3 MBC3SRamEnable EQU $0000 MBC3RomBank EQU $2000 @@ -79,11 +77,12 @@ rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W) rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W) rNR52 EQU $ff26 ; Sound on/off rLCDC EQU $ff40 ; LCD Control (R/W) -LCDC_ON EQU 7 +LCDC_ON EQU 7 rSTAT EQU $ff41 ; LCDC Status (R/W) rSCY EQU $ff42 ; Scroll Y (R/W) rSCX EQU $ff43 ; Scroll X (R/W) rLY EQU $ff44 ; LCDC Y-Coordinate (R) +LY_VBLANK EQU 145 rLYC EQU $ff45 ; LY Compare (R/W) rDMA EQU $ff46 ; DMA Transfer and Start Address (W) rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only diff --git a/src/constants/text_constants.asm b/src/constants/text_constants.asm index b5e6e22..3a50b59 100644 --- a/src/constants/text_constants.asm +++ b/src/constants/text_constants.asm @@ -1,72 +1,49 @@ -TX_END EQU $00 -TX_SYMBOL EQU $05 -TX_START EQU $06 -TX_RAM1 EQU $09 -TX_LINE EQU "\n" ; $0a -TX_RAM2 EQU $0B -TX_RAM3 EQU $0C +TX_END EQU $00 ; terminates the text -text EQUS "db TX_START, " -line EQUS "db TX_LINE, " -done EQUS "db TX_END" +; usage: TX_FULLWIDTH*, char1, TX_FULLWIDTH*, char2, ... +; source: gfx/fonts/full_width/1_kanji2.1bpp +TX_FULLWIDTH1 EQU $01 +; source: gfx/fonts/full_width/2_kanji3.1bpp +TX_FULLWIDTH2 EQU $02 +; source: gfx/fonts/full_width/3.1bpp (contains latin letters and symbols) +TX_FULLWIDTH3 EQU $03 +; source: gfx/fonts/full_width/4.1bpp +TX_FULLWIDTH4 EQU $04 - charmap "é", "`" - charmap "♂", "$" - charmap "♀", "%" - charmap "”", "\"" +TX_CTRL_START EQU $05 -; TX_SYMBOL (full-tile icons/symbols loaded at the beginning of v0Tiles2) -; TODO: Use symbols in menus (cursor tile number, tile behind cursor), draw text boxes, WriteByteToBGMap0, etc -; If user-defined functions ever become a thing a symbol(*) syntax would probably be preferred over SYM_* +; usage: TX_SYMBOL, char1, TX_SYMBOL, char2, ... +; source: gfx/fonts/symbols.2bpp +TX_SYMBOL EQU $05 - charmap "<", TX_SYMBOL - const_def - txsymbol SPACE ; $00 - txsymbol FIRE ; $01 - txsymbol GRASS ; $02 - txsymbol LIGHTNING ; $03 - txsymbol WATER ; $04 - txsymbol FIGHTING ; $05 - txsymbol PSYCHIC ; $06 - txsymbol COLORLESS ; $07 - txsymbol POISONED ; $08 - txsymbol ASLEEP ; $09 - txsymbol CONFUSED ; $0a - txsymbol PARALYZED ; $0b - txsymbol CURSOR_U ; $0c - txsymbol POKEMON ; $0d - txsymbol UNKNOWN_0E ; $0e - txsymbol CURSOR_R ; $0f - txsymbol HP ; $10 - txsymbol Lv ; $11 - txsymbol E ; $12 - txsymbol No ; $13 - txsymbol PLUSPOWER ; $14 - txsymbol DEFENDER ; $15 - txsymbol HP_OK ; $16 - txsymbol HP_NOK ; $17 - txsymbol BOX_TOP_L ; $18 - txsymbol BOX_TOP_R ; $19 - txsymbol BOX_BTM_L ; $1a - txsymbol BOX_BTM_R ; $1b - txsymbol BOX_TOP ; $1c - txsymbol BOX_BOTTOM ; $1d - txsymbol BOX_LEFT ; $1e - txsymbol BOX_RIGHT ; $1f - txsymbol 0 ; $20 - txsymbol 1 ; $21 - txsymbol 2 ; $22 - txsymbol 3 ; $23 - txsymbol 4 ; $24 - txsymbol 5 ; $25 - txsymbol 6 ; $26 - txsymbol 7 ; $27 - txsymbol 8 ; $28 - txsymbol 9 ; $29 - txsymbol DOT ; $2a - txsymbol PLUS ; $2b - txsymbol MINUS ; $2c - txsymbol x ; $2d - txsymbol SLASH ; $2e - txsymbol CURSOR_D ; $2f - txsymbol PRIZE ; $30 +; usage: TX_HALFWIDTH, char1, char2, ... +; source: gfx/fonts/half_width.1bpp +TX_HALFWIDTH EQU $06 ; sets wFontWidth to HALF_WIDTH + +; usage: <half width text>, TX_HALF2FULL, <full width text> +TX_HALF2FULL EQU $07 ; sets wFontWidth to FULL_WIDTH, and hJapaneseSyllabary to TX_KATAKANA + +TX_RAM1 EQU $09 ; prints the player's name or, in a duel, the turn duelist's name +TX_LINE EQU "\n" ; advances to a new line +TX_RAM2 EQU $0b ; prints text from wTxRam2 or wTxRam2_b +TX_RAM3 EQU $0c ; prints a number from wTxRam3 or wTxRam3_b + +; usage: TX_FULLWIDTH*, char1, char2, ... +; sources: + ; gfx/fonts/full_width/0_1_hiragana.1bpp (characters below $60) + ; gfx/fonts/full_width/0_2_digits_kanji1.1bpp (characters above or equal to $60) +TX_HIRAGANA EQU $0e ; sets hJapaneseSyllabary to TX_HIRAGANA +; sources: + ; gfx/fonts/full_width/0_0_katakana.1bpp (characters below $60) + ; gfx/fonts/full_width/0_2_digits_kanji1.1bpp (characters above or equal to $60) +TX_KATAKANA EQU $0f ; sets hJapaneseSyllabary to TX_KATAKANA + +; db char1, char2, ... defaults to the value at hJapaneseSyllabary, unless +; wFontWidth was set to HALF_WIDTH by TX_HALFWIDTH (it is FULL_WIDTH by default). +; hJapaneseSyllabary is TX_KATAKANA by default. + +TX_CTRL_END EQU $10 + +; wFontWidth constants +FULL_WIDTH EQU $0 +HALF_WIDTH EQU $1 ; non-0 diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 97fe32a..9ca9c10 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -13,7 +13,7 @@ GameLoop: ; 4000 (1:4000) ld [wccf2], a call DisableSRAM ld a, 1 - ld [wUppercaseVWFLetters], a + ld [wUppercaseHalfWidthLetters], a ei farcall CommentedOut_1a6cc ldh a, [hButtonsHeld] @@ -38,14 +38,14 @@ GameLoop: ; 4000 (1:4000) Func_4050: ; 4050 (1:4050) farcall Func_1996e ld a, 1 - ld [wUppercaseVWFLetters], a + ld [wUppercaseHalfWidthLetters], a ret Func_405a: ; 405a (1:405a) xor a ld [wTileMapFill], a call DisableLCD - call LoadDuelHUDTiles + call LoadSymbolsFont call SetDefaultPalettes ld de, $387f call Func_2275 @@ -281,7 +281,7 @@ Func_420b: ; 420b (1:420b) ld [wTileMapFill], a call ZeroObjectPositionsAndToggleOAMCopy call EmptyScreen - call LoadDuelHUDTiles + call LoadSymbolsFont call SetDefaultPalettes ld de, $389f call Func_2275 @@ -320,9 +320,9 @@ HandleTurn: ; 4225 (1:4225) call c, DisplayPlayerDrawCardScreen jr DuelMainInterface -; display the animation of the player drawing the card at hTempCardIndex_ff98 -; save duel state to SRAM, and fall through to DuelMainInterface to effectively -; begin the turn +; display the animation of the player drawing the card at hTempCardIndex_ff98, +; save duel state to SRAM, and fall through to DuelMainInterface +; to effectively begin the turn HandleTurn_PlayerDrewCard: call DisplayPlayerDrawCardScreen call SaveDuelStateToSRAM @@ -345,7 +345,7 @@ DuelMainInterface: ; 426d (1:426d) jp z, $6911 ; DUELIST_TYPE_AI_OPP xor a - ld [wVBlankCtr], a + ld [wVBlankCounter], a ld [wcbf9], a ldtx hl, DuelistIsThinkingText call DrawWideTextBox_PrintTextNoDelay @@ -929,7 +929,7 @@ Func_4611: ; 4611 (1:4611) jr nc, .asm_466a ldh a, [hTempCardIndex_ff98] call RemoveCardFromDuelTempList - call Func_4693 + call DisplayEnergyDiscardScreen jr .asm_4633 .asm_466a ld a, [wcbd5] @@ -956,7 +956,9 @@ Func_4673: ; 4673 (1:4673) ld [wcbfa], a ; fallthrough -Func_4693: ; 4693 (1:4693) +; display the screen that prompts the player to select energy cards to discard +; in order to retreat a Pokemon card +DisplayEnergyDiscardScreen: ; 4693 (1:4693) lb de, 0, 3 lb bc, 20, 10 call DrawRegularTextBox @@ -1556,28 +1558,28 @@ Func_49ed: ; 49ed (1:49ed) INCROM $4a35, $4a97 Func_4a97: ; 4a97 (1:4a97) - call LoadDuelHUDTiles + call LoadSymbolsFont ld de, wDefaultText push de call CopyPlayerName lb de, 0, 11 - call Func_22ae + call InitTextPrinting pop hl - call Func_21c5 + call ProcessText ld bc, $5 call Func_3e10 ld de, wDefaultText push de call CopyOpponentName pop hl - call Func_23c1 + call GetTextSizeInTiles push hl add SCREEN_WIDTH ld d, a ld e, 0 - call Func_22ae + call InitTextPrinting pop hl - call Func_21c5 + call ProcessText ld a, [wOpponentPortrait] ld bc, $d01 call Func_3e2a @@ -1660,7 +1662,7 @@ Func_4b38: ; 4b38 (1:4b38) call PrintCardListItems ldtx hl, TheCardYouReceivedText lb de, 1, 1 - call Func_22ae + call InitTextPrinting call PrintTextNoDelay ldtx hl, YouReceivedTheseCardsText call DrawWideTextBox_WaitForInput @@ -1912,7 +1914,7 @@ Func_4e40: ; 4e40 (1:4e40) call PrintCardListItems ldtx hl, DuelistHandText lb de, 1, 1 - call Func_22ae + call InitTextPrinting call PrintTextNoDelay call EnableLCD ret @@ -2001,7 +2003,7 @@ DrawDuelMainScene: ; 4f9d (1:4f9d) ret z call ZeroObjectPositionsAndToggleOAMCopy call EmptyScreen - call LoadDuelHUDTiles + call LoadSymbolsFont ld a, $01 ld [wcac2], a ld a, DUELVARS_ARENA_CARD @@ -2147,13 +2149,13 @@ DrawDuelHUD: ; 5093 (1:5093) or a jr nz, .print_color_icon ld hl, wDefaultText - call Func_23c1 + call GetTextSizeInTiles add SCREEN_WIDTH ld d, a .print_color_icon - call Func_22ae + call InitTextPrinting ld hl, wDefaultText - call Func_21c5 + call ProcessText push de pop bc call GetArenaCardColor @@ -2505,7 +2507,7 @@ DrawCardListScreenLayout: ; 559a (1:559a) .draw call ZeroObjectPositionsAndToggleOAMCopy call EmptyScreen - call LoadDuelHUDTiles + call LoadSymbolsFont call LoadDuelCardSymbolTiles ; draw the surrounding box lb de, 0, 0 @@ -2631,7 +2633,7 @@ Func_5690: ; 5690 (1:5690) Func_56a0: ; 56a0 (1:56a0) lb de, 1, 14 call AdjustCoordinatesForBGScroll - call Func_22ae + call InitTextPrinting ld hl, wCardListInfoBoxText ld a, [hli] ld h, [hl] @@ -2642,7 +2644,7 @@ Func_56a0: ; 56a0 (1:56a0) ld h, [hl] ld l, a lb de, 1, 1 - call Func_22ae + call InitTextPrinting call PrintTextNoDelay ret ; 0x56c2 @@ -3309,7 +3311,7 @@ _DisplayCardDetailScreen: ; 5e5f (1:5e5f) DrawLargePictureOfCard: ; 5e75 (1:5e75) call ZeroObjectPositionsAndToggleOAMCopy call EmptyScreen - call LoadDuelHUDTiles + call LoadSymbolsFont call SetDefaultPalettes ld a, $08 ld [wcac2], a @@ -3687,7 +3689,7 @@ Func_6510: ; 6510 (1:6510) call LoadDuelCheckPokemonScreenTiles call Func_622a lb de, 1, 4 - call Func_22ae + call InitTextPrinting ld hl, wLoadedCard1Move1Name call Func_2c20 lb de, 1, 6 @@ -3707,7 +3709,7 @@ Func_653e: ; 653e (1:653e) dec e .asm_654c ld a, 19 - call Func_22a6 + call InitTextPrintingInTextbox call Func_2c29 call Func_5f50 ret @@ -3831,12 +3833,12 @@ Func_6673: ; 6673 (1:6673) call EmptyScreen call Func_5f4a lb de, 1, 1 - call Func_22ae + call InitTextPrinting ld hl, wLoadedCard1Name call Func_2c23 ld a, 19 lb de, 1, 3 - call Func_22a6 + call InitTextPrintingInTextbox ld hl, wLoadedCard1NonPokemonDescription call Func_2c23 call Func_5f50 @@ -3901,7 +3903,7 @@ AIMakeDecision: ; 67be (1:67be) jr nz, .skip_delay .delay_loop call DoFrame - ld a, [wVBlankCtr] + ld a, [wVBlankCounter] cp $3c jr c, .delay_loop @@ -3918,7 +3920,7 @@ AIMakeDecision: ; 67be (1:67be) ld a, [wcbf9] or a ret nz - ld [wVBlankCtr], a + ld [wVBlankCounter], a ldtx hl, DuelistIsThinkingText call DrawWideTextBox_PrintTextNoDelay or a @@ -4441,7 +4443,7 @@ _TossCoin: ; 71ad (1:71ad) call EnableLCD lb de, 1, 14 ld a, 19 - call Func_22a6 + call InitTextPrintingInTextbox ld hl, wCoinTossScreenTextID ld a, [hli] ld h, [hl] diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index 87810fa..4f88d0a 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -46,7 +46,7 @@ Func_8d56: ; 8d56 (2:4d56) call ZeroObjectPositions ld a, $1 ld [wVBlankOAMCopyToggle], a - call LoadDuelHUDTiles + call LoadSymbolsFont call LoadDuelCardSymbolTiles call Func_8d0b bank1call SetDefaultPalettes @@ -670,7 +670,7 @@ Func_9253: ; 9253 (2:5253) ld de, wDefaultText call Func_92ad ld hl, wDefaultText - call Func_23c1 + call GetTextSizeInTiles ld b, $0 ld hl, wDefaultText add hl, bc @@ -689,7 +689,7 @@ Func_926e: ; 926e (2:526e) ld de, wDefaultText call Func_92b4 ld hl, wDefaultText - call Func_23c1 + call GetTextSizeInTiles ld b, $0 ld hl, wDefaultText add hl, bc @@ -699,12 +699,12 @@ Func_926e: ; 926e (2:526e) call Func_92ad pop de ld hl, wDefaultText - call Func_22ae - call Func_21c5 + call InitTextPrinting + call ProcessText or a ret .asm_929c - call Func_22ae + call InitTextPrinting ldtx hl, NewDeckText call Func_2c29 scf diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index 865cc5b..744a3ef 100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -14,7 +14,7 @@ LoadMap: ; c000 (3:4000) call ZeroObjectPositions xor a ld [wTileMapFill], a - call LoadDuelHUDTiles + call LoadSymbolsFont call Set_OBJ_8x8 xor a ld [wLineSeparation], a @@ -417,7 +417,7 @@ Func_c2db: ; c2db (3:42db) ld a, [hld] ld l, [hl] ld h, a - call Func_3c45 + call CallHL2 .asm_c323 farcall Func_10af9 pop de @@ -677,7 +677,7 @@ Func_c58b: ; c58b (3:458b) ld b, a ld a, [wPlayerYCoord] ld c, a - call GetFloorObjectFromPos + call GetPermissionOfMapPosition and $10 push af ld c, SPRITE_ANIM_FIELD_0F @@ -776,7 +776,7 @@ AttemptScriptedMovement: ; c619 (3:4619) ld a, c cp $1f jr nc, .quit_movement - call GetFloorObjectFromPos + call GetPermissionOfMapPosition and $40 | $80 ; the two impassable objects found in the floor map jr nz, .quit_movement ld a, b @@ -943,7 +943,7 @@ Func_c71e: ; c71e (3:471e) ld a, $ff ld [wd3b6], a call Func_c653 - call GetFloorObjectFromPos + call GetPermissionOfMapPosition and $40 jr z, .asm_c73d farcall Func_1c72e @@ -1246,7 +1246,7 @@ Func_c943: ; c943 (3:4943) ld h, a or l jr z, .asm_c97a - call Func_3c45 + call CallHL2 jr nc, .asm_c988 .asm_c97a ld a, [wd3ab] diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm index 215132c..28108fb 100644 --- a/src/engine/bank04.asm +++ b/src/engine/bank04.asm @@ -2,7 +2,7 @@ Func_10000: ; 10000 (4:4000) ld a, $0 ld [wTileMapFill], a call EmptyScreen - call LoadDuelHUDTiles + call LoadSymbolsFont ld de, $307f call Func_2275 call Set_OBJ_8x8 @@ -435,7 +435,7 @@ Func_10f2e: ; 10f2e (4:4f2e) push hl push de lb de, 1, 1 - call Func_22ae + call InitTextPrinting call Func_10f4a rlca ld e, a diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm index 7c19b74..fc5e5c4 100644 --- a/src/engine/bank06.asm +++ b/src/engine/bank06.asm @@ -11,7 +11,7 @@ _CopyCardNameAndLevel: ; 18000 (6:4000) call CopyText ; copy card name to wDefaultText pop hl ld a, [hli] - cp TX_START + cp TX_HALFWIDTH jp z, Func_18086 ld a, [wcd9b] ld c, a @@ -38,7 +38,7 @@ _CopyCardNameAndLevel: ; 18000 (6:4000) pop hl push de ld e, c - call Func_23c1 + call GetTextSizeInTiles add e ld c, a pop hl diff --git a/src/engine/home.asm b/src/engine/home.asm index 29c9de2..a922861 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -99,7 +99,7 @@ VBlankHandler: ; 019b (0:019b) ei call wVBlankFunctionTrampoline call FlushPalettes - ld hl, wVBlankCtr + ld hl, wVBlankCounter inc [hl] ld hl, wReentrancyFlag res 0, [hl] @@ -120,7 +120,7 @@ TimerHandler: ; 01e6 (0:01e6) ei call SerialTimerHandler ; only trigger every fourth interrupt ≈ 60.24 Hz - ld hl, wCounterCtr + ld hl, wTimerCounter ld a, [hl] inc [hl] and $3 @@ -193,7 +193,7 @@ SetupTimer: ; 0241 (0:0241) ld [rTMA], a ld a, TAC_16384_HZ ld [rTAC], a - ld a, $7 + ld a, TAC_16384_HZ | 1 << TAC_ON ld [rTAC], a ret @@ -210,15 +210,15 @@ WaitForVBlank: ; 0264 (0:0264) push hl ld a, [wLCDC] bit LCDC_ON, a - jr z, .asm_275 - ld hl, wVBlankCtr + jr z, .lcd_off + ld hl, wVBlankCounter ld a, [hl] -.asm_270 +.wait_vblank halt nop cp [hl] - jr z, .asm_270 -.asm_275 + jr z, .wait_vblank +.lcd_off pop hl ret @@ -842,12 +842,12 @@ CallHL: ; 05c1 (0:05c1) ; 0x5c2 ; converts two one-digit numbers provided in a to text (ascii) format, -; writes them to [wcaa0] and [wcaa0 + 1], and to the BGMap0 address at bc +; writes them to [wTextBuf] and [wTextBuf + 1], and to the BGMap0 address at bc WriteTwoOneDigitNumbers: ; 05c2 (0:05c2) push hl push bc push de - ld hl, wcaa0 + ld hl, wTextBuf push hl push bc call WriteNumbersInTextFormat @@ -863,12 +863,12 @@ WriteTwoOneDigitNumbers: ; 05c2 (0:05c2) ; 0x5db ; converts a one-digit number provided in the lower nybble of a to text -; (ascii) format, and writes it to [wcaa0] and to the BGMap0 address at bc +; (ascii) format, and writes it to [wTextBuf] and to the BGMap0 address at bc WriteOneDigitNumber: ; 05db (0:05db) push hl push bc push de - ld hl, wcaa0 + ld hl, wTextBuf push hl push bc call WriteNumberInTextFormat @@ -884,14 +884,14 @@ WriteOneDigitNumber: ; 05db (0:05db) ; 0x5f4 ; converts four one-digit numbers provided in h and l to text (ascii) format, -; writes them to [wcaa0] through [wcaa0 + 3], and to the BGMap0 address at bc +; writes them to [wTextBuf] through [wTextBuf + 3], and to the BGMap0 address at bc WriteFourOneDigitNumbers: ; 05f4 (0:05f4) push hl push bc push de ld e, l ld d, h - ld hl, wcaa0 + ld hl, wTextBuf push hl push bc ld a, d @@ -911,7 +911,7 @@ WriteFourOneDigitNumbers: ; 05f4 (0:05f4) ; given two one-digit numbers in the two nybbles of register a, ; write them in text (ascii) format to hl (most significant nybble first). -; numbers above 9 are converted to VWF tiles. +; numbers above 9 end up converted to half-width font tiles. WriteNumbersInTextFormat: ; 0614 (0:0614) push af swap a @@ -921,7 +921,7 @@ WriteNumbersInTextFormat: ; 0614 (0:0614) ; given a one-digit number in the (lower nybble) of register a, ; write it in text (ascii) format to hl. -; numbers above 9 are converted to VWF tiles. +; numbers above 9 end up converted to half-width font tiles. WriteNumberInTextFormat: and $0f add "0" @@ -934,13 +934,13 @@ WriteNumberInTextFormat: ; 0x627 ; converts the one-byte number at a to text (ascii) format, -; and writes it to [wcaa0] and the BGMap0 address at bc +; and writes it to [wTextBuf] and the BGMap0 address at bc WriteOneByteNumber: ; 0627 (0:0627) push bc push hl ld l, a ld h, $00 - ld de, wcaa0 + ld de, wTextBuf push de push bc ld bc, -100 @@ -960,10 +960,10 @@ WriteOneByteNumber: ; 0627 (0:0627) ; 0x650 ; converts the two-byte number at hl to text (ascii) format, -; and writes it to [wcaa0] and the BGMap0 address at bc +; and writes it to [wTextBuf] and the BGMap0 address at bc WriteTwoByteNumber: ; 0650 (0:0650) push bc - ld de, wcaa0 + ld de, wTextBuf push de call TwoByteNumberToText call BCCoordToBGMap0Address @@ -1080,10 +1080,14 @@ WriteByteToBGMap0: ; 06c3 (0:06c3) ret .lcd_on pop af +; fallthrough + +; writes a to [v*BGMap0 + BG_MAP_WIDTH * c + b] during hblank +HblankWriteByteToBGMap0: ; 06d9 push hl push de push bc - ld hl, wcac1 + ld hl, wTempByte push hl ld [hl], a call BCCoordToBGMap0Address @@ -1475,7 +1479,7 @@ UpdateRNGSources: ; 089b (0:089b) push de ld hl, wRNG1 ld a, [hli] - ld d, [hl] + ld d, [hl] ; wRNG2 inc hl ld e, a ld a, d @@ -1487,7 +1491,7 @@ UpdateRNGSources: ; 089b (0:089b) ld a, d xor e ld d, a - ld a, [hl] + ld a, [hl] ; wRNGCounter xor e ld e, a pop af @@ -1495,11 +1499,11 @@ UpdateRNGSources: ; 089b (0:089b) rl d ld a, d xor e - inc [hl] + inc [hl] ; wRNGCounter dec hl - ld [hl], d + ld [hl], d ; wRNG2 dec hl - ld [hl], e + ld [hl], e ; wRNG1 pop de pop hl ret @@ -3789,8 +3793,12 @@ CheckIfCanEvolveInto: ; 13f7 (0:13f7) ret ; 0x142b -; similar to CheckIfCanEvolveInto, but with the twist of calling Func_2ecd -Func_142b: ; 142b (0:142b) +; check if the turn holder's Pokemon card at e can evolve this turn, and is a basic +; Pokemon card that whose second stage evolution is the turn holder's Pokemon card d. +; e is the play area location offset (PLAY_AREA_*) of the Pokemon trying to evolve. +; d is the deck index (0-59) of the Pokemon card that was selected to be the evolution target. +; return carry if not basic to stage 2 evolution, or if evolution not possible this turn. +CheckIfCanEvolveInto_BasicToStage2: ; 142b (0:142b) ld a, e add DUELVARS_ARENA_CARD_FLAGS_C2 call GetTurnDuelistVariable @@ -3809,7 +3817,7 @@ Func_142b: ; 142b (0:142b) ld e, [hl] inc hl ld d, [hl] - call $2ecd + call LoadCardDataToBuffer1_FromName ld hl, wLoadedCard2Name ld de, wLoadedCard1PreEvoName ld a, [de] @@ -5162,8 +5170,9 @@ SubstractHPFromCard: ; 1c35 (0:1c35) ; check if a flag of wLoadedMove is set ; input: - ; a = %fffffbbb, where f = flag address counting from wLoadedMoveFlag1 - ; b = flag bit + ; a = %fffffbbb, where + ; fffff = flag address counting from wLoadedMoveFlag1 + ; bbb = flag bit ; return carry if the flag is set CheckLoadedMoveFlag: ; 1c50 (0:1c50) push hl @@ -5557,7 +5566,7 @@ DrawLabeledTextBox: ; 1e00 (0:1e00) ld a, SYM_BOX_TOP_L ld [hli], a ; white tile before the text - ld a, $70 + ld a, FW_SPACE ld [hli], a ; text label ld e, l @@ -5565,13 +5574,13 @@ DrawLabeledTextBox: ; 1e00 (0:1e00) pop hl call CopyText ld hl, wc000 + 3 - call Func_23c1 + call GetTextSizeInTiles ld l, e ld h, d ; white tile after the text - ld a, $7 + ld a, TX_HALF2FULL ld [hli], a - ld a, $70 + ld a, FW_SPACE ld [hli], a pop de push de @@ -5593,14 +5602,14 @@ DrawLabeledTextBox: ; 1e00 (0:1e00) ld [hli], a ld a, SYM_BOX_TOP_R ld [hli], a - ld [hl], $0 + ld [hl], TX_END pop bc pop de push de push bc - call Func_22ae + call InitTextPrinting ld hl, wc000 - call Func_21c5 + call ProcessText pop bc pop de ld a, [wConsole] @@ -5843,7 +5852,197 @@ FillRectangle: ; 1f5f (0:1f5f) ret ; 0x1f96 - INCROM $1f96, $208d +Func_1f96: ; 1f96 (0:1f96) + add sp, -10 + ld hl, sp+0 + ld [hli], a ; sp-10 <- a + ld [hl], $00 ; sp-9 <- 0 + inc hl + ld a, [de] + inc de + ld [hli], a ; sp-8 <- [de] + ld [hl], $00 ; sp-7 <- 0 + ld hl, sp+5 + ld a, [de] + inc de + ld [hld], a ; sp-5 <- [de+1] + ld a, [de] + inc de + ld [hl], a ; sp-6 <- [de+2] + ld hl, sp+6 + ld a, [de] + inc de + ld [hli], a ; sp-4 <- [de+3] + ld a, [de] + inc de + ld [hli], a ; sp-3 <- [de+4] + ld a, [de] + inc de + ld l, a ; l <- [de+5] + ld a, [de] + dec de + ld h, a ; h <- [de+6] + or l + jr z, .asm_1fbd + add hl, de +.asm_1fbd + ld e, l + ld d, h ; de += hl + ld hl, sp+8 + ld [hl], e ; sp-2 <- e + inc hl + ld [hl], d ; sp-1 <- d + ld hl, sp+0 + ld e, [hl] ; e <- sp + jr .asm_2013 + push hl + push de + push hl + add sp, -4 + ld hl, sp+0 + ld [hl], c + inc hl + ld [hl], $00 + inc hl + ld [hl], b + ld hl, sp+8 + xor a + ld [hli], a + ld [hl], a +.asm_1fdb + call DoFrame + ld hl, sp+3 + ld [hl], a + ld c, a + and $09 + jr nz, .asm_2032 + ld a, c + and $06 + jr nz, .asm_203c + ld hl, sp+2 + ld b, [hl] + ld hl, sp+0 + ld a, [hl] + bit 6, c + jr nz, .asm_1ffe + bit 7, c + jr nz, .asm_2007 + call Func_2046 + jr .asm_1fdb +.asm_1ffe + dec a + bit 7, a + jr z, .asm_200c + ld a, b + dec a + jr .asm_200c +.asm_2007 + inc a + cp b + jr c, .asm_200c + xor a +.asm_200c + ld e, a + call Func_2051 + ld hl, sp+0 + ld [hl], e +.asm_2013 + inc hl + ld [hl], $00 + inc hl + ld b, [hl] + inc hl + ld c, [hl] + ld hl, sp+8 + ld a, [hli] + ld h, [hl] + ld l, a + or h + jr z, .asm_202d + ld a, e + ld de, .asm_2028 + push de + jp hl +.asm_2028 + jr nc, .asm_202d + ld hl, sp+0 + ld [hl], a +.asm_202d + call Func_2046 + jr .asm_1fdb +.asm_2032 + call Func_2051 + ld hl, sp+0 + ld a, [hl] + add sp, 10 + or a + ret +.asm_203c + call Func_2051 + ld hl, sp+0 + ld a, [hl] + add sp, 10 + scf + ret +; 0x2046 + +Func_2046: ; 2046 (0:2046) + ld hl, sp+3 + ld a, [hl] + inc [hl] + and $0f + ret nz + bit 4, [hl] + jr z, Func_2055 +; fallthrough + +Func_2051: ; 2051 (0:2051) + ld hl, sp+9 + jr Func_2057 + +Func_2055: ; 2055 (0:2055) + ld hl, sp+8 +; fallthrough + +Func_2057: ; 2057 (0:2057) + ld e, [hl] + ld hl, sp+2 + ld a, [hl] + ld hl, sp+6 + add [hl] + inc hl + ld c, a + ld b, [hl] + ld a, e + call HblankWriteByteToBGMap0 + ret +; 0x2066 + +; loads the four tiles of the card set 2 icon constant provided in register a +; returns carry if the specified set does not have an icon +LoadCardSet2Tiles: ; 2066 (0:2066) + and $7 ; mask out PRO + ld e, a + ld d, 0 + ld hl, .tile_offsets + add hl, de + ld a, [hl] + cp -1 + ccf + ret z + ld e, a + ld d, 0 + ld hl, DuelOtherGraphics + $1d tiles + add hl, de + ld de, v0Tiles1 + $7c tiles + ld b, $04 + call CopyFontsOrDuelGraphicsTiles + or a + ret + +.tile_offsets + ; PRO/NONE, JUNGLE, FOSSIL, -1, -1, -1, -1, GB + db -1, $0 tiles, $4 tiles, -1, -1, -1, -1, $8 tiles ; loads the Deck and Hand icons for the "Draw X card(s) from the deck." screen LoadDuelDrawCardsScreenTiles: ; 208d (0:208d) @@ -5941,10 +6140,10 @@ LoadDuelCoinTossResultTiles: ; 210f (0:210f) ld b, $8 jr CopyFontsOrDuelGraphicsTiles -LoadDuelHUDTiles: ; 2119 (0:2119) - ld hl, DuelHUDGraphics - $4000 +LoadSymbolsFont: ; 2119 (0:2119) + ld hl, SymbolsFont - $4000 ld de, v0Tiles2 ; destination - ld b, (DuelCardHeaderGraphics - DuelHUDGraphics) / TILE_SIZE ; number of tiles + ld b, (DuelCardHeaderGraphics - SymbolsFont) / TILE_SIZE ; number of tiles ; fallthrough ; if hl ≤ $3fff @@ -5952,7 +6151,7 @@ LoadDuelHUDTiles: ; 2119 (0:2119) ; if $4000 ≤ hl ≤ $7fff ; copy b tiles from Gfx2:hl to de CopyFontsOrDuelGraphicsTiles: ; 2121 (0:2121) - ld a, BANK(Fonts); BANK(DuelGraphics); BANK(VWF) + ld a, BANK(Fonts); BANK(DuelGraphics) call BankpushHome ld c, TILE_SIZE call CopyGfxData @@ -5960,9 +6159,9 @@ CopyFontsOrDuelGraphicsTiles: ; 2121 (0:2121) ret ; 0x212f -; this function appears to copy duel gfx data into sram +; this function appears to copy gfx data into sram Func_212f: ; 212f (0:212f) - ld hl, DuelHUDGraphics - $4000 + ld hl, SymbolsFont - $4000 ld de, $a400 ld b, $30 call CopyFontsOrDuelGraphicsTiles @@ -5989,17 +6188,18 @@ Func_212f: ; 212f (0:212f) jr CopyFontsOrDuelGraphicsTiles ; 0x2167 +; load the graphics and draw the duel box message given a BOXMSC_* constant in a DrawDuelBoxMessage: ; 2167 (0:2167) ld l, a - ld h, (40 tiles) / 4 ; boxes are 10x4 tiles + ld h, 40 tiles / 4 ; boxes are 10x4 tiles call HtimesL add hl, hl add hl, hl - ; hl = a * $280 + ; hl = a * 40 tiles ld de, DuelBoxMessages add hl, de - ld de, v0Tiles1 + $200 - ld b, $28 + ld de, v0Tiles1 + $20 tiles + ld b, 40 call CopyFontsOrDuelGraphicsTiles ld a, $a0 lb hl, 1, 10 @@ -6008,100 +6208,154 @@ DrawDuelBoxMessage: ; 2167 (0:2167) jp FillRectangle ; 0x2189 - INCROM $2189, $21c5 +; load the tiles for the latin, katakana, and hiragana fonts into VRAM +; from gfx/fonts/full_width/3.1bpp and gfx/fonts/full_width/4.t3.1bpp +LoadFullWidthFontTiles: ; 2189 (0:2189) + ld hl, FullWidthFonts + $3cc tiles_1bpp - $4000 + ld a, BANK(Fonts); BANK(DuelGraphics) + call BankpushHome + push hl + ld e, l + ld d, h + ld hl, v0Tiles0 + call Copy1bppTiles + pop de + ld hl, v0Tiles2 + call Copy1bppTiles + ld hl, v0Tiles1 + call Copy1bppTiles + call BankpopHome + ret +; 0x21ab + +; copy 128 1bpp tiles from de to hl as 2bpp +Copy1bppTiles: ; 21ab (0:21ab) + ld b, $80 +.tile_loop + ld c, TILE_SIZE_1BPP +.pixel_loop + ld a, [de] + inc de + ld [hli], a + ld [hli], a + dec c + jr nz, .pixel_loop + dec b + jr nz, .tile_loop + ret +; 0x21ba -Func_21c5: ; 21c5 (0:21c5) +; similar to ProcessText except it calls InitTextPrinting first +; with register de as an argument to set hTextBGMap0Address. +; (the caller to ProcessText usually calls InitTextPrinting first) +ProcessText_InitTextPrinting: ; 21ba (0:21ba) push de push bc - call Func_2298 - jr .asm_21e8 -.asm_21cc - cp $5 - jr c, .asm_21d9 - cp $10 - jr nc, .asm_21d9 - call Func_21f2 - jr .asm_21e8 -.asm_21d9 - ld e, a ld d, [hl] - call Func_2546 - jr nc, .asm_21e1 inc hl -.asm_21e1 + ld e, [hl] + inc hl + call InitTextPrinting + jr ProcessText.next_char + +; reads the characters from the text at hl processes them. loops until TX_END +; is found. ignores TX_RAM1, TX_RAM2, and TX_RAM3 characters. +ProcessText: ; 21c5 (0:21c5) + push de + push bc + call InitTextFormat + jr .next_char +.char_loop + cp TX_CTRL_START + jr c, .character_pair + cp TX_CTRL_END + jr nc, .character_pair + call ProcessSpecialTextCharacter + jr .next_char +.character_pair + ld e, a ; first char + ld d, [hl] ; second char + call ClassifyTextCharacterPair + jr nc, .not_tx_fullwidth + inc hl +.not_tx_fullwidth call Func_22ca xor a - call Func_21f2 -.asm_21e8 + call ProcessSpecialTextCharacter +.next_char ld a, [hli] or a - jr nz, .asm_21cc - call Func_230f + jr nz, .char_loop + ; TX_END + call TerminateHalfWidthText pop bc pop de ret -Func_21f2: ; 21f2 (0:21f2) - or a - jr z, .asm_2241 - cp $e - jr z, .asm_2221 - cp $f - jr z, .asm_2221 - cp $a - jr z, .reached_line_length +; processes the text character provided in a checking for specific control characters. +; hl points to the text character coming right after the one loaded into a. +; returns carry if the character was not processed by this function. +ProcessSpecialTextCharacter: ; 21f2 (0:21f2) + or a ; TX_END + jr z, .tx_end + cp TX_HIRAGANA + jr z, .set_syllabary + cp TX_KATAKANA + jr z, .set_syllabary + cp "\n" + jr z, .end_of_line cp TX_SYMBOL - jr z, .asm_2225 - cp TX_START - jr z, .asm_220f - cp $7 - jr z, .asm_2215 + jr z, .tx_symbol + cp TX_HALFWIDTH + jr z, .tx_halfwidth + cp TX_HALF2FULL + jr z, .tx_half2full scf ret -.asm_220f - ld a, $1 - ld [wRegularFontOrVWF], a +.tx_halfwidth + ld a, HALF_WIDTH + ld [wFontWidth], a ret -.asm_2215 - call Func_230f - xor a - ld [wRegularFontOrVWF], a - ld a, $f - ldh [hffaf], a +.tx_half2full + call TerminateHalfWidthText + xor a ; FULL_WIDTH + ld [wFontWidth], a + ld a, TX_KATAKANA + ldh [hJapaneseSyllabary], a ret -.asm_2221 - ldh [hffaf], a +.set_syllabary + ldh [hJapaneseSyllabary], a xor a ret -.asm_2225 - ld a, [wRegularFontOrVWF] +.tx_symbol + ld a, [wFontWidth] push af - ld a, $1 - ld [wRegularFontOrVWF], a - call Func_230f + ld a, HALF_WIDTH + ld [wFontWidth], a + call TerminateHalfWidthText pop af - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ldh a, [hffb0] or a - jr nz, .asm_2240 + jr nz, .skip_placing_tile ld a, [hl] push hl call PlaceNextTextTile pop hl -.asm_2240 +.skip_placing_tile inc hl -.asm_2241 +.tx_end ldh a, [hTextLineLength] or a ret z ld b, a ldh a, [hTextLineCurPos] cp b - jr z, .reached_line_length + jr z, .end_of_line xor a ret -.reached_line_length - call Func_230f +.end_of_line + call TerminateHalfWidthText ld a, [wLineSeparation] or a call z, .next_line @@ -6132,7 +6386,7 @@ Func_2275: ; 2275 (0:2275) ld [wcd04], a ld a, e ldh [hffa8], a - call Func_2298 + call InitTextFormat xor a ldh [hffb0], a ldh [hffa9], a @@ -6148,24 +6402,24 @@ Func_2275: ; 2275 (0:2275) jr nz, .asm_2292 ret -; wRegularFontOrVWF <- 0 +; wFontWidth <- FULL_WIDTH ; hTextLineCurPos <- 0 -; wcd0b <- 0 -; hffaf <- $f -Func_2298: ; 2298 (0:2298) - xor a - ld [wRegularFontOrVWF], a +; wHalfWidthPrintState <- 0 +; hJapaneseSyllabary <- TX_KATAKANA +InitTextFormat: ; 2298 (0:2298) + xor a ; FULL_WIDTH + ld [wFontWidth], a ldh [hTextLineCurPos], a - ld [wcd0b], a - ld a, $f - ldh [hffaf], a + ld [wHalfWidthPrintState], a + ld a, TX_KATAKANA + ldh [hJapaneseSyllabary], a ret -; Func_22ae +; call InitTextPrinting ; hTextLineLength <- a -Func_22a6: ; 22a6 (0:22a6) +InitTextPrintingInTextbox: ; 22a6 (0:22a6) push af - call Func_22ae + call InitTextPrinting pop af ldh [hTextLineLength], a ret @@ -6173,11 +6427,9 @@ Func_22a6: ; 22a6 (0:22a6) ; hTextHorizontalAlign <- d ; hTextLineLength <- 0 ; wCurTextLine <- 0 -; hTextBGMap0Address <- BGMap0(e) -; hTextBGMap0Address + 1 <- BGMap0(d) -; Func_2298 -;; writes BGMap0-translated DE to hTextBGMap0Address -Func_22ae: ; 22ae (0:22ae) +; write BGMap0-translated DE to hTextBGMap0Address +; call InitTextFormat +InitTextPrinting: ; 22ae (0:22ae) push hl ld a, d ldh [hTextHorizontalAlign], a @@ -6189,9 +6441,9 @@ Func_22ae: ; 22ae (0:22ae) ldh [hTextBGMap0Address], a ld a, h ldh [hTextBGMap0Address + 1], a - call Func_2298 + call InitTextFormat xor a - ld [wcd0b], a + ld [wHalfWidthPrintState], a pop hl ret @@ -6244,17 +6496,20 @@ PlaceNextTextTile: ; 22f2 (0:22f2) inc [hl] ret -Func_230f: ; 230f (0:230f) - ld a, [wRegularFontOrVWF] - or a +; when terminating half-width text with "\n" or TX_END, or switching to full-width +; with TX_HALF2FULL or to symbols with TX_SYMBOL, check if it's necessary to append +; a half-width space to finish an incomplete character pair. +TerminateHalfWidthText: ; 230f (0:230f) + ld a, [wFontWidth] + or a ; FULL_WIDTH ret z - ld a, [wcd0b] + ld a, [wHalfWidthPrintState] or a - ret z + ret z ; return if the last printed character was the second of a pair push hl push de push bc - ld e, $20 + ld e, " " call Func_22ca pop bc pop de @@ -6309,22 +6564,26 @@ Func_2325: ; 2325 (0:2325) ; search linked-list for text characters e/d (registers), if found hoist ; the result to head of list and return it. carry flag denotes success. Func_235e: ; 235e (0:235e) - ld a, [wRegularFontOrVWF] - or a ; - jr z, .asm_2376 ; if [wRegularFontOrVWF] nonzero: - call CaseVWFLetter ; uppercase e if wUppercaseVWFLetters != 0 - ld a, [wcd0b] - ld d, a ; d ← [wcd0b] - or a - jr nz, .asm_2376 ; if [wcd0b] is zero: - ld a, e ; - ld [wcd0b], a ; [wcd0b] ← e - ld a, $1 ; - or a ; return a = 1 - ret -.asm_2376 + ld a, [wFontWidth] + or a + jr z, .print + call CaseHalfWidthLetter + ; if [wHalfWidthPrintState] != 0, load it to d and print the pair of chars + ; zero wHalfWidthPrintState for next iteration + ld a, [wHalfWidthPrintState] + ld d, a + or a + jr nz, .print + ; if [wHalfWidthPrintState] == 0, don't print text in this iteration + ; load the next value of register d into wHalfWidthPrintState + ld a, e + ld [wHalfWidthPrintState], a + ld a, $1 + or a + ret ; nz +.print xor a - ld [wcd0b], a ; [wcd0b] ← 0 + ld [wHalfWidthPrintState], a ldh a, [hffa9] ld l, a ; l ← [hffa9]; index to to linked-list head .asm_237d @@ -6370,9 +6629,9 @@ Func_235e: ; 235e (0:235e) scf ; set carry to indicate success ret ; (return new linked-list head in a) -; uppercases e if [wUppercaseVWFLetters] is nonzero -CaseVWFLetter: ; 23b1 (0:23b1) - ld a, [wUppercaseVWFLetters] +; uppercases e if [wUppercaseHalfWidthLetters] is nonzero +CaseHalfWidthLetter: ; 23b1 (0:23b1) + ld a, [wUppercaseHalfWidthLetters] or a ret z ld a, e @@ -6384,47 +6643,64 @@ CaseVWFLetter: ; 23b1 (0:23b1) ld e, a ret -Func_23c1: ; 23c1 (0:23c1) +; iterates over text at hl until TX_END is found, and sets wFontWidth to +; FULL_WIDTH if the first character is TX_HALFWIDTH +; returns: +; b = size of text in tiles +; c = size of text in bytes +; a = -b +GetTextSizeInTiles: ; 23c1 (0:23c1) ld a, [hl] - cp TX_START - jr nz, .asm_23cf - call Func_23d3 + cp TX_HALFWIDTH + jr nz, .full_width + call GetTextSizeInHalfTiles + ; return a = - ceil(b/2) inc b srl b xor a sub b ret -.asm_23cf - xor a - ld [wRegularFontOrVWF], a -Func_23d3: ; 23d3 (0:23d3) +.full_width + xor a ; FULL_WIDTH + ld [wFontWidth], a +; fallthrough + +; iterates over text at hl until TX_END is found +; returns: +; b = size of text in half-tiles +; c = size of text in bytes +; a = -b +GetTextSizeInHalfTiles: ; 23d3 (0:23d3) push hl push de - ld bc, $0000 -.asm_23d8 + lb bc, $00, $00 +.char_loop ld a, [hli] - or a - jr z, .asm_23f8 - inc c - cp $5 - jr c, .asm_23ec - cp $10 - jr nc, .asm_23ec + or a ; TX_END + jr z, .tx_end + inc c ; any char except TX_END: c ++ + ; TX_FULLWIDTH, TX_SYMBOL, or > TX_CTRL_END : b ++ + cp TX_CTRL_START + jr c, .character_pair + cp TX_CTRL_END + jr nc, .character_pair cp TX_SYMBOL - jr nz, .asm_23d8 + jr nz, .char_loop inc b - jr .asm_23f4 -.asm_23ec - ld e, a - ld d, [hl] + jr .next +.character_pair + ld e, a ; first char + ld d, [hl] ; second char inc b - call Func_2546 - jr nc, .asm_23d8 -.asm_23f4 - inc c + call ClassifyTextCharacterPair + jr nc, .char_loop + ; TX_FULLWIDTH +.next + inc c ; TX_FULLWIDTH or TX_SYMBOL: c ++ inc hl - jr .asm_23d8 -.asm_23f8 + jr .char_loop +.tx_end + ; return a = -b xor a sub b pop de @@ -6432,14 +6708,95 @@ Func_23d3: ; 23d3 (0:23d3) ret ; 0x23fd - INCROM $23fd, $245d +; copy text of maximum length a (in tiles) from hl to de, then terminate +; the text with TX_END if it doesn't contain it already. +; fill any remaining bytes with spaces plus TX_END to match the length specified in a. +; return the text's actual length in characters (i.e. before the first TX_END) in e. +CopyTextData: ; 23fd (0:23fd) + ld [wTextMaxLength], a + ld a, [hl] + cp TX_HALFWIDTH + jr z, .half_width_text + ld a, [wTextMaxLength] + call .copyTextData + jr c, .fw_text_done + push hl +.fill_fw_loop + ld a, FW_SPACE + ld [hli], a + dec d + jr nz, .fill_fw_loop + ld [hl], TX_END + pop hl +.fw_text_done + ld a, e + ret +.half_width_text + ld a, [wTextMaxLength] + add a + call .copyTextData + jr c, .hw_text_done + push hl +.fill_hw_loop + ld a, " " + ld [hli], a + dec d + jr nz, .fill_hw_loop + ld [hl], TX_END + pop hl +.hw_text_done + ld a, e + ret -; convert the number at hl to TX_SYMBOL text format and write it to wcaa0 +.copyTextData + push bc + ld c, l + ld b, h + ld l, e + ld h, d + ld d, a + ld e, 0 +.loop + ld a, [bc] + or a ; TX_END + jr z, .done + inc bc + ld [hli], a + cp TX_CTRL_START + jr c, .character_pair + cp TX_CTRL_END + jr c, .loop +.character_pair + push de + ld e, a ; first char + ld a, [bc] + ld d, a ; second char + call ClassifyTextCharacterPair + jr nc, .not_tx_fullwidth + ld a, [bc] + inc bc + ld [hli], a +.not_tx_fullwidth + pop de + inc e ; return in e the amount of characters actually copied + dec d ; return in d the difference between the maximum length and e + jr nz, .loop + ld [hl], TX_END + pop bc + scf ; return carry if the text did not already end with TX_END + ret +.done + pop bc + or a + ret +; 0x245d + +; convert the number at hl to TX_SYMBOL text format and write it to wTextBuf ; replace leading zeros with SYM_SPACE TwoByteNumberToTxSymbol_TrimLeadingZeros: ; 245d (0:245d) push de push bc - ld de, wcaa0 + ld de, wTextBuf push de ld bc, -10000 call .get_digit @@ -6492,53 +6849,54 @@ TwoByteNumberToTxSymbol_TrimLeadingZeros: ; 245d (0:245d) ret ; generates a text tile and copies it to VRAM -; if wRegularFontOrVWF == 0 - ; de = regular font tile number (d = $e and d = $f are treated differently) -; if wRegularFontOrVWF != 0 - ; d = VWF character 1 (left) - ; e = VWF character 2 (right) +; if wFontWidth == FULL_WIDTH + ; de = full-width font tile number +; if wFontWidth == HALF_WIDTH + ; d = half-width character 1 (left) + ; e = half-width character 2 (right) ; b = destination VRAM tile number GenerateTextTile: ; 24ac (0:24ac) push hl push de push bc - ld a, [wRegularFontOrVWF] + ld a, [wFontWidth] or a - jr nz, .vwf -;.regular_font - call CreateRegularFontTile_ConvertToTileDataAddress + jr nz, .half_width +;.full_width + call CreateFullWidthFontTile_ConvertToTileDataAddress call SafeCopyDataDEtoHL .done pop bc pop de pop hl ret -.vwf - call CreateVWFTile +.half_width + call CreateHalfWidthFontTile call ConvertTileNumberToTileDataAddress call SafeCopyDataDEtoHL jr .done -; create, at wVWFOrRegularFontTile, a VWF tile made from the ascii characters given in d and e -CreateVWFTile: ; 24ca (0:24ca) +; create, at wTextTileBuffer, a half-width font tile +; made from the ascii characters given in d and e +CreateHalfWidthFontTile: ; 24ca (0:24ca) push bc ldh a, [hBankROM] push af - ld a, BANK(VWF) + ld a, BANK(HalfWidthFont) call BankswitchHome - ; write the right half of the VWF tile (first character) to wVWFOrRegularFontTile + 2n + ; write the right half of the tile (first character) to wTextTileBuffer + 2n push de ld a, e - ld de, wVWFOrRegularFontTile - call CopyVWFCharacterToDE + ld de, wTextTileBuffer + call CopyHalfWidthCharacterToDE pop de - ; write the left half of the VWF tile (second character) to wVWFOrRegularFontTile + 2n+1 + ; write the left half of the tile (second character) to wTextTileBuffer + 2n+1 ld a, d - ld de, wVWFOrRegularFontTile + 1 - call CopyVWFCharacterToDE - ; construct the resulting VWF tile - ld hl, wVWFOrRegularFontTile - ld b, TILE_SIZE / 2 + ld de, wTextTileBuffer + 1 + call CopyHalfWidthCharacterToDE + ; construct the 2bpp-converted half-width font tile + ld hl, wTextTileBuffer + ld b, TILE_SIZE_1BPP .loop ld a, [hli] swap a @@ -6550,38 +6908,38 @@ CreateVWFTile: ; 24ca (0:24ca) jr nz, .loop call BankpopHome pop bc - ld de, wVWFOrRegularFontTile + ld de, wTextTileBuffer ret -; copies a half-tile corresponding to a VWF character to de -; the ascii value of the character to copy is provided in a -; assumes BANK(VWF) is already loaded -CopyVWFCharacterToDE: ; 24fa (0:24fa) - sub $20 ; VWF begins at ascii $20 +; copies a 1bpp tile corresponding to a half-width font character to de. +; the ascii value of the character to copy is provided in a. +; assumes BANK(HalfWidthFont) is already loaded. +CopyHalfWidthCharacterToDE: ; 24fa (0:24fa) + sub $20 ; HalfWidthFont begins at ascii $20 ld l, a ld h, $0 add hl, hl add hl, hl add hl, hl - ld bc, VWF + ld bc, HalfWidthFont add hl, bc - ld b, TILE_SIZE / 2 + ld b, TILE_SIZE_1BPP .loop ld a, [hli] ld [de], a inc de - inc de ; skip the other half of the tile + inc de dec b jr nz, .loop ret -; create, at wVWFOrRegularFontTile, a regular font tile -; given its tile number within the regular font graphics in de. +; create, at wTextTileBuffer, a full-width font tile given its tile +; number within the full-width font graphics (FullWidthFonts) in de. ; return its v*Tiles address in hl, and return c = TILE_SIZE. -CreateRegularFontTile_ConvertToTileDataAddress: ; 2510 (0:2510) +CreateFullWidthFontTile_ConvertToTileDataAddress: ; 2510 (0:2510) push bc - call GetRegularFontTileOffset - call CreateRegularFontTile + call GetFullWidthFontTileOffset + call CreateFullWidthFontTile pop bc ; fallthrough @@ -6606,14 +6964,14 @@ ConvertTileNumberToTileDataAddress: ; 2518 (0:2518) ld c, TILE_SIZE ret -; create, at wVWFOrRegularFontTile, a regular font tile -; given its offset within the font graphics in hl -CreateRegularFontTile: ; 252e (0:252e) - ld a, BANK(Fonts); BANK(DuelGraphics); BANK(VWF) +; create, at wTextTileBuffer, a full-width font tile given its +; within the full-width font graphics (FullWidthFonts) in hl +CreateFullWidthFontTile: ; 252e (0:252e) + ld a, BANK(Fonts); BANK(DuelGraphics) call BankpushHome - ld de, wVWFOrRegularFontTile + ld de, wTextTileBuffer push de - ld c, TILE_SIZE / 2 + ld c, TILE_SIZE_1BPP .loop ld a, [hli] ld [de], a @@ -6626,52 +6984,61 @@ CreateRegularFontTile: ; 252e (0:252e) call BankpopHome ret -Func_2546: ; 2546 (0:2546) - ld a, [wRegularFontOrVWF] - or a - jr nz, .asm_255f +; given two text characters at de, use the char at e (first one) +; to determine which type of text this pair of characters belongs to. +; return carry if TX_FULLWIDTH1 to TX_FULLWIDTH4. +ClassifyTextCharacterPair: ; 2546 (0:2546) + ld a, [wFontWidth] + or a ; FULL_WIDTH + jr nz, .half_width ld a, e - cp $10 - jr c, .asm_2561 + cp TX_CTRL_END + jr c, .continue_check cp $60 - jr nc, .asm_2565 - ldh a, [hffaf] - cp $f - jr nz, .asm_2565 - ld d, $f + jr nc, .not_katakana + ldh a, [hJapaneseSyllabary] + cp TX_KATAKANA + jr nz, .not_katakana + ld d, TX_KATAKANA or a ret -.asm_255f +.half_width +; in half width mode, the first character goes in e, so leave them like that or a ret -.asm_2561 - cp $5 - jr c, .asm_2569 -.asm_2565 +.continue_check + cp TX_CTRL_START + jr c, .ath_font +.not_katakana +; 0_1_hiragana.1bpp (e < $60) or 0_2_digits_kanji1.1bpp (e >= $60) ld d, $0 or a ret -.asm_2569 +.ath_font +; TX_FULLWIDTH1 to TX_FULLWIDTH4 +; swap d and e to put the TX_FULLWIDTH* character first ld e, d ld d, a scf ret -; convert the regular font tile number at de to the -; equivalent offset within the font tile graphics. -; d = $e and d = $f are treated differently -GetRegularFontTileOffset: ; 256d (0:256d) - ld bc, 40 tiles +; convert the full-width font tile number at de to the +; equivalent offset within the full-width font tile graphics. +; if d == TX_KATAKANA: get tile from the 0_0_katakana.1bpp font. +; if d == TX_HIRAGANA or d == $0: get tile from the 0_1_hiragana.1bpp or 0_2_digits_kanji1.1bpp font. +; if d >= TX_FULLWIDTH1 and d <= TX_FULLWIDTH4: get tile from one of the other full-width fonts. +GetFullWidthFontTileOffset: ; 256d (0:256d) + ld bc, $50 tiles_1bpp ld a, d - cp $e - jr z, .asm_2580 - cp $f + cp TX_HIRAGANA + jr z, .hiragana + cp TX_KATAKANA jr nz, .get_address - ld bc, $0000 + ld bc, $0 tiles ld a, e - sub $10 + sub $10 ; the first $10 are control characters, but this font's graphics start at $0 ld e, a -.asm_2580 +.hiragana ld d, $0 .get_address ld l, e @@ -6683,7 +7050,57 @@ GetRegularFontTileOffset: ; 256d (0:256d) ret ; 0x2589 - INCROM $2589, $25ea +Unknown_2589: ; 2589 (0:2589) + db $18 + dw $8140 + dw $817e + dw $8180 + dw $81ac + dw $81b8 + dw $81bf + dw $81c8 + dw $81ce + dw $81da + dw $81e8 + dw $81f0 + dw $81f7 + dw $81fc + dw $81fc + dw $824f + dw $8258 + dw $8260 + dw $8279 + dw $8281 + dw $829a + dw $829f + dw $82f1 + dw $8340 + dw $837e + dw $8380 + dw $8396 + dw $839f + dw $83b6 + dw $83bf + dw $83d6 + dw $8440 + dw $8460 + dw $8470 + dw $847e + dw $8480 + dw $8491 + dw $849f + dw $84be + dw $889f + dw $88fc + dw $8940 + dw $9443 + dw $9840 + dw $9872 + dw $989f + dw $98fc + dw $9940 + dw $ffff +; 0x25ea ; initializes parameters for a card list (e.g. list of hand cards in a duel or booster pack cards) ; input: @@ -6709,7 +7126,7 @@ InitializeCardListParameters: ; 25ea (0:25ea) ld a, [hli] ld [wNumMenuItems], a ld a, [hli] - ld [wCursorTileNumber], a + ld [wCursorTile], a ld a, [hli] ld [wTileBehindCursor], a ld a, [hli] @@ -6848,6 +7265,9 @@ PlayOpenOrExitScreenSFX: ; 26c0 (0:26c0) pop af ret +; called once per frame when a menu is open +; play the sound effect at wRefreshMenuCursorSFX if non-0 and blink the +; cursor when wCursorBlinkCounter hits 16 (i.e. every 16 frames) RefreshMenuCursor_CheckPlaySFX: ; 26d1 (0:26d1) ld a, [wRefreshMenuCursorSFX] or a @@ -6861,7 +7281,7 @@ RefreshMenuCursor: ; 26da (0:26da) ; blink the cursor every 16 frames and $f ret nz - ld a, [wCursorTileNumber] + ld a, [wCursorTile] bit 4, [hl] jr z, DrawCursor EraseCursor: ; 26e9 (0:26e9) @@ -6887,9 +7307,9 @@ DrawCursor: or a ret -; unlike DrawCursor, read cursor tile from wCursorTileNumber instead of register a +; unlike DrawCursor, read cursor tile from wCursorTile instead of register a DrawCursor2: ; 270b (0:270b) - ld a, [wCursorTileNumber] + ld a, [wCursorTile] jr DrawCursor SetMenuItem: ; 2710 (0:2710) @@ -6937,7 +7357,7 @@ HandleDuelMenuInput: ; 271a (0:271a) push af ld a, $1 call PlaySFX - call .asm_2772 + call .erase_cursor pop af ld [wCurMenuItem], a ldh [hCurMenuItem], a @@ -6955,12 +7375,12 @@ HandleDuelMenuInput: ; 271a (0:271a) inc [hl] and $f ret nz - ld a, $f + ld a, SYM_CURSOR_R bit 4, [hl] - jr z, .asm_2774 -.asm_2772 - ld a, $0 -.asm_2774 + jr z, .draw_cursor +.erase_cursor + ld a, SYM_SPACE +.draw_cursor ld e, a ld a, [wCurMenuItem] add a @@ -7001,27 +7421,27 @@ PrintCardListItems: ; 2799 (0:2799) ld a, 1 ld [wCardListIndicatorYPosition], a .reload - ld e, $00 + ld e, SYM_SPACE ld a, [wListScrollOffset] or a - jr z, .asm_27b9 - ld e, $0c -.asm_27b9 + jr z, .cant_go_up + ld e, SYM_CURSOR_U +.cant_go_up ld a, [wCursorYPosition] dec a ld c, a ld b, 18 ld a, e call WriteByteToBGMap0 - ld e, $00 + ld e, SYM_SPACE ld a, [wListScrollOffset] ld hl, wNumMenuItems add [hl] ld hl, wNumListItems cp [hl] - jr nc, .asm_27d5 - ld e, $2f -.asm_27d5 + jr nc, .cant_go_down + ld e, SYM_CURSOR_D +.cant_go_down ld a, [wNumMenuItems] add a add c @@ -7041,20 +7461,20 @@ PrintCardListItems: ; 2799 (0:2799) ld a, [wCursorYPosition] ld e, a ld c, $00 -.asm_27f8 +.next_card ld a, [hl] cp $ff - jr z, .asm_2826 + jr z, .done push hl push bc push de call LoadCardDataToBuffer1_FromDeckIndex call DrawCardSymbol - call Func_22ae + call InitTextPrinting ld a, [wListItemNameMaxLength] call CopyCardNameAndLevel ld hl, wDefaultText - call Func_21c5 + call ProcessText pop de pop bc pop hl @@ -7063,12 +7483,12 @@ PrintCardListItems: ; 2799 (0:2799) dec a inc c cp c - jr c, .asm_2826 + jr c, .done inc e inc e dec b - jr nz, .asm_27f8 -.asm_2826 + jr nz, .next_card +.done ret ; 0x2827 @@ -7096,6 +7516,7 @@ OneByteNumberToTxSymbol_TrimLeadingZerosAndAlign: ; 2832 (0:2832) ret ; 0x283f +; this function is always loaded to wMenuFunctionPointer by PrintCardListItems ; takes care of things like handling page scrolling and calling the function at wListFunctionPointer CardListMenuFunction: ; 283f (0:283f) ldh a, [hButtonsPressed2] @@ -7384,6 +7805,10 @@ CopyCardNameAndLevel: ; 29f5 (0:29f5) Func_29fa: ; 29fa (0:29fa) lb bc, SYM_CURSOR_R, SYM_SPACE ; cursor tile, tile behind cursor call SetCursorParametersForTextBox +; fallthrough + +; wait until A or B is pressed. +; return carry if A is pressed, nc if B is pressed. erase the cursor either way WaitForButtonAorB: ; 2a00 (0:2a00) call DoFrame call RefreshMenuCursor @@ -7412,24 +7837,30 @@ SetCursorParametersForTextBox: ; 2a1a (0:2a1a) inc hl ld [hl], 1 ; wNumMenuItems inc hl - ld [hl], b ; wCursorTileNumber + ld [hl], b ; wCursorTile inc hl ld [hl], c ; wTileBehindCursor ld [wCursorBlinkCounter], a ret ; 0x2a30 +; draw a 20x6 text box aligned to the bottom of the screen, +; print the text at hl without letter delay, and wait for A or B pressed Func_2a30: ; 2a30 (0:2a30) call DrawWideTextBox_PrintTextNoDelay jp WaitForWideTextBoxInput ; 0x2a36 +; draw a 20x6 text box aligned to the bottom of the screen +; and print the text at hl without letter delay DrawWideTextBox_PrintTextNoDelay: ; 2a36 (0:2a36) push hl call DrawWideTextBox - ld a, $13 + ld a, 19 jr Func_2a44 +; draw a 12x6 text box aligned to the bottom left of the screen +; and print the text at hl without letter delay DrawNarrowTextBox_PrintTextNoDelay: ; 2a3e (0:2a3e) push hl call DrawNarrowTextBox @@ -7439,26 +7870,28 @@ DrawNarrowTextBox_PrintTextNoDelay: ; 2a3e (0:2a3e) Func_2a44: ; 2a44 (0:2a44) lb de, 1, 14 call AdjustCoordinatesForBGScroll - call Func_22a6 + call InitTextPrintingInTextbox pop hl ld a, l or h jp nz, PrintTextNoDelay ld hl, wDefaultText - jp Func_21c5 + jp ProcessText +; draw a 20x6 text box aligned to the bottom of the screen +; and print the text at hl with letter delay DrawWideTextBox_PrintText: ; 2a59 (0:2a59) push hl call DrawWideTextBox ld a, 19 lb de, 1, 14 call AdjustCoordinatesForBGScroll - call Func_22a6 + call InitTextPrintingInTextbox call EnableLCD pop hl jp PrintText -; draws a 12x6 text box aligned to the bottom left of the screen +; draw a 12x6 text box aligned to the bottom left of the screen DrawNarrowTextBox: ; 2a6f (0:2a6f) lb de, 0, 12 lb bc, 12, 6 @@ -7466,6 +7899,8 @@ DrawNarrowTextBox: ; 2a6f (0:2a6f) call DrawRegularTextBox ret +; draw a 12x6 text box aligned to the bottom left of the screen, +; print the text at hl without letter delay, and wait for A or B pressed DrawNarrowTextBox_WaitForInput: ; 2a7c (0:2a7c) call DrawNarrowTextBox_PrintTextNoDelay xor a @@ -7488,7 +7923,7 @@ NarrowTextBoxMenuParameters: ; 2a96 (0:2a96) db SYM_BOX_BOTTOM ; tile behind cursor dw $0000 ; function pointer if non-0 -; draws a 20x6 text box aligned to the bottom of the screen +; draw a 20x6 text box aligned to the bottom of the screen DrawWideTextBox: ; 2a9e (0:2a9e) lb de, 0, 12 lb bc, 20, 6 @@ -7496,6 +7931,8 @@ DrawWideTextBox: ; 2a9e (0:2a9e) call DrawRegularTextBox ret +; draw a 20x6 text box aligned to the bottom of the screen, +; print the text at hl with letter delay, and wait for A or B pressed DrawWideTextBox_WaitForInput: ; 2aab (0:2aab) call DrawWideTextBox_PrintText ; fallthrough @@ -7521,6 +7958,7 @@ WideTextBoxMenuParameters: ; 2ac8 (0:2ac8) db SYM_BOX_BOTTOM ; tile behind cursor dw $0000 ; function pointer if non-0 +; display a two-item horizontal menu with custom text provided in hl and handle input TwoItemHorizontalMenu: ; 2ad0 (0:2ad0) call DrawWideTextBox_PrintText lb de, 6, 16 ; x, y @@ -7539,7 +7977,7 @@ Func_2aeb: ; 2aeb (0:2aeb) ld [wcd9a], a ; fallthrough -; handle a yes / no menu with custom text provided in hl +; display a yes / no menu with custom text provided in hl and handle input ; returns carry if "no" selected YesOrNoMenuWithText: ; 2af0 (0:2af0) call DrawWideTextBox_PrintText @@ -7610,7 +8048,7 @@ HandleYesOrNoMenu: scf ret -; prints YES NO at de +; prints "YES NO" at de PrintYesOrNoItems: ; 2b66 (0:2b66) call AdjustCoordinatesForBGScroll ldtx hl, YesOrNoText @@ -7739,7 +8177,7 @@ PlaceTextItems: ; 2c08 (0:2c08) ret nz ; return if no more items of text ld e, [hl] ; y coord inc hl ; hl = text id - call Func_22ae + call InitTextPrinting push hl call Func_2c23 pop hl @@ -7748,11 +8186,11 @@ PlaceTextItems: ; 2c08 (0:2c08) jr PlaceTextItems ; do next item Func_2c1b: ; 2c1b (0:2c1b) - call Func_22ae + call InitTextPrinting jr Func_2c29 Func_2c20: ; 2c20 (0:2c20) - call Func_22ae + call InitTextPrinting Func_2c23: ; 2c23 (0:2c23) ld a, [hli] or [hl] @@ -7763,8 +8201,8 @@ Func_2c23: ; 2c23 (0:2c23) Func_2c29: ; 2c29 (0:2c29) ldh a, [hBankROM] push af - call ReadTextOffset - call Func_21c5 + call GetTextOffsetFromTextID + call ProcessText pop af call BankswitchHome ret @@ -7776,15 +8214,15 @@ Func_2c37: ; 2c37 (0:2c37) push bc ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID ld c, $00 .char_loop ld a, [hli] or a ; TX_END jr z, .end - cp $10 + cp TX_CTRL_END jr nc, .char_loop - cp TX_START + cp TX_HALFWIDTH jr c, .skip cp "\n" jr nz, .char_loop @@ -7806,7 +8244,7 @@ Func_2c37: ; 2c37 (0:2c37) Func_2c62: ; 2c62 (0:2c62) call .asm_2c67 - jr Func_2c77 + jr WaitForPlayerToAdvanceText .asm_2c67 push hl ld hl, wTextBoxLabel @@ -7815,73 +8253,87 @@ Func_2c62: ; 2c62 (0:2c62) ld [hl], d pop hl ld a, $01 - jr Func_2c84 + jr PrintScrollableText Func_2c73: ; 2c73 (0:2c73) xor a - call Func_2c84 + call PrintScrollableText -Func_2c77: ; 2c77 (0:2c77) +; when a text box is full, prompt the player to press A or B +; in order to clear the text and print the next lines. +WaitForPlayerToAdvanceText: ; 2c77 (0:2c77) lb bc, SYM_CURSOR_D, SYM_BOX_BOTTOM ; cursor tile, tile behind cursor lb de, 18, 17 ; x, y call SetCursorParametersForTextBox call WaitForButtonAorB ret -Func_2c84: ; 2c84 (0:2c84) +; prints text with id at hl, with letter delay, in a textbox area. +; unlike PrintText, PrintScrollableText supports scrollable text, and prompts +; the user to press A or B to advance the page or close the text. +; used mostly for overworld NPC text. +PrintScrollableText: ; 2c84 (0:2c84) ld [wIsTextBoxLabeled], a ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID call Func_2d15 - call Func_2cc8 -.asm_2c93 + call ResetTxRam_WriteToTextHeader +.print_char_loop ld a, [wTextSpeed] ld c, a inc c - jr .asm_2cac -.asm_2c9a + jr .go +.nonzero_text_speed ld a, [wTextSpeed] - cp $2 - jr nc, .asm_2ca7 + cp 2 + jr nc, .apply_delay + ; if text speed is 1, pressing b ignores it ldh a, [hButtonsHeld] and B_BUTTON - jr nz, .asm_2caf -.asm_2ca7 + jr nz, .skip_delay +.apply_delay push bc call DoFrame pop bc -.asm_2cac +.go dec c - jr nz, .asm_2c9a -.asm_2caf - call Func_2d43 + jr nz, .nonzero_text_speed +.skip_delay + call ProcessTextHeader jr c, .asm_2cc3 ld a, [wCurTextLine] cp 3 - jr c, .asm_2c93 - call Func_2c77 + jr c, .print_char_loop + ; two lines of text already printed, so need to advance text + call WaitForPlayerToAdvanceText call Func_2d15 - jr .asm_2c93 + jr .print_char_loop .asm_2cc3 pop af call BankswitchHome ret -Func_2cc8: ; 2cc8 (0:2cc8) +; zero wWhichTextHeader, wWhichTxRam2 and wWhichTxRam3, and set hJapaneseSyllabary to TX_KATAKANA +; fill wTextHeader1 with TX_KATAKANA, wFontWidth, hBankROM, and register bc for the text's pointer. +ResetTxRam_WriteToTextHeader: ; 2cc8 (0:2cc8) xor a - ld [wce48], a - ld [wce49], a - ld [wce4a], a - ld a, $f - ld [hffaf], a -Func_2cd7: ; 2cd7 (0:2cd7) - push hl - call Func_2d06 + ld [wWhichTextHeader], a + ld [wWhichTxRam2], a + ld [wWhichTxRam3], a + ld a, TX_KATAKANA + ld [hJapaneseSyllabary], a +; fallthrough + +; fill the wTextHeader specified in wWhichTextHeader (0-3) with hJapaneseSyllabary, +; wFontWidth, hBankROM, and register bc for the text's pointer. +WriteToTextHeader: ; 2cd7 (0:2cd7) + push hl + call GetPointerToTextHeader pop bc - ld a, [hffaf] + ld a, [hJapaneseSyllabary] ld [hli], a - ld a, [wRegularFontOrVWF] + ld a, [wFontWidth] ld [hli], a ldh a, [hBankROM] ld [hli], a @@ -7890,18 +8342,24 @@ Func_2cd7: ; 2cd7 (0:2cd7) ld [hl], b ret -Func_2ceb: ; 2ceb (0:2ceb) - call Func_2cd7 - ld hl, wce48 +; same as WriteToTextHeader, except it then increases wWhichTextHeader to +; set the next text header to the current one (usually, because +; it will soon be written to due to a TX_RAM command). +WriteToTextHeader_MoveToNext: ; 2ceb (0:2ceb) + call WriteToTextHeader + ld hl, wWhichTextHeader inc [hl] ret -Func_2cf3: ; 2cf3 (0:2cf3) - call Func_2d06 +; read the wTextHeader specified in wWhichTextHeader (0-3) and use the data to +; populate the corresponding memory addresses. also switch to the text's rombank +; and return the address of the next character in hl. +ReadTextHeader: ; 2cf3 (0:2cf3) + call GetPointerToTextHeader ld a, [hli] - ld [hffaf], a + ld [hJapaneseSyllabary], a ld a, [hli] - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ld a, [hli] call BankswitchHome ld a, [hli] @@ -7909,15 +8367,16 @@ Func_2cf3: ; 2cf3 (0:2cf3) ld l, a ret -Func_2d06: ; 2d06 (0:2d06) - ld a, [wce48] +; return in hl, the address of the wTextHeader specified in wWhichTextHeader (0-3) +GetPointerToTextHeader: ; 2d06 (0:2d06) + ld a, [wWhichTextHeader] ld e, a add a add a add e ld e, a ld d, $0 - ld hl, wce2b + ld hl, wTextHeader1 add hl, de ret @@ -7931,106 +8390,114 @@ Func_2d15: ; 2d15 (0:2d15) jr nz, .labeled call DrawRegularTextBox call EnableLCD - jr .asm_2d36 + jr .init_text .labeled ld hl, wTextBoxLabel ld a, [hli] ld h, [hl] ld l, a call DrawLabeledTextBox -.asm_2d36 +.init_text lb de, 1, 14 call AdjustCoordinatesForBGScroll ld a, 19 - call Func_22a6 + call InitTextPrintingInTextbox pop hl ret -Func_2d43: ; 2d43 (0:2d43) - call Func_2cf3 +; reads the incoming character from the current wTextHeader and processes it +; then updates the current wTextHeader to point to the next character. +; a TX_RAM command causes a switch to a wTextHeader in the level below, and a TX_END +; command terminates the text unless there is a pending wTextHeader in the above level. +ProcessTextHeader: ; 2d43 (0:2d43) + call ReadTextHeader ld a, [hli] or a ; TX_END - jr z, .asm_2d79 - cp $5 - jr c, .asm_2d65 - cp $10 - jr nc, .asm_2d65 - call Func_21f2 - jr nc, .asm_2d74 + jr z, .tx_end + cp TX_CTRL_START + jr c, .character_pair + cp TX_CTRL_END + jr nc, .character_pair + call ProcessSpecialTextCharacter + jr nc, .processed_char cp TX_RAM1 jr z, .tx_ram1 cp TX_RAM2 jr z, .tx_ram2 cp TX_RAM3 jr z, .tx_ram3 - jr .asm_2d74 -.asm_2d65 - ld e, a - ld d, [hl] - call Func_2546 - jr nc, .asm_2d6d + jr .processed_char +.character_pair + ld e, a ; first char + ld d, [hl] ; second char + call ClassifyTextCharacterPair + jr nc, .not_tx_fullwidth inc hl -.asm_2d6d +.not_tx_fullwidth call Func_22ca xor a - call Func_21f2 -.asm_2d74 - call Func_2cd7 + call ProcessSpecialTextCharacter +.processed_char + call WriteToTextHeader or a ret -.asm_2d79 - ld a, [wce48] +.tx_end + ld a, [wWhichTextHeader] or a - jr z, .asm_2d85 + jr z, .no_more_text + ; handle text header in the above level dec a - ld [wce48], a - jr Func_2d43 -.asm_2d85 - call Func_230f + ld [wWhichTextHeader], a + jr ProcessTextHeader +.no_more_text + call TerminateHalfWidthText scf ret .tx_ram2 - call Func_2ceb - ld a, $f - ld [hffaf], a - xor a - ld [wRegularFontOrVWF], a + call WriteToTextHeader_MoveToNext + ld a, TX_KATAKANA + ld [hJapaneseSyllabary], a + xor a ; FULL_WIDTH + ld [wFontWidth], a ld de, wTxRam2 - ld hl, wce49 - call Func_2de0 + ld hl, wWhichTxRam2 + call HandleTxRam2Or3 ld a, l or h - jr z, .asm_2dab - call ReadTextOffset - call Func_2cd7 - jr Func_2d43 -.asm_2dab + jr z, .empty + call GetTextOffsetFromTextID + call WriteToTextHeader + jr ProcessTextHeader +.empty ld hl, wDefaultText - call Func_2cd7 - jr Func_2d43 + call WriteToTextHeader + jr ProcessTextHeader .tx_ram3 - call Func_2ceb + call WriteToTextHeader_MoveToNext ld de, wTxRam3 - ld hl, wce4a - call Func_2de0 + ld hl, wWhichTxRam3 + call HandleTxRam2Or3 call TwoByteNumberToText_CountLeadingZeros - call Func_2cd7 - jp Func_2d43 + call WriteToTextHeader + jp ProcessTextHeader .tx_ram1 - call Func_2ceb - call CopyTurnDuelistName - ld a, [wcaa0] - cp $6 - jr z, .asm_2dda - ld a, $7 - call Func_21f2 -.asm_2dda - call Func_2cd7 - jp Func_2d43 - -; inc [hl] -; hl = [de + 2*[hl]] -Func_2de0: ; 2de0 (0:2de0) + call WriteToTextHeader_MoveToNext + call CopyPlayerNameOrTurnDuelistName + ld a, [wTextBuf] + cp TX_HALFWIDTH + jr z, .tx_halfwidth + ld a, TX_HALF2FULL + call ProcessSpecialTextCharacter +.tx_halfwidth + call WriteToTextHeader + jp ProcessTextHeader + +; input: + ; de: wTxRam2 or wTxRam3 + ; hl: wWhichTxRam2 or wWhichTxRam3 +; return, in hl, the contents of the contents of the +; wTxRam* buffer's current entry, and increment wWhichTxRam*. +HandleTxRam2Or3: ; 2de0 (0:2de0) push de ld a, [hl] inc [hl] @@ -8046,7 +8513,7 @@ Func_2de0: ; 2de0 (0:2de0) ; uses the two byte text id in hl to read the three byte text offset ; loads the correct bank for the specific text and returns the pointer in hl -ReadTextOffset: ; 2ded (0:2ded) +GetTextOffsetFromTextID: ; 2ded (0:2ded) push de ld e, l ld d, h @@ -8074,17 +8541,17 @@ ReadTextOffset: ; 2ded (0:2ded) pop de ret -; if [wRegularFontOrVWF] != 0: -; convert the number at hl to text (ascii) format and write it to wcaa0 +; if [wFontWidth] == HALF_WIDTH: +; convert the number at hl to text (ascii) format and write it to wTextBuf ; return c = 4 - leading_zeros -; if [wRegularFontOrVWF] == 0: -; convert the number at hl to TX_SYMBOL text format and write it to wcaa0 +; if [wFontWidth] == FULL_WIDTH: +; convert the number at hl to TX_SYMBOL text format and write it to wTextBuf ; replace leading zeros with SYM_SPACE TwoByteNumberToText_CountLeadingZeros: ; 2e12 (0:2e12) - ld a, [wRegularFontOrVWF] - or a + ld a, [wFontWidth] + or a ; FULL_WIDTH jp z, TwoByteNumberToTxSymbol_TrimLeadingZeros - ld de, wcaa0 + ld de, wTextBuf push de call TwoByteNumberToText pop hl @@ -8098,9 +8565,10 @@ TwoByteNumberToText_CountLeadingZeros: ; 2e12 (0:2e12) jr nz, .digit_loop ret -; copy the name of the duelist whose turn it is to de -CopyTurnDuelistName: ; 2e2c (0:2e2c) - ld de, wcaa0 +; in the overworld: copy the player's name to wTextBuf +; in a duel: copy the name of the duelist whose turn it is to wTextBuf +CopyPlayerNameOrTurnDuelistName: ; 2e2c (0:2e2c) + ld de, wTextBuf push de ldh a, [hWhoseTurn] cp OPPONENT_TURN @@ -8113,14 +8581,15 @@ CopyTurnDuelistName: ; 2e2c (0:2e2c) pop hl ret -; prints text with id at hl, with letter delay, in a textbox area +; prints text with id at hl, with letter delay, in a textbox area. +; the text must fit in the textbox; PrintScrollableText should be used instead. PrintText: ; 2e41 (0:2e41) ld a, l or h jr z, .from_ram ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID call .print_text pop af call BankswitchHome @@ -8128,7 +8597,7 @@ PrintText: ; 2e41 (0:2e41) .from_ram ld hl, wDefaultText .print_text - call Func_2cc8 + call ResetTxRam_WriteToTextHeader .next_tile_loop ldh a, [hButtonsHeld] ld b, a @@ -8147,18 +8616,19 @@ PrintText: ; 2e41 (0:2e41) dec a jr nz, .text_delay_loop .skip_delay - call Func_2d43 + call ProcessTextHeader jr nc, .next_tile_loop ret -; prints text with id at hl, without letter delay, in a textbox area +; prints text with id at hl, without letter delay, in a textbox area. +; the text must fit in the textbox; PrintScrollableText should be used instead. PrintTextNoDelay: ; 2e76 (0:2e76) ldh a, [hBankROM] push af - call ReadTextOffset - call Func_2cc8 + call GetTextOffsetFromTextID + call ResetTxRam_WriteToTextHeader .next_tile_loop - call Func_2d43 + call ProcessTextHeader jr nc, .next_tile_loop pop af call BankswitchHome @@ -8172,7 +8642,7 @@ CopyText: ; 2e89 (0:2e89) jr z, .special ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID .next_tile_loop ld a, [hli] ld [de], a @@ -8194,9 +8664,9 @@ Func_2ea9: ; 2ea9 (0:2ea9) ldh [hff96], a ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID ldh a, [hff96] - call $23fd + call CopyTextData pop af call BankswitchHome ret @@ -8219,7 +8689,52 @@ LoadTxRam3: ; 2ec4 (0:2ec4) ret ; 0x2ecd - INCROM $2ecd, $2f0a +; load data of card with text id of name at de to wLoadedCard1 +LoadCardDataToBuffer1_FromName: ; 2ecd (0:2ecd) + ld hl, CardPointers + 2 ; skip first $0000 pointer + ld a, BANK(CardPointers) + call BankpushHome2 +.find_card_loop + ld a, [hli] + or [hl] + jr z, .done + push hl + ld a, [hld] + ld l, [hl] + ld h, a + ld a, BANK(CardPointers) + call BankpushHome2 + ld bc, CARD_DATA_NAME + add hl, bc + ld a, [hli] + cp e + jr nz, .no_match + ld a, [hl] + cp d +.no_match + pop hl + pop hl + inc hl + jr nz, .find_card_loop + dec hl + ld a, [hld] + ld l, [hl] + ld h, a + ld a, BANK(CardPointers) + call BankpushHome2 + ld de, wLoadedCard1 + ld b, PKMN_CARD_DATA_LENGTH +.copy_card_loop + ld a, [hli] + ld [de], a + inc de + dec b + jr nz, .copy_card_loop + pop hl +.done + call BankpopHome + ret +; 0x2f0a ; load data of card with id at e to wLoadedCard2 LoadCardDataToBuffer2_FromCardID: ; 2f0a (0:2f0a) @@ -8348,7 +8863,7 @@ GetCardPointer: ; 2f7c (0:2f7c) ; hl = card_gfx_index ; de = where to load the card gfx to ; bc are supposed to be $30 (number of tiles of a card gfx) and TILE_SIZE respectively -; card_gfx_index = (<Name>CardGfx - CardGraphics) / 8 ; using absolute ROM addresses +; card_gfx_index = (<Name>CardGfx - CardGraphics) / 8 (using absolute ROM addresses) ; also copies the card's palette to wCardPalette LoadCardGfx: ; 2fa0 (0:2fa0) ldh a, [hBankROM] @@ -8367,7 +8882,7 @@ LoadCardGfx: ; 2fa0 (0:2fa0) add hl, hl add hl, hl res 7, h - set 6, h ; $4000 ≤ de ≤ $7fff + set 6, h ; $4000 ≤ hl ≤ $7fff call CopyGfxData ld b, CGB_PAL_SIZE ld de, wCardPalette @@ -8383,7 +8898,7 @@ LoadCardGfx: ; 2fa0 (0:2fa0) ; identical to CopyFontsOrDuelGraphicsTiles CopyFontsOrDuelGraphicsTiles2: ; 2fcb (0:2fcb) - ld a, BANK(Fonts); BANK(DuelGraphics); BANK(VWF) + ld a, BANK(Fonts); BANK(DuelGraphics) call BankpushHome ld c, TILE_SIZE call CopyGfxData @@ -9841,7 +10356,87 @@ ResumeSong: ; 37a0 (0:37a0) ret ; 0x37a5 - INCROM $37a5, $380e +Func_37a5: ; 37a5 (0:37a5) + ldh a, [hBankROM] + push af + push hl + srl h + srl h + srl h + ld a, BANK(CardGraphics) + add h + call BankswitchHome + pop hl + add hl, hl + add hl, hl + add hl, hl + res 7, h + set 6, h ; $4000 ≤ hl ≤ $7fff + call Func_37c5 + pop af + call BankswitchHome + ret +; 0x37c5 + +Func_37c5: ; 37c5 (0:37c5) + ld c, $08 +.asm_37c7 + ld b, $06 +.asm_37c9 + push bc + ld c, $08 +.asm_37cc + ld b, $02 +.asm_37ce + push bc + push hl + ld c, [hl] + ld b, $04 +.asm_37d3 + rr c + rra + sra a + dec b + jr nz, .asm_37d3 + ld hl, $c0 + add hl, de + ld [hli], a + inc hl + ld [hl], a + ld b, $04 +.asm_37e4 + rr c + rra + sra a + dec b + jr nz, .asm_37e4 + ld [de], a + ld hl, $2 + add hl, de + ld [hl], a + pop hl + pop bc + inc de + inc hl + dec b + jr nz, .asm_37ce + inc de + inc de + dec c + jr nz, .asm_37cc + pop bc + dec b + jr nz, .asm_37c9 + ld a, $c0 + add e + ld e, a + ld a, $00 + adc d + ld d, a + dec c + jr nz, .asm_37c7 + ret +; 0x380e Func_380e: ; 380e (0:380e) ld a, [wd0c1] @@ -9997,31 +10592,35 @@ Func_3917: ; 3917 (0:3917) call DisableSRAM ret -GetFloorObjectFromPos: ; 3927 (0:3927) +; return in a the permission byte corresponding to the current map's x,y coordinates at bc +GetPermissionOfMapPosition: ; 3927 (0:3927) push hl - call FindFloorTileFromPos + call GetPermissionByteOfMapPosition ld a, [hl] pop hl ret ; 0x392e -SetFloorObjectFromPos: ; 392e (0:392e) +; set to a the permission byte corresponding to the current map's x,y coordinates at bc +SetPermissionOfMapPosition: ; 392e (0:392e) push hl push af - call FindFloorTileFromPos + call GetPermissionByteOfMapPosition pop af ld [hl], a pop hl ret ; 0x3937 -UpdateFloorObjectFromPos: ; 3937 (0:3937) +; set the permission byte corresponding to the current map's x,y coordinates at bc +; to the value of register a anded by its current value +UpdatePermissionOfMapPosition: ; 3937 (0:3937) push hl push bc push de cpl ld e, a - call FindFloorTileFromPos + call GetPermissionByteOfMapPosition ld a, [hl] and e ld [hl], a @@ -10031,8 +10630,9 @@ UpdateFloorObjectFromPos: ; 3937 (0:3937) ret ; 0x3946 -; puts a floor tile in hl given coords in bc (x,y. measured in tiles) -FindFloorTileFromPos: ; 3946 (0:3946) +; returns in hl the address within wPermissionMap that corresponds to +; the current map's x,y coordinates at bc +GetPermissionByteOfMapPosition: ; 3946 (0:3946) push bc srl b srl c @@ -10042,7 +10642,7 @@ FindFloorTileFromPos: ; 3946 (0:3946) or b ld c, a ld b, $0 - ld hl, wFloorObjectMap + ld hl, wPermissionMap add hl, bc pop bc ret @@ -10457,7 +11057,33 @@ Func_3b6a: ; 3b6a (0:3b6a) ret ; 0x3ba2 - INCROM $3ba2, $3bd2 +Func_3ba2: ; 3ba2 (0:3ba2) + ldh a, [hBankROM] + push af + ld a, $07 + call BankswitchHome + call $4ac5 + call Func_3cb4 + pop af + call BankswitchHome + ret +; 0x3bb5 + +Func_3bb5: ; 3bb5 (0:3bb5) + xor a + ld [wd4c0], a + ldh a, [hBankROM] + push af + ld a, [wd4be] + call BankswitchHome + call Func_3cb4 + call CallHL2 + pop af + call BankswitchHome + ld a, $80 + ld [wd4c0], a + ret +; 0x3bd2 ; writes from hl the pointer to the function to be called by DoFrame SetDoFrameFunction: ; 3bd2 (0:3bd2) @@ -10503,13 +11129,68 @@ Func_3bf5: ; 3bf5 (0:3bf5) ret ; 0x3c10 - INCROM $3c10, $3c45 +; fill bc bytes of data at hl with a +FillMemoryWithA: ; 3c10 (0:3c10) + push hl + push de + push bc + ld e, a +.loop + ld [hl], e + inc hl + dec bc + ld a, b + or c + jr nz, .loop + pop bc + pop de + pop hl + ret +; 0x3c1f + +; fill 2*bc bytes of data at hl with d,e +FillMemoryWithDE: ; 3c1f (0:3c1f) + push hl + push bc +.loop + ld [hl], e + inc hl + ld [hl], d + inc hl + dec bc + ld a, b + or c + jr nz, .loop + pop bc + pop hl + ret +; 0x3c2d -Func_3c45: ; 3c45 (0:3c45) +Func_3c2d: ; 3c2d (0:3c2d) + push hl + push af + ldh a, [hBankROM] + push af + push hl + ld hl, sp+$05 + ld a, [hl] + call BankswitchHome + pop hl + ld a, [hl] + ld hl, sp+$03 + ld [hl], a + pop af + call BankswitchHome + pop af + pop hl + ret +; 0x3c45 + +CallHL2: ; 3c45 (0:3c45) jp hl ; 0x3c46 -Func_3c46: ; 3c46 (0:3c46) +PushBC_Ret: ; 3c46 (0:3c46) push bc ret ; 0x3c48 @@ -10609,7 +11290,120 @@ Func_3cb4: ; 3cb4 (0:3cb4) ret ; 0x3cc4 - INCROM $3cc4, $3d72 +; refresh sprites? +Func_3cc4: ; 3cc4 (0:3cc4) + ldh a, [hBankROM] + push af + ld a, [wd5d6] + call BankswitchHome + ld a, [wd5d1] + cp $f0 + ld a, $00 + jr c, .asm_3cd7 + dec a +.asm_3cd7 + ld [wd5d4], a + ld a, [wd5d2] + cp $f0 + ld a, $00 + jr c, .asm_3ce4 + dec a +.asm_3ce4 + ld [wd5d5], a + ld a, [hli] + or a + jp z, .done + ld c, a +.asm_3ced + push bc + push hl + ld b, $00 + bit 7, [hl] + jr z, .asm_3cf6 + dec b +.asm_3cf6 + ld a, [wd5d0] + bit 6, a + jr z, .asm_3d10 + ld a, [hl] + add $08 + ld c, a + ld a, $00 + adc b + ld b, a + ld a, [wd5d2] + sub c + ld e, a + ld a, [wd5d5] + sbc b + jr .asm_3d19 +.asm_3d10 + ld a, [wd5d2] + add [hl] + ld e, a + ld a, [wd5d5] + adc b +.asm_3d19 + or a + jr nz, .asm_3d64 + inc hl + ld b, $00 + bit 7, [hl] + jr z, .asm_3d24 + dec b +.asm_3d24 + ld a, [wd5d0] + bit 5, a + jr z, .asm_3d3e + ld a, [hl] + add $08 + ld c, a + ld a, $00 + adc b + ld b, a + ld a, [wd5d1] + sub c + ld d, a + ld a, [wd5d4] + sbc b + jr .asm_3d47 +.asm_3d3e + ld a, [wd5d1] + add [hl] + ld d, a + ld a, [wd5d4] + adc b +.asm_3d47 + or a + jr nz, .asm_3d64 + inc hl + ld a, [wd5d3] + add [hl] + ld c, a + inc hl + ld a, [wd5d0] + add [hl] + and $17 + ld b, a + ld a, [wd5d0] + xor [hl] + and $e0 + or b + ld b, a + inc hl + call SetOneObjectAttributes +.asm_3d64 + pop hl + ld bc, $4 + add hl, bc + pop bc + dec c + jr nz, .asm_3ced +.done + pop af + call BankswitchHome + ret +; 0x3d72 Func_3d72: ; 3d72 (0:3d72) ldh a, [hBankROM] @@ -10669,6 +11463,9 @@ Func_3db7: ; 3db7 (0:3db7) ; the sprite is identified by its index in wWhichSprite. GetSpriteAnimBufferProperty: ; 3dbf (0:3dbf) ld a, [wWhichSprite] +; fallthrough + +GetSpriteAnimBufferProperty_SpriteInA: cp SPRITE_ANIM_BUFFER_CAPACITY jr c, .got_sprite debug_ret @@ -10689,7 +11486,27 @@ GetSpriteAnimBufferProperty: ; 3dbf (0:3dbf) ret ; 0x3ddb - INCROM $3ddb, $3df3 +Func_3ddb: ; 3ddb (0:3ddb) + push hl + push bc + ld c, SPRITE_ANIM_FIELD_0F + call GetSpriteAnimBufferProperty_SpriteInA + res 2, [hl] + pop bc + pop hl + ret +; 0x3de7 + +Func_3de7: ; 3de7 (0:3de7) + push hl + push bc + ld c, SPRITE_ANIM_FIELD_0F + call GetSpriteAnimBufferProperty_SpriteInA + set 2, [hl] + pop bc + pop hl + ret +; 0x3df3 Func_3df3: ; 3df3 (0:3df3) push af @@ -10731,20 +11548,204 @@ Func_3e2a: ; 3e2a (0:3e2a) jr Func_3e17 ; 0x3e31 - INCROM $3e31, $3fe0 +Func_3e31: ; 3e31 (0:3e31) + ldh a, [hBankROM] + push af + call Func_3cb4 + ld a, $20 + call BankswitchHome + call $44d8 + pop af + call BankswitchHome + ret +; 0x3e44 -; jumps to 3f:hl +; something window scroll +Func_3e44: ; 3e44 (0:3e44) + push af + push hl + push bc + push de + ld hl, wd657 + bit 0, [hl] + jr nz, .done + set 0, [hl] + ld b, $00 + ld hl, wd658 + ld c, [hl] + inc [hl] + ld hl, wd64b + add hl, bc + ld a, [hl] + ldh [rWX], a + ld hl, rLCDC + cp $a7 + jr c, .disable_sprites + set 1, [hl] ; enable sprites + jr .asm_3e6c +.disable_sprites + res 1, [hl] ; disable sprites +.asm_3e6c + ld hl, wd651 + add hl, bc + ld a, [hl] + cp $8f + jr c, .asm_3e9a + ld a, [wd665] + or a + jr z, .asm_3e93 + ld hl, wd659 + ld de, wd64b + ld bc, $6 + call CopyDataHLtoDE + ld hl, wd65f + ld de, wd651 + ld bc, $6 + call CopyDataHLtoDE +.asm_3e93 + xor a + ld [wd665], a + ld [wd658], a +.asm_3e9a + ldh [rLYC], a + ld hl, wd657 + res 0, [hl] +.done + pop de + pop bc + pop hl + pop af + ret +; 0x3ea6 + +; apply background scroll for lines 0 to 96 using the values at BGScrollData +; skip if wApplyBGScroll is non-0 +ApplyBackgroundScroll: ; 3ea6 (0:3ea6) + push af + push hl + call DisableInt_LYCoincidence + ld hl, rSTAT + res 2, [hl] ; reset coincidence flag + ei + ld hl, wApplyBGScroll + ld a, [hl] + or a + jr nz, .done + inc [hl] + push bc + push de + xor a + ld [wNextScrollLY], a +.ly_loop + ld a, [wNextScrollLY] + ld b, a +.wait_ly + ldh a, [rLY] + cp $60 + jr nc, .ly_over_0x60 + cp b ; already hit LY=b? + jr c, .wait_ly + call GetNextBackgroundScroll + ld hl, rSTAT +.wait_hblank_or_vblank + bit 1, [hl] + jr nz, .wait_hblank_or_vblank + ldh [rSCX], a + ldh a, [rLY] + inc a + ld [wNextScrollLY], a + jr .ly_loop +.ly_over_0x60 + xor a + ldh [rSCX], a + ld a, $00 + ldh [rLYC], a + call GetNextBackgroundScroll + ldh [hSCX], a + pop de + pop bc + xor a + ld [wApplyBGScroll], a + call EnableInt_LYCoincidence +.done + pop hl + pop af + ret +; 0x3ef8 + +BGScrollData: ; 3ef8 (0:3ef8) + db 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3 + db 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0 + db 0, -1, -1, -1, -2, -2, -2, -3, -3, -3, -4, -4, -4, -4, -4, -4 + db -5, -4, -4, -4, -4, -4, -4, -3, -3, -3, -2, -2, -2, -1, -1, -1 +; 3f38 + +; x = BGScrollData[(wVBlankCounter + a) & $3f] +; return, in register a, x rotated right [wBGScrollMod]-1 times (max 3 times) +GetNextBackgroundScroll: ; 3f38 (0:3f38) + ld hl, wVBlankCounter + add [hl] + and $3f + ld c, a + ld b, $00 + ld hl, BGScrollData + add hl, bc + ld a, [wBGScrollMod] + ld c, a + ld a, [hl] + dec c + jr z, .done + dec c + jr z, .halve + dec c + jr z, .quarter +; effectively zero + sra a +.quarter + sra a +.halve + sra a +.done + ret +; 0x3f5a + +EnableInt_LYCoincidence: ; 3f5a (0:3f5a) + push hl + ld hl, rSTAT + set 6, [hl] + xor a + ld hl, rIE + set 1, [hl] + pop hl + ret +; 0x3f68 + +DisableInt_LYCoincidence: ; 3f68 (0:3f68) + push hl + ld hl, rSTAT + res 6, [hl] + xor a + ld hl, rIE + res 1, [hl] + pop hl + ret +; 0x3f76 + +rept $6a + db $ff +endr + +; jumps to 3f:hl, then switches to bank 3d Bankswitch3dTo3f:: ; 3fe0 (0:3fe0) push af ld a, $3f ldh [hBankROM], a ld [MBC3RomBank], a pop af - ld bc, Bankswitch3d + ld bc, .bankswitch3d push bc jp hl - -Bankswitch3d: ; 3fe0 (0:3fe0) +.bankswitch3d ld a, $3d ldh [hBankROM], a ld [MBC3RomBank], a diff --git a/src/gfx.asm b/src/gfx.asm index aa5527d..d568802 100644 --- a/src/gfx.asm +++ b/src/gfx.asm @@ -2,16 +2,24 @@ INCLUDE "macros.asm" SECTION "Gfx 1", ROMX -Fonts:: ; 74000 (1d:4000) -INCBIN "gfx/fonts.t3.1bpp" +Fonts:: -VWF:: ; 76668 (1d:6668) -INCBIN "gfx/vwf.1bpp" +FullWidthFonts:: ; 74000 (1d:4000) +INCBIN "gfx/fonts/full_width/0_0_katakana.1bpp" +INCBIN "gfx/fonts/full_width/0_1_hiragana.1bpp" +INCBIN "gfx/fonts/full_width/0_2_digits_kanji1.1bpp" +INCBIN "gfx/fonts/full_width/1_kanji2.1bpp" +INCBIN "gfx/fonts/full_width/2_kanji3.1bpp" +INCBIN "gfx/fonts/full_width/3.1bpp" +INCBIN "gfx/fonts/full_width/4.t3.1bpp" -DuelGraphics:: +HalfWidthFont:: ; 76668 (1d:6668) +INCBIN "gfx/fonts/half_width.1bpp" + +SymbolsFont:: ; 76968 (1d:6968) +INCBIN "gfx/fonts/symbols.2bpp" -DuelHUDGraphics:: ; 76968 (1d:6968) -INCBIN "gfx/duel/hud.2bpp" +DuelGraphics:: DuelCardHeaderGraphics:: ; 76ce8 (1d:6ce8) INCBIN "gfx/duel/card_headers.2bpp" diff --git a/src/gfx/fonts.t3.png b/src/gfx/fonts.t3.png Binary files differdeleted file mode 100644 index 5dc1fe8..0000000 --- a/src/gfx/fonts.t3.png +++ /dev/null diff --git a/src/gfx/fonts/full_width/0_0_katakana.png b/src/gfx/fonts/full_width/0_0_katakana.png Binary files differnew file mode 100644 index 0000000..70b6612 --- /dev/null +++ b/src/gfx/fonts/full_width/0_0_katakana.png diff --git a/src/gfx/fonts/full_width/0_1_hiragana.png b/src/gfx/fonts/full_width/0_1_hiragana.png Binary files differnew file mode 100644 index 0000000..3fda24a --- /dev/null +++ b/src/gfx/fonts/full_width/0_1_hiragana.png diff --git a/src/gfx/fonts/full_width/0_2_digits_kanji1.png b/src/gfx/fonts/full_width/0_2_digits_kanji1.png Binary files differnew file mode 100644 index 0000000..393d6b3 --- /dev/null +++ b/src/gfx/fonts/full_width/0_2_digits_kanji1.png diff --git a/src/gfx/fonts/full_width/1_kanji2.png b/src/gfx/fonts/full_width/1_kanji2.png Binary files differnew file mode 100644 index 0000000..0739069 --- /dev/null +++ b/src/gfx/fonts/full_width/1_kanji2.png diff --git a/src/gfx/fonts/full_width/2_kanji3.png b/src/gfx/fonts/full_width/2_kanji3.png Binary files differnew file mode 100644 index 0000000..7259463 --- /dev/null +++ b/src/gfx/fonts/full_width/2_kanji3.png diff --git a/src/gfx/fonts/full_width/3.png b/src/gfx/fonts/full_width/3.png Binary files differnew file mode 100644 index 0000000..6eccd3e --- /dev/null +++ b/src/gfx/fonts/full_width/3.png diff --git a/src/gfx/fonts/full_width/4.t3.png b/src/gfx/fonts/full_width/4.t3.png Binary files differnew file mode 100644 index 0000000..6ccef5d --- /dev/null +++ b/src/gfx/fonts/full_width/4.t3.png diff --git a/src/gfx/vwf.png b/src/gfx/fonts/half_width.png Binary files differindex 39e783e..39e783e 100644 --- a/src/gfx/vwf.png +++ b/src/gfx/fonts/half_width.png diff --git a/src/gfx/duel/hud.png b/src/gfx/fonts/symbols.png Binary files differindex 81afc3b..81afc3b 100644 --- a/src/gfx/duel/hud.png +++ b/src/gfx/fonts/symbols.png diff --git a/src/hram.asm b/src/hram.asm index 25f8f10..13c4756 100644 --- a/src/hram.asm +++ b/src/hram.asm @@ -59,13 +59,14 @@ hTempListPtr_ff99:: ; ff99 hTempCardID_ff9b:: ; ff9b ds $2 -; a PLAY_AREA_ARENA constant (0: arena card, 1-5: bench card) +; a PLAY_AREA_* constant (0: arena card, 1-5: bench card) hTempPlayAreaLocationOffset_ff9d:: ; ff9d ds $1 hAIActionTableIndex:: ; ff9e ds $1 +; deck index of a card (0-59) hTempCardIndex_ff9f:: ; ff9f ds $1 @@ -73,10 +74,11 @@ hTempCardIndex_ff9f:: ; ff9f hTemp_ffa0:: ; ffa0 ds $1 +; a PLAY_AREA_* constant (0: arena card, 1-5: bench card) hTempPlayAreaLocationOffset_ffa1:: ; ffa1 ds $1 -; FF-terminated list of cards $to be discarded upon retreat +; FF-terminated list of cards to be discarded upon retreat hTempRetreatCostCards:: ; ffa2 ds $6 @@ -106,7 +108,12 @@ hTextHorizontalAlign:: ; ffad hTextLineLength:: ; ffae ds $1 -hffaf:: ; ffaf +; when printing text and no leading control character is specified, whether characters +; $10 to $60 map to the katakana.1bpp font graphics as characters $0 to $50 +; (TX_KATAKANA mode), or map to the hiragana.1bpp font graphics (TX_HIRAGANA mode). +; the TX_HIRAGANA and TX_KATAKANA control characters are used to set this address to said +; value. only these two values are admitted, as any other is interpreted as TX_HIRAGANA. +hJapaneseSyllabary:: ; ffaf ds $1 hffb0:: ; ffb0 diff --git a/src/macros.asm b/src/macros.asm index 7425977..d592c8d 100644 --- a/src/macros.asm +++ b/src/macros.asm @@ -1,6 +1,7 @@ INCLUDE "macros/audio.asm" -INCLUDE "macros/code.asm" INCLUDE "macros/constants.asm" +INCLUDE "macros/code.asm" INCLUDE "macros/data.asm" INCLUDE "macros/scripts.asm" +INCLUDE "macros/text.asm" INCLUDE "macros/wram.asm" diff --git a/src/macros/data.asm b/src/macros/data.asm index ddb7443..80c4ba2 100644 --- a/src/macros/data.asm +++ b/src/macros/data.asm @@ -90,6 +90,10 @@ txsymbol: MACRO charmap "\1>", const_value + -1 ENDM +fwcharmap: MACRO + charmap STRCAT("FW\1_", \2), \3 +ENDM + textitem: MACRO db \1, \2 tx \3 diff --git a/src/macros/text.asm b/src/macros/text.asm new file mode 100644 index 0000000..dd47c02 --- /dev/null +++ b/src/macros/text.asm @@ -0,0 +1,84 @@ +text EQUS "db TX_HALFWIDTH, " +line EQUS "db TX_LINE, " +done EQUS "db TX_END" + +half2full EQUS "db TX_HALF2FULL" + +katakana: MACRO + db TX_KATAKANA + rept _NARG + db STRCAT("FW0_", \1) + shift + endr +ENDM + +hiragana: MACRO + db TX_HIRAGANA + rept _NARG + db STRCAT("FW0_", \1) + shift + endr +ENDM + +textfw0: MACRO + rept _NARG +if STRSUB(\1, 1, 1) == "<" && STRLEN(\1) > 1 + db \1 +else + db STRCAT("FW0_", \1) +endc + shift + endr +ENDM + +textfw1: MACRO + rept _NARG +if (\1) == " " + db STRCAT("FW0_", \1) +elif STRSUB(\1, 1, 1) == "<" && STRLEN(\1) > 1 + db \1 +else + db TX_FULLWIDTH1, STRCAT("FW1_", \1) +endc + shift + endr +ENDM + +textfw2: MACRO + rept _NARG +if (\1) == " " + db STRCAT("FW0_", \1) +elif STRSUB(\1, 1, 1) == "<" && STRLEN(\1) > 1 + db \1 +else + db TX_FULLWIDTH2, STRCAT("FW2_", \1) +endc + shift + endr +ENDM + +textfw3: MACRO + rept _NARG +if (\1) == " " + db STRCAT("FW0_", \1) +elif STRSUB(\1, 1, 1) == "<" && STRLEN(\1) > 1 + db \1 +else + db TX_FULLWIDTH3, STRCAT("FW3_", \1) +endc + shift + endr +ENDM + +textfw4: MACRO + rept _NARG +if (\1) == " " + db STRCAT("FW0_", \1) +elif STRSUB(\1, 1, 1) == "<" && STRLEN(\1) > 1 + db \1 +else + db TX_FULLWIDTH4, STRCAT("FW4_", \1) +endc + shift + endr +ENDM diff --git a/src/macros/wram.asm b/src/macros/wram.asm index cedb0dd..ad6075f 100644 --- a/src/macros/wram.asm +++ b/src/macros/wram.asm @@ -39,6 +39,13 @@ move_data_struct: MACRO \1Animation:: ds 1 ENDM +text_header: MACRO +\1DefaultFont:: ds 1 +\1FontWidth:: ds 1 +\1Address:: ds 2 +\1RomBank:: ds 1 +ENDM + ; TODO: Figure out what the rest are for sprite_anim_struct: MACRO \1Field0x00:: ds 1 diff --git a/src/text/text1.asm b/src/text/text1.asm index 4274caf..0274dc2 100644 --- a/src/text/text1.asm +++ b/src/text/text1.asm @@ -39,7 +39,7 @@ PKMNPWRText: ; 36356 (d:6356) done Text000b: ; 36360 (d:6360) - db $56,$19,$33,$3d,$16,$78,$4c + textfw0 "ポ", "ケ", "モ", "ン", "カ", "-(2)", "ド" done LengthText: ; 36368 (d:6368) @@ -55,7 +55,7 @@ PokemonText: ; 36378 (d:6378) done Text000f: ; 36382 (d:6382) - db $03,$4c + textfw3 "m" done LbsText: ; 36385 (d:6385) @@ -63,19 +63,19 @@ LbsText: ; 36385 (d:6385) done Text0011: ; 3638b (d:638b) - db $70 + textfw0 " " done Text0012: ; 3638d (d:638d) - db $03,$52 + textfw3 "●" done Text0013: ; 36390 (d:6390) - db $03,$53 + textfw3 "◆" done Text0014: ; 36393 (d:6393) - db $03,$54 + textfw3 "★" done Text0015: ; 36396 (d:6396) @@ -147,27 +147,27 @@ UnableDueToParalysisText: ; 364a1 (d:64a1) done Received10DamageDueToPoisonText: ; 364be (d:64be) - text TX_RAM2, " received" + text "<RAMTEXT> received" line "10 damage due to Poison." done Received20DamageDueToPoisonText: ; 364e3 (d:64e3) - text TX_RAM2, " received" + text "<RAMTEXT> received" line "20 damage due to Double Poison." done IsStillAsleepText: ; 3650f (d:650f) - text TX_RAM2, " is" + text "<RAMTEXT> is" line "still Asleep." done IsCuredOfSleepText: ; 36523 (d:6523) - text TX_RAM2, " is" + text "<RAMTEXT> is" line "cured of Sleep." done IsCuredOfParalysisText: ; 36539 (d:6539) - text TX_RAM2, " is" + text "<RAMTEXT> is" line "cured of Paralysis." done @@ -204,7 +204,7 @@ Text0032: ; 365b6 (d:65b6) done UsedText: ; 365be (d:65be) - text "Used ", TX_RAM2, "." + text "Used <RAMTEXT>." done Text0034: ; 365c7 (d:65c7) @@ -212,38 +212,38 @@ Text0034: ; 365c7 (d:65c7) done PokemonsAttackText: ; 365d8 (d:65d8) - text TX_RAM2, "'s" + text "<RAMTEXT>'s" line "" - text TX_RAM2, "!" + text "<RAMTEXT>!" done Text0036: ; 365e1 (d:65e1) - text TX_RAM2, " received" - line TX_RAM3, " damage due to Resistance!" + text "<RAMTEXT> received" + line "<RAMNUM> damage due to Resistance!" done Text0037: ; 36609 (d:6609) - text TX_RAM2, " received" - line TX_RAM3, " damage due to Weakness!" + text "<RAMTEXT> received" + line "<RAMNUM> damage due to Weakness!" done Text0038: ; 3662f (d:662f) - text TX_RAM2, " received" - line TX_RAM3, " damage due to Weakness!" + text "<RAMTEXT> received" + line "<RAMNUM> damage due to Weakness!" done Text0039: ; 36655 (d:6655) - text TX_RAM2, " did not" + text "<RAMTEXT> did not" line "receive damage due to Resistance." done Text003a: ; 36682 (d:6682) - text TX_RAM2, " took" - line TX_RAM3, " damage." + text "<RAMTEXT> took" + line "<RAMNUM> damage." done Text003b: ; 36694 (d:6694) - text TX_RAM2, " did not" + text "<RAMTEXT> did not" line "receive damage!" done @@ -278,16 +278,16 @@ DiscardDescription: ; 36757 (d:6757) done Text0042: ; 367cc (d:67cc) - text TX_RAM1, " will draw ", TX_RAM3, " Prize(s)." + text "<RAMNAME> will draw <RAMNUM> Prize(s)." done Text0043: ; 367e5 (d:67e5) - text TX_RAM1, " drew ", TX_RAM3, " Prize(s)." + text "<RAMNAME> drew <RAMNUM> Prize(s)." done Text0044: ; 367f9 (d:67f9) - text TX_RAM1, " placed" - line "a ", TX_RAM2, "." + text "<RAMNAME> placed" + line "a <RAMTEXT>." done Text0045: ; 36808 (d:6808) @@ -304,27 +304,27 @@ Text0046: ; 3681b (d:681b) done Text0047: ; 36848 (d:6848) - db "<GRASS>" + textfw0 "<GRASS>" done Text0048: ; 3684b (d:684b) - db "<FIRE>" + textfw0 "<FIRE>" done Text0049: ; 3684e (d:684e) - db "<WATER>" + textfw0 "<WATER>" done Text004a: ; 36851 (d:6851) - db "<LIGHTNING>" + textfw0 "<LIGHTNING>" done Text004b: ; 36854 (d:6854) - db "<FIGHTING>" + textfw0 "<FIGHTING>" done Text004c: ; 36857 (d:6857) - db "<PSYCHIC>" + textfw0 "<PSYCHIC>" done Text004d: ; 3685a (d:685a) @@ -387,18 +387,18 @@ Text0059: ; 369dc (d:69dc) done RetreatedToTheBenchText: ; 36a19 (d:6a19) - text TX_RAM2, "" + text "<RAMTEXT>" line "Retreated to the Bench." done RetreatWasUnsuccessfulText: ; 36a34 (d:6a34) - text TX_RAM2, "'s" + text "<RAMTEXT>'s" line "Retreat was unsuccessful." done WillUseThePokemonPowerText: ; 36a53 (d:6a53) - text TX_RAM2, " will use the" - line "Pokémon Power ", TX_RAM2, "." + text "<RAMTEXT> will use the" + line "Pokémon Power <RAMTEXT>." done FinishedTurnWithoutAttackingText: ; 36a74 (d:6a74) @@ -407,31 +407,31 @@ FinishedTurnWithoutAttackingText: ; 36a74 (d:6a74) done Text005e: ; 36a9a (d:6a9a) - text TX_RAM1, "'s Turn." + text "<RAMNAME>'s Turn." done Text005f: ; 36aa5 (d:6aa5) - text "Attached ", TX_RAM2, "" - line "to ", TX_RAM2, "." + text "Attached <RAMTEXT>" + line "to <RAMTEXT>." done Text0060: ; 36ab7 (d:6ab7) - text TX_RAM2, " evolved" - line "into ", TX_RAM2, "." + text "<RAMTEXT> evolved" + line "into <RAMTEXT>." done PlacedOnTheBenchText: ; 36aca (d:6aca) - text "Placed ", TX_RAM2, "" + text "Placed <RAMTEXT>" line "on the Bench." done PlacedInTheArenaText: ; 36ae2 (d:6ae2) - text TX_RAM2, "" + text "<RAMTEXT>" line "was placed in the Arena." done ShufflesTheDeckText: ; 36afe (d:6afe) - text TX_RAM1, " shuffles the Deck." + text "<RAMNAME> shuffles the Deck." done Text0064: ; 36b14 (d:6b14) @@ -449,12 +449,12 @@ Text0066: ; 36b7a (d:6b7a) done Text0067: ; 36b9a (d:6b9a) - text TX_RAM1, "" + text "<RAMNAME>" line "drew 7 cards." done DeckHasXCardsText: ; 36bab (d:6bab) - text TX_RAM1, "'s deck has ", TX_RAM3, " cards." + text "<RAMNAME>'s deck has <RAMNUM> cards." done ChooseBasicPkmnToPlaceInArenaText: ; 36bc2 (d:6bc2) @@ -464,7 +464,7 @@ ChooseBasicPkmnToPlaceInArenaText: ; 36bc2 (d:6bc2) Text006a: ; 36bf1 (d:6bf1) text "There are no Basic Pokémon" - line "in ", TX_RAM1, "'s hand." + line "in <RAMNAME>'s hand." done NeitherPlayerHasBasicPkmnText: ; 36c1a (d:6c1a) @@ -493,7 +493,7 @@ Text006f: ; 36ce1 (d:6ce1) done YouDrewText: ; 36cfd (d:6cfd) - text "You drew ", TX_RAM2, "." + text "You drew <RAMTEXT>." done Text0071: ; 36d0a (d:6d0a) @@ -506,13 +506,13 @@ PlacingThePrizesText: ; 36d28 (d:6d28) PleasePlacePrizesText: ; 36d3f (d:6d3f) text "Please place" - line TX_RAM3, " Prizes." + line "<RAMNUM> Prizes." done IfHeadPlayerPlaysFirstText: ; 36d57 (d:6d57) text "If heads," line "" - text TX_RAM2, " plays first." + text "<RAMTEXT> plays first." done CoinTossToDetermineWhoFirstText: ; 36d72 (d:6d72) @@ -525,17 +525,17 @@ DecisionText: ; 36da4 (d:6da4) done DuelWasADrawText: ; 36db1 (d:6db1) - text "The Duel with ", TX_RAM1, "" + text "The Duel with <RAMNAME>" line "was a Draw!" done WonDuelText: ; 36dce (d:6dce) - text "You won the Duel with ", TX_RAM1, "!" + text "You won the Duel with <RAMNAME>!" done LostDuelText: ; 36de8 (d:6de8) text "You lost the Duel" - line "with ", TX_RAM1, "..." + line "with <RAMNAME>..." done StartSuddenDeathMatchText: ; 36e05 (d:6e05) @@ -562,22 +562,22 @@ Text007e: ; 36e63 (d:6e63) done Text007f: ; 36e6a (d:6e6a) - text TX_RAM1, " took" + text "<RAMNAME> took" line "all the Prizes!" done Text0080: ; 36e82 (d:6e82) text "There are no Pokémon" - line "in ", TX_RAM1, "'s Play Area!" + line "in <RAMNAME>'s Play Area!" done WasKnockedOutText: ; 36eaa (d:6eaa) - text TX_RAM2, " was" + text "<RAMTEXT> was" line "Knocked Out!" done HavePokemonPowerText: ; 36ebe (d:6ebe) - text TX_RAM2, " have" + text "<RAMTEXT> have" line "Pokémon Power." done @@ -602,15 +602,18 @@ Text0086: ; 36f31 (d:6f31) done Text0087: ; 36f43 (d:6f43) - db $03,$31,$0c,$03,$42,$0c + textfw3 "B" + textfw0 "<RAMNUM>" + textfw3 "S" + textfw0 "<RAMNUM>" done DuelistIsThinkingText: ; 36f4a (d:6f4a) - text TX_RAM1, " is thinking." + text "<RAMNAME> is thinking." done Text0089: ; 36f5a (d:6f5a) - db $70,$70,$70,$70,$70,$70,$70,$70,$70,$70 + textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " ", " " done Text008a: ; 36f65 (d:6f65) @@ -703,7 +706,10 @@ Text0098: ; 37179 (d:7179) Text0099: ; 37184 (d:7184) text "Load File" - line " ",$07,$60,$06," Last Saved File" + line " " + half2full + textfw0 "0" + text " Last Saved File" done Text009a: ; 371a6 (d:71a6) @@ -780,15 +786,15 @@ Text00a6: ; 3737b (d:737b) done DuelistHandText: ; 37392 (d:7392) - text TX_RAM1, "'s Hand" + text "<RAMNAME>'s Hand" done DuelistPlayAreaText: ; 3739c (d:739c) - text TX_RAM1, "'s Play Area" + text "<RAMNAME>'s Play Area" done DuelistDeckText: ; 373ab (d:73ab) - text TX_RAM1, "'s Deck" + text "<RAMNAME>'s Deck" done PleaseSelectHandText: ; 373b5 (d:73b5) @@ -892,7 +898,7 @@ Text00be: ; 37715 (d:7715) done EnergyCardsRequiredToRetreatText: ; 37758 (d:7758) - text TX_RAM3, " Energy cards" + text "<RAMNUM> Energy cards" line "are required to Retreat." done @@ -1108,7 +1114,7 @@ Text00ec: ; 37e73 (d:7e73) done Text00ed: ; 37e92 (d:7e92) - text "If Tails, ", TX_RAM3, " damage" + text "If Tails, <RAMNUM> damage" line "to yourself, too." done @@ -1138,10 +1144,10 @@ Text00f2: ; 37f9a (d:7f9a) Text00f3: ; 37fa8 (d:7fa8) text "Damage check!" - line "If Heads, +", TX_RAM3, " damage!!" + line "If Heads, +<RAMNUM> damage!!" done Text00f4: ; 37fcd (d:7fcd) text "Damage check!" - line "If Heads, x ", TX_RAM3, " damage!!" + line "If Heads, x <RAMNUM> damage!!" done diff --git a/src/text/text12.asm b/src/text/text12.asm index e3e7e12..cb4f50a 100644 --- a/src/text/text12.asm +++ b/src/text/text12.asm @@ -1249,7 +1249,7 @@ ImakuniDescription: ; 635cb (18:75cb) line "Imakuni wants you to play him as a" line "Basic Pokémon, but you can't." line "A mysterious creature not listed in" - line "the Pok`dex. He asks kids around the" + line "the Pokédex. He asks kids around the" line "world,”Who is cuter-Pikachu or me?”" done @@ -1318,7 +1318,7 @@ MysteriousFossilDescriptionCont: ; 63ad2 (18:7ad2) line "Pokémon. (Discard it anyway.) At any" line "time during your turn before your" line "attack, you may discard Mysterious" - line "Fossil from play. (Use GameBoy Pok`-" + line "Fossil from play. (Use GameBoy Poké-" line "mon Power menu option to do this.)" done @@ -1396,7 +1396,7 @@ PokemonCenterDescription: ; 63e9e (18:7e9e) done PokeBallName: ; 63f2e (18:7f2e) - text "Pok` Ball" + text "Poké Ball" done PokeBallDescription: ; 63f39 (18:7f39) diff --git a/src/text/text13.asm b/src/text/text13.asm index b3ba269..bb48917 100644 --- a/src/text/text13.asm +++ b/src/text/text13.asm @@ -18,7 +18,7 @@ ComputerSearchDescription: ; 6408e (19:408e) done PokedexName: ; 6411d (19:411d) - text "Pok`dex" + text "Pokédex" done PokedexDescription: ; 64126 (19:4126) diff --git a/src/text/text2.asm b/src/text/text2.asm index 2248bea..cd3aeed 100644 --- a/src/text/text2.asm +++ b/src/text/text2.asm @@ -19,7 +19,7 @@ ConfusionCheckRetreatText: ; 380ac (e:40ac) done Text00f9: ; 380db (e:40db) - text TX_RAM2, "'s Sleep check." + text "<RAMTEXT>'s Sleep check." done Text00fa: ; 380ed (e:40ed) @@ -72,12 +72,12 @@ UnableToUseAttackDueToAmnesiaText: ; 382af (e:42af) done KnockedOutDueToDestinyBondText: ; 382e9 (e:42e9) - text TX_RAM2, " was Knocked Out" + text "<RAMTEXT> was Knocked Out" line "due to the effects of Destiny Bond." done ReceivesDamageDueToStrikesBackText: ; 38320 (e:4320) - text TX_RAM2, " receives ", TX_RAM3, " damage" + text "<RAMTEXT> receives <RAMNUM> damage" line "due to the effects of Strikes Back." done @@ -117,8 +117,8 @@ NoDamageOrEffectDueToTransparencyText: ; 384d8 (e:44d8) done Text010d: ; 3851f (e:451f) - text TX_RAM2, "" - line "metamorphs to ", TX_RAM2, "." + text "<RAMTEXT>" + line "metamorphs to <RAMTEXT>." done SelectPkmnOnBenchToSwitchWithActiveText: ; 38533 (e:4533) @@ -132,7 +132,7 @@ Text010f: ; 38575 (e:4575) done Text0110: ; 3859e (e:459e) - text TX_RAM1, " is selecting a Pokémon" + text "<RAMNAME> is selecting a Pokémon" line "to place in the Arena." done @@ -154,19 +154,19 @@ Text0113: ; 38647 (e:4647) Text0114: ; 3868d (e:468d) text "Changed the Weakness of" line "" - text TX_RAM2, " to ", TX_RAM2, "." + text "<RAMTEXT> to <RAMTEXT>." done Text0115: ; 386af (e:46af) text "Changed the Resistance of" line "" - text TX_RAM2, " to ", TX_RAM2, "." + text "<RAMTEXT> to <RAMTEXT>." done Text0116: ; 386d3 (e:46d3) text "Changed the color of" line "" - text TX_RAM2, " to ", TX_RAM2, "." + text "<RAMTEXT> to <RAMTEXT>." done Text0117: ; 386f2 (e:46f2) @@ -174,7 +174,7 @@ Text0117: ; 386f2 (e:46f2) done DrawCardsFromTheDeck: ; 3870e (e:470e) - text "Draw ", TX_RAM3, " card(s) from the Deck." + text "Draw <RAMNUM> card(s) from the Deck." done NoCardsInDeckCannotDraw: ; 3872d (e:472d) @@ -407,7 +407,7 @@ Text013a: ; 391dc (e:51dc) done Text013b: ; 39215 (e:5215) - text "There is no ", TX_RAM2, "" + text "There is no <RAMTEXT>" line "in the Deck." done @@ -451,7 +451,7 @@ Text0144: ; 3930a (e:530a) Text0145: ; 39318 (e:5318) text "Peek was used to look at the" - line TX_RAM2, " in your Hand." + line "<RAMTEXT> in your Hand." done Text0146: ; 39346 (e:5346) @@ -459,12 +459,12 @@ Text0146: ; 39346 (e:5346) done Text0147: ; 3935d (e:535d) - text TX_RAM2, " and all attached" + text "<RAMTEXT> and all attached" line "cards were returned to the Hand." done Text0148: ; 39392 (e:5392) - text TX_RAM2, " was chosen" + text "<RAMTEXT> was chosen" line "for the effect of Amnesia." done @@ -474,27 +474,27 @@ Text0149: ; 393bb (e:53bb) done WasUnsuccessfulText: ; 393e6 (e:53e6) - text TX_RAM2, "'s" - line TX_RAM2, " was unsuccessful." + text "<RAMTEXT>'s" + line "<RAMTEXT> was unsuccessful." done Text014b: ; 393ff (e:53ff) text "There was no effect" - line "from ", TX_RAM2, "." + line "from <RAMTEXT>." done Text014c: ; 3941c (e:541c) - text "The Energy card from ", TX_RAM1, "'s" + text "The Energy card from <RAMNAME>'s" line "Play Area was moved." done Text014d: ; 3944b (e:544b) - text TX_RAM1, " drew" - line TX_RAM3, " Fire Energy from the Hand." + text "<RAMNAME> drew" + line "<RAMNUM> Fire Energy from the Hand." done Text014e: ; 39470 (e:5470) - text "The Pokémon cards in ", TX_RAM1, "'s" + text "The Pokémon cards in <RAMNAME>'s" line "Hand and Deck were shuffled" done @@ -549,7 +549,7 @@ Text0158: ; 3968b (e:568b) done Text0159: ; 396b4 (e:56b4) - text "You can draw up to ", TX_RAM3, " cards." + text "You can draw up to <RAMNUM> cards." line "A to Draw, B to End." done @@ -608,7 +608,7 @@ Text0164: ; 3985b (e:585b) done Text0165: ; 3986b (e:586b) - text TX_RAM2, " was chosen." + text "<RAMTEXT> was chosen." done Text0166: ; 3987a (e:587a) @@ -637,27 +637,27 @@ Text016a: ; 39952 (e:5952) done Text016b: ; 39987 (e:5987) - text TX_RAM2, " and all attached" + text "<RAMTEXT> and all attached" line "cards were returned to the Deck." done Text016c: ; 399bc (e:59bc) - text TX_RAM2, " was returned" + text "<RAMTEXT> was returned" line "from the Arena to the Hand." done Text016d: ; 399e8 (e:59e8) - text TX_RAM2, " was returned" + text "<RAMTEXT> was returned" line "from the Bench to the Hand." done Text016e: ; 39a14 (e:5a14) - text TX_RAM2, " was returned" + text "<RAMTEXT> was returned" line "to the Deck." done Text016f: ; 39a31 (e:5a31) - text TX_RAM2, " was placed" + text "<RAMTEXT> was placed" line "in the Hand." done @@ -680,12 +680,12 @@ Text0173: ; 39a9c (e:5a9c) done Text0174: ; 39ab9 (e:5ab9) - text "Discarded ", TX_RAM3, " cards" - line "from ", TX_RAM1, "'s Deck." + text "Discarded <RAMNUM> cards" + line "from <RAMNAME>'s Deck." done Text0175: ; 39adb (e:5adb) - text "Discarded ", TX_RAM2, "" + text "Discarded <RAMTEXT>" line "from the Hand." done @@ -694,23 +694,23 @@ Text0176: ; 39af7 (e:5af7) done Text0177: ; 39b03 (e:5b03) - text TX_RAM2, "" + text "<RAMTEXT>" line "came to the Bench!" done Text0178: ; 39b19 (e:5b19) - text TX_RAM1, " has" + text "<RAMNAME> has" line "no cards in Hand!" done Text0179: ; 39b32 (e:5b32) - text TX_RAM2, " healed" - line TX_RAM3, " damage!" + text "<RAMTEXT> healed" + line "<RAMNUM> damage!" done Text017a: ; 39b46 (e:5b46) - text TX_RAM2, " devolved" - line "to ", TX_RAM2, "!" + text "<RAMTEXT> devolved" + line "to <RAMTEXT>!" done Text017b: ; 39b58 (e:5b58) @@ -718,7 +718,7 @@ Text017b: ; 39b58 (e:5b58) done Text017c: ; 39b73 (e:5b73) - text "You can select ", TX_RAM3, " more cards. Quit?" + text "You can select <RAMNUM> more cards. Quit?" done Text017d: ; 39b97 (e:5b97) @@ -757,7 +757,7 @@ Text0183: ; 39c5a (e:5c5a) Text0184: ; 39c86 (e:5c86) text "Exchanged the cards" - line "in ", TX_RAM1, "'s Hand." + line "in <RAMNAME>'s Hand." done Text0185: ; 39ca8 (e:5ca8) @@ -780,8 +780,8 @@ Text0188: ; 39cea (e:5cea) done Text0189: ; 39d1b (e:5d1b) - text "Begin a ", TX_RAM3, "-Prize Duel" - line "with ", TX_RAM1, "." + text "Begin a <RAMNUM>-Prize Duel" + line "with <RAMNAME>." done Text018a: ; 39d39 (e:5d39) @@ -805,32 +805,32 @@ Text018d: ; 39dcc (e:5dcc) done Text018e: ; 39e02 (e:5e02) - text "Received ", TX_RAM2, "" + text "Received <RAMTEXT>" line "through Card Pop!" done ReceivedCardText: ; 39e20 (e:5e20) - text TX_RAM1, " received" - line "a ", TX_RAM2, "!" + text "<RAMNAME> received" + line "a <RAMTEXT>!" done ReceivedPromotionalCardText: ; 39e31 (e:5e31) - text TX_RAM1, " received a Promotional" - line "card ", TX_RAM2, "!" + text "<RAMNAME> received a Promotional" + line "card <RAMTEXT>!" done ReceivedLegendaryCardText: ; 39e53 (e:5e53) - text TX_RAM1, " received the Legendary" - line "card ", TX_RAM2, "!" + text "<RAMNAME> received the Legendary" + line "card <RAMTEXT>!" done ReceivedPromotionalFlyingPikachuText: ; 39e75 (e:5e75) - text TX_RAM1, " received a Promotinal" + text "<RAMNAME> received a Promotinal" line "card Flyin' Pikachu!" done ReceivedPromotionalSurfingPikachuText: ; 39ea3 (e:5ea3) - text TX_RAM1, " received a Promotional" + text "<RAMNAME> received a Promotional" line "card Surfin' Pikachu!" done @@ -853,11 +853,11 @@ Text0197: ; 39f2f (e:5f2f) done Text0198: ; 39f4d (e:5f4d) - text "Sent to ", TX_RAM1, "." + text "Sent to <RAMNAME>." done Text0199: ; 39f59 (e:5f59) - text "Received from ", TX_RAM1, "." + text "Received from <RAMNAME>." done Text019a: ; 39f6b (e:5f6b) @@ -988,7 +988,7 @@ Text01b0: ; 3a519 (e:6519) done Text01b1: ; 3a559 (e:6559) - db TX_END + done Text01b2: ; 3a55a (e:655a) text "1. Take Drowzee from your hand" @@ -1213,14 +1213,15 @@ Text01d3: ; 3b196 (e:7196) text "Now Machop has only 10 HP left." line "Let's finish the battle!" line "Attack with Starmie's Star Freeze." - line TX_END + line "" + done Text01d4: ; 3b1f4 (e:71f4) text "You've Knocked Out your opponent!" line "" line "Pick up the last Prize." line "" - text TX_RAM1, " is the winner!" + text "<RAMNAME> is the winner!" done Text01d5: ; 3b242 (e:7242) @@ -1259,7 +1260,7 @@ Text01da: ; 3b3bb (e:73bb) done Text01db: ; 3b3fe (e:73fe) - text TX_RAM1, "'s turn ", TX_RAM3 + text "<RAMNAME>'s turn <RAMNUM>" done Text01dc: ; 3b40a (e:740a) @@ -1483,19 +1484,19 @@ Text0212: ; 3b76e (e:776e) done Text0213: ; 3b77c (e:777c) - db $03,$42,$03,$46,$03,$38,$03,$43,$03,$32,$03,$37,$70,$03,$43,$03,$3e,$70,$03,$44,$03,$3f,$03,$3f,$03,$34,$03,$41 + textfw3 "S", "W", "I", "T", "C", "H", " ", "T", "O", " ", "U", "P", "P", "E", "R" done Text0214: ; 3b799 (e:7799) - db $03,$42,$03,$46,$03,$38,$03,$43,$03,$32,$03,$37,$70,$03,$43,$03,$3e,$70,$03,$3b,$03,$3e,$03,$46,$03,$34,$03,$41 + textfw3 "S", "W", "I", "T", "C", "H", " ", "T", "O", " ", "L", "O", "W", "E", "R" done Text0215: ; 3b7b6 (e:77b6) - db $03,$7a + textfw3 "'" done Text0216: ; 3b7b9 (e:77b9) - db $03,$7b + textfw3 "”" done YourDiscardPileText: ; 3b7bc (e:77bc) @@ -1511,15 +1512,15 @@ Text0219: ; 3b7e8 (e:77e8) done Text021a: ; 3b7ee (e:77ee) - db $0e,$2b,$37,$3e,$25 + hiragana "ひ", "ら", "が", "ナ" done Text021b: ; 3b7f4 (e:77f4) - db $16,$20,$16,$25 + textfw0 "カ", "タ", "カ", "ナ" done Text021c: ; 3b7f9 (e:77f9) - db $03,$30,$03,$31,$03,$32 + textfw3 "A", "B", "C" done Text021d: ; 3b800 (e:7800) @@ -1531,39 +1532,71 @@ Text021e: ; 3b805 (e:7805) done Text021f: ; 3b819 (e:7819) - db $0e,$11,$70,$16,$70,$1b,$70,$20,$70,$25,$70,$2a,$70,$2f,$70,$34,$70,$37,"" - line $12,$70,$17,$70,$1c,$70,$21,$70,$26,$70,$2b,$70,$30,$70,$35,$70,$38,"" - line $13,$70,$18,$70,$1d,$70,$22,$70,$27,$70,$2c,$70,$31,$70,$36,$70,$39,"" - line $14,$70,$19,$70,$1e,$70,$23,$70,$28,$70,$2d,$70,$32,$70,$3c,$70,$3a,"" - line $15,$70,$1a,$70,$1f,$70,$24,$70,$29,$70,$2e,$70,$33,$70,$3d,$70,$3b,"" - line $5c,$70,$5d,$70,$5e,$70,$5f,$70,$10,$70,$03,$59,$70,$03,$5b,$70,$78 + hiragana "あ", " ", "か", " ", "さ", " ", "た", " ", "な", " ", "は", " ", "ま", " ", "や", " ", "ら" + line "" + textfw0 "い", " ", "き", " ", "し", " ", "ち", " ", "に", " ", "ひ", " ", "み", " ", "ゆ", " ", "り" + line "" + textfw0 "う", " ", "く", " ", "す", " ", "つ", " ", "ぬ", " ", "ふ", " ", "む", " ", "よ", " ", "る" + line "" + textfw0 "え", " ", "け", " ", "せ", " ", "て", " ", "ね", " ", "へ", " ", "め", " ", "わ", " ", "れ" + line "" + textfw0 "お", " ", "こ", " ", "そ", " ", "と", " ", "の", " ", "ほ", " ", "も", " ", "ん", " ", "ろ" + line "" + textfw0 "ゃ", " ", "ゅ", " ", "ょ", " ", "っ", " ", "を", " " + textfw3 "“", " ", "º(2)", " " + textfw0 "-(2)" done Text0220: ; 3b886 (e:7886) - db $11,$70,$16,$70,$1b,$70,$20,$70,$25,$70,$2a,$70,$2f,$70,$34,$70,$37,"" - line $12,$70,$17,$70,$1c,$70,$21,$70,$26,$70,$2b,$70,$30,$70,$35,$70,$38,"" - line $13,$70,$18,$70,$1d,$70,$22,$70,$27,$70,$2c,$70,$31,$70,$36,$70,$39,"" - line $14,$70,$19,$70,$1e,$70,$23,$70,$28,$70,$2d,$70,$32,$70,$3c,$70,$3a,"" - line $15,$70,$1a,$70,$1f,$70,$24,$70,$29,$70,$2e,$70,$33,$70,$3d,$70,$3b,"" - line $5c,$70,$5d,$70,$5e,$70,$5f,$70,$10,$70,$03,$59,$70,$03,$5b,$70,$78 + textfw0 "ア", " ", "カ", " ", "サ", " ", "タ", " ", "ナ", " ", "ハ", " ", "マ", " ", "ヤ", " ", "ラ" + line "" + textfw0 "イ", " ", "キ", " ", "シ", " ", "チ", " ", "ニ", " ", "ヒ", " ", "ミ", " ", "ユ", " ", "リ" + line "" + textfw0 "ウ", " ", "ク", " ", "ス", " ", "ツ", " ", "ヌ", " ", "フ", " ", "ム", " ", "ヨ", " ", "ル" + line "" + textfw0 "エ", " ", "ケ", " ", "セ", " ", "テ", " ", "ネ", " ", "ヘ", " ", "メ", " ", "ワ", " ", "レ" + line "" + textfw0 "オ", " ", "コ", " ", "ソ", " ", "ト", " ", "ノ", " ", "ホ", " ", "モ", " ", "ン", " ", "ロ" + line "" + textfw0 "ャ", " ", "ュ", " ", "ョ", " ", "ッ", " ", "ヲ", " " + textfw3 "“", " ", "º(2)", " " + textfw0 "-(2)" done Text0221: ; 3b8f2 (e:78f2) - db $03,$30,$70,$03,$31,$70,$03,$32,$70,$03,$33,$70,$03,$34,$70,$03,$35,$70,$03,$36,$70,$03,$37,$70,$03,$38,"" - line $03,$39,$70,$03,$3a,$70,$03,$3b,$70,$03,$3c,$70,$03,$3d,$70,$03,$3e,$70,$03,$3f,$70,$03,$40,$70,$03,$41,"" - line $03,$42,$70,$03,$43,$70,$03,$44,$70,$03,$45,$70,$03,$46,$70,$03,$47,$70,$03,$48,$70,$03,$49,$70,$6e,"" - line $6f,$70,$03,$5d,$70,$6a,$70,$6b,$70,$77,$70,$60,$70,$61,$70,$62,$70,$63,"" - line $64,$70,$65,$70,$66,$70,$67,$70,$68,$70,$69,$70,$05,$13,$70,$05,$11,$70,$70,"" - line $70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70 + textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I" + line "" + textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R" + line "" + textfw3 "S", " ", "T", " ", "U", " ", "V", " ", "W", " ", "X", " ", "Y", " ", "Z", " " + textfw0 "!" + line "" + textfw0 "?", " " + textfw3 "&", " " + textfw0 "+", " ", "-", " ", "·", " ", "0", " ", "1", " ", "2", " ", "3" + line "" + textfw0 "4", " ", "5", " ", "6", " ", "7", " ", "8", " ", "9", " ", "<No>", " ", "<Lv>", " ", " " + line "" + textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " done Text0222: ; 3b97b (e:797b) - db $03,$30,$70,$03,$31,$70,$03,$32,$70,$03,$33,$70,$03,$34,$70,$03,$35,$70,$03,$36,$70,$03,$37,$70,$03,$38,"" - line $03,$39,$70,$03,$3a,$70,$03,$3b,$70,$03,$3c,$70,$03,$3d,$70,$03,$3e,$70,$03,$3f,$70,$03,$40,$70,$03,$41,"" - line $03,$42,$70,$03,$43,$70,$03,$44,$70,$03,$45,$70,$03,$46,$70,$03,$47,$70,$03,$48,$70,$03,$49,$70,$6e,"" - line $6f,$70,$03,$5d,$70,$6a,$70,$6b,$70,$03,$7a,$70,$60,$70,$61,$70,$62,$70,$63,"" - line $64,$70,$65,$70,$66,$70,$67,$70,$68,$70,$69,$70,$70,$70,$70,$70,$70,"" - line $70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70 + textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I" + line "" + textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R" + line "" + textfw3 "S", " ", "T", " ", "U", " ", "V", " ", "W", " ", "X", " ", "Y", " ", "Z", " " + textfw0 "!" + line "" + textfw0 "?", " " + textfw3 "&", " " + textfw0 "+", " ", "-", " " + textfw3 "'" + textfw0 " ", "0", " ", "1", " ", "2", " ", "3" + line "" + textfw0 "4", " ", "5", " ", "6", " ", "7", " ", "8", " ", "9", " ", " ", " ", " ", " ", " " + line "" + textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " done NewDeckText: ; 3ba03 (e:7a03) @@ -1595,24 +1628,24 @@ Text0229: ; 3ba51 (e:7a51) done ChosenAsDuelingDeckText: ; 3ba55 (e:7a55) - text TX_RAM2, " was" + text "<RAMTEXT> was" line "chosen as the dueling deck!" done Text022b: ; 3ba78 (e:7a78) - db $61,$77 + textfw0 "1", "·" done Text022c: ; 3ba7b (e:7a7b) - db $62,$77 + textfw0 "2", "·" done Text022d: ; 3ba7e (e:7a7e) - db $63,$77 + textfw0 "3", "·" done Text022e: ; 3ba81 (e:7a81) - db $64,$77 + textfw0 "4", "·" done ThereIsNoDeckHereText: ; 3ba84 (e:7a84) @@ -1715,7 +1748,7 @@ Text0246: ; 3bc85 (e:7c85) done Text0247: ; 3bc9e (e:7c9e) - text TX_RAM1, "'s Play Area" + text "<RAMNAME>'s Play Area" done Text0248: ; 3bcad (e:7cad) @@ -1747,15 +1780,16 @@ Text024e: ; 3bd20 (e:7d20) done Text024f: ; 3bd26 (e:7d26) - text TX_RAM1, "'s Hand" + text "<RAMNAME>'s Hand" done Text0250: ; 3bd30 (e:7d30) - text TX_RAM1, "'s Discard Pile" + text "<RAMNAME>'s Discard Pile" done Text0251: ; 3bd42 (e:7d42) - db $70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70,$70 + textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " " + textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " " done Text0252: ; 3bd55 (e:7d55) @@ -1787,7 +1821,7 @@ Text0258: ; 3bdaf (e:7daf) done Text0259: ; 3bdc6 (e:7dc6) - db $6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b + textfw0 "-", "-", "-", "-", "-", "-", "-", "-", "-", "-" done Text025a: ; 3bdd1 (e:7dd1) @@ -1795,7 +1829,7 @@ Text025a: ; 3bdd1 (e:7dd1) done Text025b: ; 3bddb (e:7ddb) - db $6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b,$6b + textfw0 "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-" done Text025c: ; 3bdea (e:7dea) @@ -1830,7 +1864,7 @@ Text0262: ; 3be7d (e:7e7d) Text0263: ; 3be82 (e:7e82) text "Saved the configuration for" line "" - text TX_RAM2, "! " + text "<RAMTEXT>! " done Text0264: ; 3bea4 (e:7ea4) @@ -1849,7 +1883,7 @@ Text0266: ; 3bee7 (e:7ee7) Text0267: ; 3bf06 (e:7f06) text "Deleted the configuration for" line "" - text TX_RAM2, "." + text "<RAMTEXT>." done Text0268: ; 3bf29 (e:7f29) @@ -1863,7 +1897,7 @@ Text0269: ; 3bf46 (e:7f46) Text026a: ; 3bf63 (e:7f63) text "Dismantled" line "" - text TX_RAM2, "." + text "<RAMTEXT>." done Text026b: ; 3bf73 (e:7f73) diff --git a/src/text/text3.asm b/src/text/text3.asm index 3231b66..04d0b05 100644 --- a/src/text/text3.asm +++ b/src/text/text3.asm @@ -5,7 +5,7 @@ Text026d: ; 3c000 (f:4000) Text026e: ; 3c035 (f:4035) text "Built" - line TX_RAM2 + line "<RAMTEXT>" done Text026f: ; 3c03e (f:403e) @@ -108,7 +108,7 @@ Text0282: ; 3c357 (f:4357) Text0283: ; 3c36a (f:436a) text "Received these cards" - line "from ", TX_RAM2, "!" + line "from <RAMTEXT>!" done Text0284: ; 3c389 (f:4389) @@ -126,7 +126,7 @@ Text0286: ; 3c3d3 (f:43d3) Text0287: ; 3c3eb (f:43eb) text "Received a deck configuration" - line "from ", TX_RAM2, "!" + line "from <RAMTEXT>!" done Text0288: ; 3c413 (f:4413) @@ -939,7 +939,8 @@ Text0321: ; 3e63e (f:663e) Text0322: ; 3e64c (f:664c) text "First Strike Deck" - line TX_END + line "" + done Text0323: ; 3e660 (f:6660) text " Mason Laboratory " @@ -1065,19 +1066,23 @@ Text033e: ; 3e834 (f:6834) done Text033f: ; 3e85f (f:685f) - text "Name ", TX_RAM1 + text "Name <RAMNAME>" done Text0340: ; 3e867 (f:6867) - text "Album ",$07,$6d + text "Album " + half2full + textfw0 "/" done Text0341: ; 3e87b (f:687b) - text "Play time ",$07,$03,$5e + text "Play time " + half2full + textfw3 ":" done Text0342: ; 3e892 (f:6892) - text TX_RAM1, "'s diary" + text "<RAMNAME>'s diary" done Text0343: ; 3e89d (f:689d) @@ -1089,7 +1094,7 @@ Text0344: ; 3e8b1 (f:68b1) done Text0345: ; 3e8d2 (f:68d2) - text TX_RAM1, "" + text "<RAMNAME>" line "wrote in the diary." done @@ -1123,8 +1128,8 @@ Text034b: ; 3e9a0 (f:69a0) done Text034c: ; 3e9b2 (f:69b2) - text "Duel [", TX_RAM2, "]" - line "SELECT [", TX_RAM2, "]" + text "Duel [<RAMTEXT>]" + line "SELECT [<RAMTEXT>]" line "Receive many cards" line "To Pokémon Dome 1" line "To Pokémon Dome 2" @@ -1155,12 +1160,12 @@ Text0351: ; 3ea3a (f:6a3a) done TurnedPCOnText: ; 3ea69 (f:6a69) - text TX_RAM1, "" + text "<RAMNAME>" line "turned the PC on!" done TurnedPCOffText: ; 3ea7e (f:6a7e) - text TX_RAM1, "" + text "<RAMNAME>" line "turned the PC off!" done @@ -1189,7 +1194,7 @@ Text0358: ; 3eb16 (f:6b16) done Text0359: ; 3eb32 (f:6b32) - text " Mail ", TX_RAM1, " " + text " Mail <RAMNAME> " done Text035a: ; 3eb3e (f:6b3e) @@ -1201,7 +1206,7 @@ Text035b: ; 3eb62 (f:6b62) done Text035c: ; 3eb88 (f:6b88) - db "ppppp" + textfw0 " ", " ", " ", " ", " " done Text035d: ; 3eb8e (f:6b8e) @@ -1287,15 +1292,25 @@ Text036f: ; 3ec74 (f:6c74) done Text0370: ; 3ecb9 (f:6cb9) - text " ", TX_RAM1, " ", TX_RAM2, "" - line " Master Medals Won ",$07,$0c,$06,"" - line " Album ",$07,$6d,$06,"" - line " Play time ",$07,$03,$5e,$06 + text " <RAMNAME> <RAMTEXT>" + line " Master Medals Won " + half2full + textfw0 "<RAMNUM>" + text "" + line " Album " + half2full + textfw0 "/" + text "" + line " Play time " + half2full + textfw3 ":" + text "" done Text0371: ; 3ed14 (f:6d14) text "Start a New Game." - line TX_END + line "" + done Text0372: ; 3ed28 (f:6d28) text "The Game will continue from " @@ -1343,10 +1358,10 @@ Text0378: ; 3ef66 (f:6f66) done Text0379: ; 3efc3 (f:6fc3) - text TX_RAM1, " is crazy about Pokémon" + text "<RAMNAME> is crazy about Pokémon" line "and Pokémon card collecting!" line "One day," - line TX_RAM1, " heard a rumor:" + line "<RAMNAME> heard a rumor:" line " ”The Legendary Pokémon Cards..." line " the extremely rare and powerful " line " cards held by Pokémon Trading " @@ -1355,7 +1370,7 @@ Text0379: ; 3efc3 (f:6fc3) line " for one to inherit the legend!”" line "Dreaming of inheriting the" line "Legendary Pokémon Cards," - line TX_RAM1, " visits the Pokémon" + line "<RAMNAME> visits the Pokémon" line "card researcher, Dr. Mason..." done @@ -1440,26 +1455,26 @@ Text0384: ; 3f2c0 (f:72c0) done Text0385: ; 3f2c6 (f:72c6) - text "WIN ", TX_RAM3, " Prizes Duel" - line "LOSE with ", TX_RAM2, "(", TX_RAM3, ")" + text "WIN <RAMNUM> Prizes Duel" + line "LOSE with <RAMTEXT>(<RAMNUM>)" done Text0386: ; 3f2f1 (f:72f1) - text " Use ", TX_RAM3, "'s Deck" + text " Use <RAMNUM>'s Deck" done ReceivedBoosterPackText: ; 3f308 (f:7308) - text TX_RAM1, " received a Booster" - line "Pack: ", TX_RAM2, "." + text "<RAMNAME> received a Booster" + line "Pack: <RAMTEXT>." done AndAnotherBoosterPackText: ; 3f327 (f:7327) text "...And another Booster Pack:" - line TX_RAM2, "." + line "<RAMTEXT>." done CheckedCardsInBoosterPackText: ; 3f348 (f:7348) - text TX_RAM1, " checked the cards" + text "<RAMNAME> checked the cards" line "in the Booster Pack!!" done @@ -1469,8 +1484,8 @@ Text038a: ; 3f373 (f:7373) done WonTheMedalText: ; 3f39b (f:739b) - text TX_RAM1, "" - line "Won the ", TX_RAM2, " Medal!" + text "<RAMNAME>" + line "Won the <RAMTEXT> Medal!" done Text038c: ; 3f3af (f:73af) @@ -1515,11 +1530,11 @@ Text0394: ; 3f4d6 (f:74d6) done Text0395: ; 3f4f3 (f:74f3) - text TX_RAM2, " ", TX_RAM2 + text "<RAMTEXT> <RAMTEXT>" done Text0396: ; 3f4f9 (f:74f9) - text TX_RAM2, " Deck" + text "<RAMTEXT> Deck" done Text0397: ; 3f501 (f:7501) @@ -1587,7 +1602,7 @@ Text03a6: ; 3f631 (f:7631) done Text03a7: ; 3f643 (f:7643) - db TX_END + done Text03a8: ; 3f644 (f:7644) text "COLOSSEUM" @@ -1935,7 +1950,7 @@ Text03fd: ; 3f9d0 (f:79d0) done Text03fe: ; 3f9f2 (f:79f2) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "How can I help you?" done @@ -1958,7 +1973,7 @@ Text0400: ; 3fa32 (f:7a32) done Text0401: ; 3faaa (f:7aaa) - text TX_RAM1, "," + text "<RAMNAME>," line "It's me, Doctor Mason." line "Are you getting the hang of" line "the Pokémon Trading Card Game?" @@ -1995,7 +2010,7 @@ Text0402: ; 3fd72 (f:7d72) done Text0403: ; 3fe10 (f:7e10) - text TX_RAM1, "," + text "<RAMNAME>," line "It's me, Doctor Mason." line "I have some information for you" line "about Mitch's deck - he's " @@ -2010,7 +2025,7 @@ Text0403: ; 3fe10 (f:7e10) done Text0404: ; 3ff4d (f:7f4d) - text TX_RAM1, ", I know you can do it!" + text "<RAMNAME>, I know you can do it!" line "Go win the Fighting Medal!" line "Mason Laboratory" line " Doctor Mason ;)" diff --git a/src/text/text4.asm b/src/text/text4.asm index dd9f326..74bec46 100644 --- a/src/text/text4.asm +++ b/src/text/text4.asm @@ -1,5 +1,5 @@ Text0405: ; 40000 (10:4000) - text TX_RAM1, "," + text "<RAMNAME>," line "It's me, Doctor Mason." line "I have some information about" line "Gene's deck - he's the Master " @@ -14,14 +14,14 @@ Text0405: ; 40000 (10:4000) done Text0406: ; 4014a (10:414a) - text TX_RAM1, "! Go defeat Gene," + text "<RAMNAME>! Go defeat Gene," line "the Master of the Rock Club!" line "Mason Laboratory" line " Doctor Mason ;)" done Text0407: ; 401a3 (10:41a3) - text TX_RAM1, "," + text "<RAMNAME>," line "It's me, Doctor Mason." line "I have some information for you" line "about Amy's deck - she's the " @@ -41,14 +41,14 @@ Text0407: ; 401a3 (10:41a3) done Text0408: ; 4033e (10:433e) - text TX_RAM1, "!" + text "<RAMNAME>!" line "Keep at it, and don't give up!" line "Mason Laboratory" line " Doctor Mason ;)" done Text0409: ; 40389 (10:4389) - text "How's it going, ", TX_RAM1, "?" + text "How's it going, <RAMNAME>?" line "It's me, Doctor Mason." line "I have some information for you" line "about Isaac's deck - he's" @@ -120,7 +120,8 @@ Text040d: ; 40819 (10:4819) done Text040e: ; 409c6 (10:49c6) - text "Fight to the end, ", TX_START, TX_RAM1, "," + text "Fight to the end, " + text "<RAMNAME>," line "and don't give up!" line "Mason Laboratory" line " Dr. Mason ;)" @@ -128,7 +129,7 @@ Text040e: ; 409c6 (10:49c6) Text040f: ; 40a15 (10:4a15) text "It's me, Dr. Mason." - line "How are you doing, ", TX_RAM1, "?" + line "How are you doing, <RAMNAME>?" line "I have some information for you" line "about Rick's deck - he's " line "the Master of the Science Club." @@ -148,7 +149,7 @@ Text040f: ; 40a15 (10:4a15) Text0410: ; 40bea (10:4bea) text "Win all 8 Master Medals, " line "" - text TX_RAM1, "!" + text "<RAMNAME>!" line "Mason Laboratory" line " Dr. Mason ;)" done @@ -226,7 +227,7 @@ Text0414: ; 40fca (10:4fca) done Text0415: ; 4123d (10:523d) - text TX_RAM1, "," + text "<RAMNAME>," line "It's me, Dr. Mason." line "You're finally going to be dueling" line "a Grand Master..." @@ -247,7 +248,7 @@ Text0415: ; 4123d (10:523d) done Text0416: ; 413f1 (10:53f1) - text TX_RAM1, "," + text "<RAMNAME>," line "It's me, Dr. Mason!" line "Grand Master Steve uses" line "the Legendary ZAPDOS." @@ -264,7 +265,7 @@ Text0416: ; 413f1 (10:53f1) line "using your Fighting Pokémon." line "Defeat the Grand Masters," line "" - text TX_RAM1, "!!!" + text "<RAMNAME>!!!" line "Mason Laboratory" line " Dr. Mason ;)" line "p.s." @@ -284,7 +285,7 @@ Text0417: ; 415cf (10:55cf) line "His deck should be mostly" line "Water Pokémon, so it will be" line "weak against Lightning Pokémon!" - line "Go get 'em, ", TX_RAM1, "!" + line "Go get 'em, <RAMNAME>!" line "You're almost there!" line "Mason Laboratory" line " Dr. Mason ;)" @@ -305,7 +306,7 @@ Text0418: ; 4174c (10:574c) line "of striking early. This is the " line "final test in inheriting " line "the Legendary Pokémon Cards!" - line "Go, ", TX_RAM1, "!" + line "Go, <RAMNAME>!" line "Be a part of the legend!" line "Mason Laboratory" line " Dr. Mason ;)" @@ -378,7 +379,8 @@ Text0422: ; 41c57 (10:5c57) line "I'd feel guilty taking a card" line "from your deck." line "Maybe next time." - line TX_END + line "" + done Text0423: ; 41cf7 (10:5cf7) text "OK then, let's trade your" @@ -386,12 +388,12 @@ Text0423: ; 41cf7 (10:5cf7) done Text0424: ; 41d2a (10:5d2a) - text TX_RAM1, " traded a Lapras" + text "<RAMNAME> traded a Lapras" line "for an Arcanine!" done Text0425: ; 41d4e (10:5d4e) - text "Thanks, ", TX_RAM1, "!" + text "Thanks, <RAMNAME>!" line "I'll take good care" line "of this Lapras." done @@ -642,14 +644,14 @@ Text044d: ; 4294b (10:694b) done Text044e: ; 4296d (10:696d) - text "Was it ", TX_RAM1, "?" + text "Was it <RAMNAME>?" line "I will be your next opponent." line "I, Amy, the Master of the " line "Water Club!" done Text044f: ; 429bd (10:69bd) - text "Aren't you ", TX_RAM1, "?" + text "Aren't you <RAMNAME>?" line "So you decided you want to" line "duel me?" done @@ -698,7 +700,7 @@ Text0457: ; 42ba1 (10:6ba1) done Text0458: ; 42be9 (10:6be9) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "Nice to see you again!!!" line "Did you come to play the" line "Pokémon Trading Card Game?" @@ -724,7 +726,7 @@ Text045b: ; 42d1e (10:6d1e) line "Card Game. I'm not into dueling." line "I prefer collecting the cards." line "By the way, would you happen to have" - line TX_RAM2, "?" + line "<RAMTEXT>?" line "If you do, I was wondering if you" line "might want to give it to me?" line "How about it?" @@ -734,20 +736,20 @@ Text045c: ; 42df7 (10:6df7) text "Hi! It's you!" line "What's up?" line "Did you decide to give me" - line "your ", TX_RAM2, "?" + line "your <RAMTEXT>?" done Text045d: ; 42e33 (10:6e33) text "Hi! I see you're playing with" line "the cards again." line "By the way, I'm looking for" - line TX_RAM2, " this time." + line "<RAMTEXT> this time." line "If you should happen to have one," line "would you mind giving it to me?" done Text045e: ; 42ece (10:6ece) - text "Give away your ", TX_RAM2, "?" + text "Give away your <RAMTEXT>?" done Text045f: ; 42ee1 (10:6ee1) @@ -757,17 +759,17 @@ Text045f: ; 42ee1 (10:6ee1) done Text0460: ; 42f2d (10:6f2d) - text "But you don't have ", TX_RAM2, "!" + text "But you don't have <RAMTEXT>!" line "I appreciate your generosity, but " line "you can't give me what you don't " line "have. Come see me again after " - line "you get ", TX_RAM2, "." + line "you get <RAMTEXT>." done Text0461: ; 42fb3 (10:6fb3) text "You're going to give it to me?" line "Thank you!" - line "But your ", TX_RAM2, "" + line "But your <RAMTEXT>" line "is in your Deck." line "I can't take a card that you're" line "playing with!" @@ -814,8 +816,11 @@ Text0467: ; 43221 (10:7221) line "Who? Me? You don't know who I am?" line "I am the super musical star," line "Imakuni?!" - line "I'll sing the Pok`Rap - You dance!" - line $07,$03,$63, TX_START, "La di da la di da" + line "I'll sing the PokéRap - You dance!" + line "" + half2full + textfw3 "♪" + text "La di da la di da" line " La di da la di da..." line "Hey!" line "Move those feet!" @@ -878,7 +883,10 @@ Text0471: ; 435a7 (10:75a7) line "You weren't too bad, but since " line "I won...Let's see you shake it!" line "Come on, shake it!!!" - line $07,$03,$63, TX_START, "La di da la di da" + line "" + half2full + textfw3 "♪" + text "La di da la di da" line " La di da la di da..." line "... You dance weird!" done diff --git a/src/text/text5.asm b/src/text/text5.asm index 706ab09..ba26ccb 100644 --- a/src/text/text5.asm +++ b/src/text/text5.asm @@ -344,7 +344,7 @@ Text04c2: ; 4548b (11:548b) text "The Trainer card, Computer Search," line "is useful when you want to draw a" line "certain card! Item Finder and" - line "Pok` Ball will also help!" + line "Poké Ball will also help!" done Text04c3: ; 45509 (11:5509) @@ -864,14 +864,14 @@ Text050c: ; 475ab (11:75ab) done Text050d: ; 47644 (11:7644) - text "Most unfortunate, ", TX_RAM1, "." + text "Most unfortunate, <RAMNAME>." line "Once you enter, you won't be able" line "to re-enter for some time. " line "Please try again another day." done Text050e: ; 476b6 (11:76b6) - text "Congratulations, ", TX_RAM1, "!" + text "Congratulations, <RAMNAME>!" line "You received a card!" line "Please join us for the next " line "Challenge Cup, too." @@ -919,7 +919,7 @@ Text0514: ; 47913 (11:7913) done Text0515: ; 47984 (11:7984) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "Are you competing, too?" done @@ -933,7 +933,7 @@ Text0516: ; 479a4 (11:79a4) done Text0517: ; 47a3d (11:7a3d) - text "Hey, it's ", TX_RAM1, " - the loser" + text "Hey, it's <RAMNAME> - the loser" line "of the Challenge Cup!" done @@ -947,7 +947,7 @@ Text0518: ; 47a6c (11:7a6c) done Text0519: ; 47b25 (11:7b25) - text "Hey ", TX_RAM1, ", too bad " + text "Hey <RAMNAME>, too bad " line "you're too late!" done @@ -959,7 +959,7 @@ Text051a: ; 47b47 (11:7b47) done Text051b: ; 47bb6 (11:7bb6) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "What are you doing here?" done @@ -975,7 +975,7 @@ Text051c: ; 47bd7 (11:7bd7) done Text051d: ; 47cb9 (11:7cb9) - text "Hey, ", TX_RAM1, "." + text "Hey, <RAMNAME>." line "We meet again." done @@ -990,7 +990,7 @@ Text051e: ; 47cd1 (11:7cd1) done Text051f: ; 47d82 (11:7d82) - text "Hey, it's ", TX_RAM1, " - the" + text "Hey, it's <RAMNAME> - the" line "loser of the Challenge Cup!" done @@ -1003,7 +1003,7 @@ Text0520: ; 47db1 (11:7db1) done Text0521: ; 47e4f (11:7e4f) - text "Hey, isn't that ", TX_RAM1, "?" + text "Hey, isn't that <RAMNAME>?" line "Late as always!" done @@ -1017,6 +1017,6 @@ Text0522: ; 47e73 (11:7e73) done Text0523: ; 47f08 (11:7f08) - text "Hey, ", TX_RAM1, "!" + text "Hey, <RAMNAME>!" line "What are you doing here?" done diff --git a/src/text/text6.asm b/src/text/text6.asm index a99de27..901e9fe 100644 --- a/src/text/text6.asm +++ b/src/text/text6.asm @@ -98,12 +98,12 @@ Text0532: ; 4856a (12:456a) done Text0533: ; 485a2 (12:45a2) - text "Presently, ", TX_RAM1, " is still" + text "Presently, <RAMNAME> is still" line "a contender!" done Text0534: ; 485c6 (12:45c6) - text TX_RAM1, " is the new challenger!" + text "<RAMNAME> is the new challenger!" done Text0535: ; 485e0 (12:45e0) @@ -113,22 +113,22 @@ Text0535: ; 485e0 (12:45e0) done Text0536: ; 48612 (12:4612) - text "The winner is ", TX_RAM2, "!!" + text "The winner is <RAMTEXT>!!" line "" - text TX_RAM2, " has defeated 2 opponents!" + text "<RAMTEXT> has defeated 2 opponents!" line "Just 1 more opponent to go" line "before winning the prize!" done Text0537: ; 48677 (12:4677) - text "Too bad, ", TX_RAM1, "." + text "Too bad, <RAMNAME>." line "Have a safe trip home!" done Text0538: ; 4869b (12:469b) - text "The Winner is ", TX_RAM2, "!!!" + text "The Winner is <RAMTEXT>!!!" line "" - text TX_RAM2, " has defeated 1 opponent!" + text "<RAMTEXT> has defeated 1 opponent!" line "2 more opponents to go" line "before winning the prize!" done @@ -136,7 +136,7 @@ Text0538: ; 4869b (12:469b) Text0539: ; 486fc (12:46fc) text "How unfortunate!" line "Unable to defeat the last opponent!" - line "It was close, but ", TX_RAM1, " was " + line "It was close, but <RAMNAME> was " line "defeated by the third opponent!" done @@ -155,21 +155,21 @@ Text053b: ; 487c0 (12:47c0) Text053c: ; 4881b (12:481b) text "Congratulations!" - line "The Winner is ", TX_RAM1, "!" + line "The Winner is <RAMNAME>!" line "" - text TX_RAM1, " has defeated" + text "<RAMNAME> has defeated" line "1 opponent!!!" done Text053d: ; 4885c (12:485c) - text "Way to go, ", TX_RAM1, "!" + text "Way to go, <RAMNAME>!" line "That's 2 wins!!!" line "One more opponent to go before" line "winning the Challenge Cup!" done Text053e: ; 488b6 (12:48b6) - text "Most unfortunate, ", TX_RAM2, "." + text "Most unfortunate, <RAMTEXT>." line "Have a safe trip home!" done @@ -180,24 +180,24 @@ Text053f: ; 488e3 (12:48e3) Text0540: ; 48904 (12:4904) text "Our new challenger is..." line "" - text TX_RAM2, "!" + text "<RAMTEXT>!" done Text0541: ; 48922 (12:4922) text "The third opponent is" line "" - text TX_RAM2, "!" + text "<RAMTEXT>!" done Text0542: ; 4893d (12:493d) - text "Hey, ", TX_RAM1, "!" + text "Hey, <RAMNAME>!" line "I'm not gonna lose to you!" line "" text "<Lv>60 Mewtwo belongs to me!!!" done Text0543: ; 4897f (12:497f) - text TX_RAM1, "!" + text "<RAMNAME>!" line "I'm going to defeat you!" line "" text "<Lv>8 Mew belongs to me!!!" @@ -217,12 +217,12 @@ Text0546: ; 489f5 (12:49f5) done Text0547: ; 48a09 (12:4a09) - text "Well then, ", TX_RAM1, "!" + text "Well then, <RAMNAME>!" line "Let the second match begin!" done Text0548: ; 48a34 (12:4a34) - text "Well, ", TX_RAM1, ", let the third," + text "Well, <RAMNAME>, let the third," line "and final, match begin!" done @@ -237,7 +237,7 @@ Text054a: ; 48a90 (12:4a90) done Text054b: ; 48abf (12:4abf) - text "Most unfortunate, ", TX_RAM2, "." + text "Most unfortunate, <RAMTEXT>." line "Do try again in the next" line "Challenge Cup." done @@ -252,31 +252,33 @@ Text054d: ; 48b25 (12:4b25) done Text054e: ; 48b3f (12:4b3f) - text TX_RAM1, "!" + text "<RAMNAME>!" line "I won't lose next time!" done Text054f: ; 48b5b (12:4b5b) - text TX_RAM1, "!" + text "<RAMNAME>!" line "I'll win next time!" done Text0550: ; 48b73 (12:4b73) text "The Winner of this Challenge Cup " - line "is ", TX_START, TX_RAM1, "!!!" + line "is " + text "<RAMNAME>!!!" done Text0551: ; 48b9f (12:4b9f) - text TX_RAM1, ", your prize" - line "is ", TX_RAM2, "!" + text "<RAMNAME>, your prize" + line "is <RAMTEXT>!" done Text0552: ; 48bb4 (12:4bb4) - text "Congratulations, ", TX_START, TX_RAM1, "!!!" + text "Congratulations, " + text "<RAMNAME>!!!" done Text0553: ; 48bcc (12:4bcc) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "What are you doing here?" done @@ -296,9 +298,9 @@ Text0555: ; 48c87 (12:4c87) done Text0556: ; 48cf5 (12:4cf5) - text "Hey, ", TX_RAM1, "!" - line "You only have ", TX_RAM3, " Medals!" - line "I've already collected ", TX_RAM3, "!" + text "Hey, <RAMNAME>!" + line "You only have <RAMNUM> Medals!" + line "I've already collected <RAMNUM>!" line "Why don't you just give up? See ya!" done @@ -329,7 +331,7 @@ Text055a: ; 48eb8 (12:4eb8) done Text055b: ; 48f10 (12:4f10) - text "You're very good, ", TX_RAM1, "." + text "You're very good, <RAMNAME>." line "Please take care of my card." done @@ -352,7 +354,8 @@ Text055e: ; 48fcb (12:4fcb) Text055f: ; 48ff9 (12:4ff9) text "You've really improved your " - line "game, ", TX_START, TX_RAM1, "." + line "game, " + text "<RAMNAME>." line "Use my card to make it better!" done @@ -361,7 +364,7 @@ Text0560: ; 49040 (12:5040) line "The Legendary Cards seem pleased" line "to be passed on to you" line "" - text TX_RAM1, ". Hurry and go through" + text "<RAMNAME>. Hurry and go through" line "to the Hall of Honor!" done @@ -372,14 +375,15 @@ Text0561: ; 490c6 (12:50c6) done Text0562: ; 4911e (12:511e) - text TX_RAM1, ", That is not the way" + text "<RAMNAME>, That is not the way" line "to the Hall of Honor." - line "Hurry, ", TX_START, TX_RAM1, "! Go through to" + line "Hurry, " + text "<RAMNAME>! Go through to" line "the Hall of Honor!" done Text0563: ; 49178 (12:5178) - text TX_RAM1, ", if you leave the " + text "<RAMNAME>, if you leave the " line "Grand Hall, you must defeat " line "each of us again to enter" line "the Hall of Honor." @@ -460,7 +464,7 @@ Text0570: ; 49506 (12:5506) done Text0571: ; 49570 (12:5570) - text TX_RAM1, "," + text "<RAMNAME>," line "take your place at the table." done @@ -521,12 +525,12 @@ Text057a: ; 49864 (12:5864) done Text057b: ; 498b8 (12:58b8) - text "Very good, ", TX_RAM1, "!" + text "Very good, <RAMNAME>!" line "Your second opponent is Steve!" done Text057c: ; 498e6 (12:58e6) - text TX_RAM1, "! Next, you must duel " + text "<RAMNAME>! Next, you must duel " line "Steve!" done @@ -538,12 +542,13 @@ Text057d: ; 49906 (12:5906) done Text057e: ; 49980 (12:5980) - text "Hey, ", TX_RAM1, "!" + text "Hey, <RAMNAME>!" line "Come battle Steve!" done Text057f: ; 4999c (12:599c) - text "Is your Deck ready, ", TX_START, TX_RAM1, "?" + text "Is your Deck ready, " + text "<RAMNAME>?" done Text0580: ; 499b5 (12:59b5) @@ -587,12 +592,12 @@ Text0586: ; 49b27 (12:5b27) done Text0587: ; 49b50 (12:5b50) - text "Very good, ", TX_RAM1, "." + text "Very good, <RAMNAME>." line "Your next opponent is Jack!" done Text0588: ; 49b7b (12:5b7b) - text "That's great, ", TX_RAM1, "!" + text "That's great, <RAMNAME>!" line "Jack is your next opponent!" done @@ -609,7 +614,7 @@ Text058a: ; 49c1c (12:5c1c) done Text058b: ; 49c5f (12:5c5f) - text TX_RAM1, "," + text "<RAMNAME>," line "have you readied your deck?" done @@ -682,7 +687,8 @@ Text0597: ; 49f7e (12:5f7e) done Text0598: ; 49fb5 (12:5fb5) - text "Is your Deck ready, ", TX_START, TX_RAM1, "?" + text "Is your Deck ready, " + text "<RAMNAME>?" done Text0599: ; 49fce (12:5fce) @@ -719,7 +725,7 @@ Text059f: ; 4a11a (12:611a) text "Wha-what on earth? Even" line "I, Rod, have been defeated?!?" line "Wonderful! This is wonderful!!" - line "Congratulations, ", TX_RAM1, ". " + line "Congratulations, <RAMNAME>. " line "You have proven yourself worthy" line "enough to inherit the" line "Legendary Pokémon Cards!!!" @@ -727,7 +733,7 @@ Text059f: ; 4a11a (12:611a) done Text05a0: ; 4a1e1 (12:61e1) - text "Congratulations, ", TX_RAM1, "!" + text "Congratulations, <RAMNAME>!" line "You're a master duelist!!!" line "But..." done @@ -744,7 +750,7 @@ Text05a2: ; 4a26c (12:626c) done Text05a3: ; 4a289 (12:6289) - text "Congratulations, ", TX_RAM1, "!" + text "Congratulations, <RAMNAME>!" line "You're a master duelist!" done @@ -767,7 +773,7 @@ Text05a6: ; 4a369 (12:6369) line "allowed! He, too, has earned " line "the right to inherit the " line "Legendary Pokémon Cards!" - line "Ronald! ", TX_RAM1, "!" + line "Ronald! <RAMNAME>!" line "You two must duel to determine who " line "will inherit the Legendary Pokémon " line "Cards. So say the Rules!" @@ -782,11 +788,12 @@ Text05a8: ; 4a452 (12:6452) line "Ronald!!!" line "I'll take your challenge," line "" - text TX_RAM1, "!" + text "<RAMNAME>!" done Text05a9: ; 4a49a (12:649a) - text "Is your Deck ready, ", TX_START, TX_RAM1, "?" + text "Is your Deck ready, " + text "<RAMNAME>?" done Text05aa: ; 4a4b3 (12:64b3) @@ -802,7 +809,8 @@ Text05ac: ; 4a4f5 (12:64f5) text "I was here first! The Legendary" line "Pokémon Cards belong to me!" line "I'll make it all too clear to" - line "you, ", TX_START, TX_RAM1, "!" + line "you, " + text "<RAMNAME>!" done Text05ad: ; 4a559 (12:6559) @@ -827,7 +835,7 @@ Text05af: ; 4a65c (12:665c) Text05b0: ; 4a67f (12:667f) text "I'm sorry, but the Legendary Pokémon" - line "Cards have chosen ", TX_RAM1, "." + line "Cards have chosen <RAMNAME>." done Text05b1: ; 4a6ba (12:66ba) @@ -843,7 +851,7 @@ Text05b2: ; 4a6f4 (12:66f4) done Text05b3: ; 4a72d (12:672d) - text "Congratulations, ", TX_RAM1, "!" + text "Congratulations, <RAMNAME>!" line "You are a Card Master" line "worthy of inheriting" line "the Legendary Pokémon Cards!" @@ -961,7 +969,7 @@ Text05c0: ; 4af26 (12:6f26) done Text05c1: ; 4afb0 (12:6fb0) - text TX_RAM1, " received some " + text "<RAMNAME> received some " line "Energy cards!" done @@ -987,7 +995,7 @@ Text05c4: ; 4b129 (12:7129) text "You finally inherited the" line "Legendary Pokémon Cards!" line "Amazing!" - line "Congratulations, ", TX_RAM1, "!!!" + line "Congratulations, <RAMNAME>!!!" done Text05c5: ; 4b17c (12:717c) @@ -1005,7 +1013,7 @@ Text05c6: ; 4b274 (12:7274) text "Congratulations on inheriting " line "the Legendary Pokémon Cards," line "" - text TX_RAM1, "! Now you should try" + text "<RAMNAME>! Now you should try" line "dueling different people using the" line "cards you inherited. I'm sure " line "you'll have a good time!" @@ -1048,7 +1056,7 @@ Text05ca: ; 4b4ea (12:74ea) line "opponents, you win! You can also " line "play to extend your winning " line "streak! Build a deck and " - line "give it a try, ", TX_RAM1, "!" + line "give it a try, <RAMNAME>!" done Text05cb: ; 4b63e (12:763e) diff --git a/src/text/text7.asm b/src/text/text7.asm index 56dddec..8c2e855 100644 --- a/src/text/text7.asm +++ b/src/text/text7.asm @@ -69,7 +69,7 @@ Text05e0: ; 4c5a1 (13:45a1) done Text05e1: ; 4c66a (13:466a) - text "Congratulations, ", TX_RAM1, "!" + text "Congratulations, <RAMNAME>!" line "I hear you have inherited the" line "Legendary Pokémon Cards!" line "The strength of a Deck does" @@ -94,7 +94,7 @@ Text05e2: ; 4c786 (13:4786) done Text05e3: ; 4c86f (13:486f) - text "Oh! Why the rush, ", TX_RAM1, "?" + text "Oh! Why the rush, <RAMNAME>?" line "What? " line "You want to learn how to play" line "the Pokémon Trading Card Game?" @@ -112,7 +112,7 @@ Text05e3: ; 4c86f (13:486f) Text05e4: ; 4c9d7 (13:49d7) text "Yes, Dr. Mason." - line "Hello, ", TX_RAM1, "." + line "Hello, <RAMNAME>." done Text05e5: ; 4c9f2 (13:49f2) @@ -121,7 +121,7 @@ Text05e5: ; 4c9f2 (13:49f2) done Text05e6: ; 4ca0c (13:4a0c) - text "Hey! ", TX_RAM1, "!" + text "Hey! <RAMNAME>!" line "Hurry and come here!" done @@ -131,7 +131,7 @@ Text05e7: ; 4ca2a (13:4a2a) done Text05e8: ; 4ca52 (13:4a52) - text "OK, ", TX_RAM1, "." + text "OK, <RAMNAME>." line "What do you want to ask about?" done @@ -196,31 +196,31 @@ Text05f0: ; 4ce5a (13:4e5a) done Text05f1: ; 4ce96 (13:4e96) - text TX_RAM1, " handed his cards to " + text "<RAMNAME> handed his cards to " line "Dr. Mason." done Text05f2: ; 4ceb9 (13:4eb9) text "Hmm...let me add some of my own " line "cards to yours!" - line "Now, ", TX_RAM1, ", what kind" + line "Now, <RAMNAME>, what kind" line "of Deck do you want?" done Text05f3: ; 4cf12 (13:4f12) - text "A ", TX_RAM2, "?" + text "A <RAMTEXT>?" done Text05f4: ; 4cf18 (13:4f18) - text "OK, a ", TX_RAM2, "!" + text "OK, a <RAMTEXT>!" line "Here are the remaining cards!" done Text05f5: ; 4cf40 (13:4f40) - text TX_RAM1, " received" - line "a ", TX_RAM2, "!" + text "<RAMNAME> received" + line "a <RAMTEXT>!" line "" - text TX_RAM1, " received" + text "<RAMNAME> received" line "30 cards!" done @@ -284,7 +284,7 @@ Text05fb: ; 4d361 (13:5361) done Text05fc: ; 4d423 (13:5423) - text TX_RAM1, ", thanks to you, all" + text "<RAMNAME>, thanks to you, all" line "the Auto Deck Machines have" line "been activated!" done @@ -312,7 +312,7 @@ Text0600: ; 4d531 (13:5531) done Text0601: ; 4d56a (13:556a) - text "Is it ", TX_RAM2, "?" + text "Is it <RAMTEXT>?" done Text0602: ; 4d574 (13:5574) @@ -341,17 +341,17 @@ Text0606: ; 4d655 (13:5655) done Text0607: ; 4d676 (13:5676) - text "It's a ", TX_RAM2, " Medal" + text "It's a <RAMTEXT> Medal" line "Auto Deck Machine." done Text0608: ; 4d699 (13:5699) text "It isn't working since the " - line TX_RAM2, " Medal is not inserted." + line "<RAMTEXT> Medal is not inserted." done Text0609: ; 4d6cf (13:56cf) - text "Insert the ", TX_RAM2, " Medal?" + text "Insert the <RAMTEXT> Medal?" done Text060a: ; 4d6e4 (13:56e4) @@ -465,7 +465,7 @@ Text0619: ; 4dbcb (13:5bcb) done Text061a: ; 4dc30 (13:5c30) - text "Hey! ", TX_RAM1, "!" + text "Hey! <RAMNAME>!" line "You beat the Grand Masters?" line "Cool! Got all the Legendary " line "Pokémon Cards? Yeah!" @@ -710,14 +710,14 @@ Text0644: ; 4e774 (13:6774) done Text0645: ; 4e7e1 (13:67e1) - text "Well, getting the ", TX_RAM2, " Medal " + text "Well, getting the <RAMTEXT> Medal " line "wasn't that hard! If I keep " line "this up, I should be able to get " line "the Legendary Pokémon Cards!" done Text0646: ; 4e859 (13:6859) - text "What? It's you, ", TX_RAM1, "!" + text "What? It's you, <RAMNAME>!" line "What are you doing?" line "Huh? That's a Deck!" line "Are you... trying to get the" @@ -752,12 +752,12 @@ Text0649: ; 4e991 (13:6991) line "'Cause the Legendary Pokémon Cards" line "are gonna be mine!" line "I already won the first Medal!" - line "See ya, ", TX_RAM1, "!" + line "See ya, <RAMNAME>!" line "Ha ha ha ha ha!!!" done Text064a: ; 4eb39 (13:6b39) - text "Hi, ", TX_RAM1, "!" + text "Hi, <RAMNAME>!" line "How ya doin'?" done @@ -793,7 +793,7 @@ Text064e: ; 4ec9a (13:6c9a) done Text064f: ; 4ed1c (13:6d1c) - text "Hi, ", TX_RAM1, "!" + text "Hi, <RAMNAME>!" line "Have you gotten any better?" done @@ -938,7 +938,7 @@ Text0663: ; 4f522 (13:7522) done Text0664: ; 4f574 (13:7574) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "So you've finally come this far?" line "I've already won 5 Medals!" line "By the time you win your 8th Medal," diff --git a/src/text/text8.asm b/src/text/text8.asm index 176964e..c76de49 100644 --- a/src/text/text8.asm +++ b/src/text/text8.asm @@ -13,7 +13,7 @@ Text0685: ; 5005b (14:405b) done Text0686: ; 500df (14:40df) - text "Hello, ", TX_RAM1, "!" + text "Hello, <RAMNAME>!" line "I just came up with a new card" line "strategy and was looking for" line "someone to test it on." @@ -65,7 +65,7 @@ Text068d: ; 5037f (14:437f) line "date. Why do I have to do it?" line "Why me?" line "I'm Jessica of the Fighting Club." - line "Oh! You must be ", TX_RAM1, "." + line "Oh! You must be <RAMNAME>." line "I heard about you from Mitch." line "Defeating you should be more" line "fun than training!" @@ -75,7 +75,7 @@ Text068e: ; 5044a (14:444a) text "Training's so boring and out of " line "date. Why do I have to do it?" line "" - text TX_RAM1, ", it's you again!" + text "<RAMNAME>, it's you again!" line "What a pain." line "But defeating you should be more" line "fun than training." @@ -188,7 +188,7 @@ Text069f: ; 50988 (14:4988) done Text06a0: ; 509d3 (14:49d3) - text TX_RAM1, " lost all " + text "<RAMNAME> lost all " line "his Energy cards!" done @@ -206,10 +206,10 @@ Text06a1: ; 509f2 (14:49f2) done Text06a2: ; 50a9e (14:4a9e) - text TX_RAM1, "" + text "<RAMNAME>" line "checked the wall!" line "" - text TX_RAM1, "" + text "<RAMNAME>" line "found a <Lv>9 Slowpoke!" done @@ -472,7 +472,7 @@ Text06cd: ; 51720 (14:5720) Text06ce: ; 5175f (14:575f) text "OK, " - line "To ", TX_RAM2, "." + line "To <RAMTEXT>." line "Please write in your Diary before" line "the transaction." done @@ -487,7 +487,7 @@ Text06d0: ; 517b4 (14:57b4) done Text06d1: ; 517f7 (14:57f7) - text TX_RAM1, "" + text "<RAMNAME>" line "wrote in the Diary." done @@ -498,21 +498,21 @@ Text06d2: ; 5180e (14:580e) Text06d3: ; 5182d (14:582d) text "You sent a card to" - line TX_RAM2, "!" + line "<RAMTEXT>!" line "Thank you." line "Please come again." done Text06d4: ; 51862 (14:5862) text "You sent the configuration for" - line "the ", TX_RAM2, " Deck!" + line "the <RAMTEXT> Deck!" line "Thank you." line "Please come again." done Text06d5: ; 518ac (14:58ac) text "You received the configuration for" - line "the ", TX_RAM2, " Deck!" + line "the <RAMTEXT> Deck!" line "Thank you." line "Please come again." done @@ -544,14 +544,14 @@ Text06d8: ; 51a6f (14:5a6f) line "are girls." line "But I can't beat girls who" line "are this tough!" - line "Huh? You must be ", TX_RAM1, "." + line "Huh? You must be <RAMNAME>." line "Mitch told me all about you." line "Beating you will be much better" line "than losing to the girls!" done Text06d9: ; 51b2e (14:5b2e) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "Would you duel me?" done @@ -697,7 +697,7 @@ Text06f1: ; 521a8 (14:61a8) done Text06f2: ; 521d8 (14:61d8) - text TX_RAM1, " traded an Oddish" + text "<RAMNAME> traded an Oddish" line "for a Vileplume!" done @@ -747,7 +747,7 @@ Text06f9: ; 523c4 (14:63c4) done Text06fa: ; 523f0 (14:63f0) - text TX_RAM1, " traded a Clefairy" + text "<RAMNAME> traded a Clefairy" line "for a Pikachu!" done @@ -792,7 +792,7 @@ Text0700: ; 525d9 (14:65d9) done Text0701: ; 5260b (14:660b) - text TX_RAM1, " traded a Charizard" + text "<RAMNAME> traded a Charizard" line "for a Blastoise!" done @@ -941,7 +941,7 @@ Text0718: ; 52cc3 (14:6cc3) done Text0719: ; 52d1a (14:6d1a) - text "Hello, ", TX_RAM1, "." + text "Hello, <RAMNAME>." line "Did you come for a Duel?" done @@ -1050,7 +1050,7 @@ Text0727: ; 53245 (14:7245) done Text0728: ; 53368 (14:7368) - text "Hello, ", TX_RAM1, "." + text "Hello, <RAMNAME>." line "Welcome." line "There aren't any cards I want " line "or can trade at the moment." @@ -1061,7 +1061,7 @@ Text0728: ; 53368 (14:7368) done Text0729: ; 53435 (14:7435) - text "Hello, ", TX_RAM1, "." + text "Hello, <RAMNAME>." line "I guess you're here because you" line "heard the rumor that I'm looking" line "for a Clefable..." @@ -1071,7 +1071,7 @@ Text0729: ; 53435 (14:7435) done Text072a: ; 534e1 (14:74e1) - text "Hello, ", TX_RAM1, "." + text "Hello, <RAMNAME>." line "Are you enjoying the " line "Pokémon Trading Card Game?" line "By the way, I'm looking for a " @@ -1114,7 +1114,7 @@ Text072f: ; 536f6 (14:76f6) done Text0730: ; 5371b (14:771b) - text TX_RAM1, " traded a Clefable" + text "<RAMNAME> traded a Clefable" line "for a Surfing Pikachu!" done @@ -1124,7 +1124,7 @@ Text0731: ; 53747 (14:7747) done Text0732: ; 5377f (14:777f) - text "Hello, ", TX_RAM1, "." + text "Hello, <RAMNAME>." line "I suppose you're here because you" line "heard that I was looking for" line "a Ditto this time..." @@ -1134,7 +1134,7 @@ Text0732: ; 5377f (14:777f) done Text0733: ; 53829 (14:7829) - text "Hello, ", TX_RAM1, ". " + text "Hello, <RAMNAME>. " line "Are you enjoying the" line "Pokémon Trading Card Game?" line "I'm looking for a Ditto" @@ -1163,7 +1163,7 @@ Text0735: ; 5395a (14:795a) done Text0736: ; 539ed (14:79ed) - text TX_RAM1, " traded a Ditto" + text "<RAMNAME> traded a Ditto" line "for a Flying Pikachu!" done @@ -1173,7 +1173,7 @@ Text0737: ; 53a15 (14:7a15) done Text0738: ; 53a4a (14:7a4a) - text "Hello, ", TX_RAM1, "." + text "Hello, <RAMNAME>." line "You're really current on the news!" line "I'm looking for a Chansey this " line "time! I'm thinking about trading" @@ -1184,7 +1184,7 @@ Text0738: ; 53a4a (14:7a4a) done Text0739: ; 53b25 (14:7b25) - text "Hello, ", TX_RAM1, ". " + text "Hello, <RAMNAME>. " line "Are you enjoying the" line "Pokémon Trading Card Game?" line "I'm looking for a Chansey" @@ -1212,7 +1212,7 @@ Text073b: ; 53c6a (14:7c6a) done Text073c: ; 53cf9 (14:7cf9) - text TX_RAM1, " traded a Chansey" + text "<RAMNAME> traded a Chansey" line "for a Surfing Pikachu!" done @@ -1222,7 +1222,7 @@ Text073d: ; 53d24 (14:7d24) done Text073e: ; 53d5b (14:7d5b) - text "Oh! Congratulations, ", TX_RAM1, "!" + text "Oh! Congratulations, <RAMNAME>!" line "I heard the news! You've finally " line "inherited the Legendary Pokémon " line "Cards! Don't worry, I'm not going " diff --git a/src/text/text9.asm b/src/text/text9.asm index b329238..295d7c1 100644 --- a/src/text/text9.asm +++ b/src/text/text9.asm @@ -1,6 +1,6 @@ Text073f: ; 54000 (15:4000) text "Who?" - line "Oh! It's you, ", TX_RAM1, "..." + line "Oh! It's you, <RAMNAME>..." line "I couldn't believe that I could" line "lose, but now..." line "Now I understand." @@ -16,14 +16,14 @@ Text073f: ; 54000 (15:4000) line "the different cards to build " line "different types of Decks, and" line "to play against different people!" - line "So...", TX_RAM1, "..." + line "So...<RAMNAME>..." line "Will you play with me again?" line "With all sorts of different Decks?" line "And this time, I not gonna lose!" done Text0740: ; 54223 (15:4223) - text "Oh, hi ", TX_RAM1, "..." + text "Oh, hi <RAMNAME>..." line "Do you want to Duel?" done @@ -115,7 +115,7 @@ Text074c: ; 546cf (15:46cf) done Text074d: ; 5471b (15:471b) - text "If I use ", TX_RAM2, " now," + text "If I use <RAMTEXT> now," line "This will happen..." done @@ -420,7 +420,7 @@ Text0781: ; 5557a (15:557a) done Text0782: ; 55621 (15:5621) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "Would you like to duel?" line "The Legendary Cards will eventually" line "belong to me!" @@ -429,7 +429,7 @@ Text0782: ; 55621 (15:5621) done Text0783: ; 5569c (15:569c) - text "Hi, ", TX_RAM1, "." + text "Hi, <RAMNAME>." line "Would you like to duel?" done @@ -634,7 +634,7 @@ Text07a2: ; 56049 (15:6049) Text07a3: ; 5606c (15:606c) text "I am Gene, the Master of the" line "Rock Club! Rock is good..." - line "Isn't Rock good, ", TX_RAM1, "...?" + line "Isn't Rock good, <RAMNAME>...?" line "Rock is hard and strong!" line "Doesn't crumble under pressure!" line "After you Duel me, you'll know " @@ -934,7 +934,8 @@ Text07cb: ; 56d53 (15:6d53) line "" line "" line " Satoshi Tajiri" - line TX_END + line "" + done Text07cc: ; 56d95 (15:6d95) text "" @@ -1010,7 +1011,7 @@ Text07d4: ; 5705e (15:705e) done Text07d5: ; 57075 (15:7075) - text TX_RAM1, "'s Score" + text "<RAMNAME>'s Score" done Text07d6: ; 57080 (15:7080) @@ -1023,7 +1024,7 @@ Text07d7: ; 570a4 (15:70a4) Text07d8: ; 570be (15:70be) text "Maximum Consecutive Wins" - line " [ ", TX_RAM2, " ]" + line " [ <RAMTEXT> ]" done Text07d9: ; 570e3 (15:70e3) @@ -1031,13 +1032,13 @@ Text07d9: ; 570e3 (15:70e3) done Text07da: ; 570e9 (15:70e9) - text TX_RAM1, " ", TX_RAM3, " Consecutive Wins!" + text "<RAMNAME> <RAMNUM> Consecutive Wins!" line "" - text TX_RAM3, " opponent is ", TX_RAM2, "." + text "<RAMNUM> opponent is <RAMTEXT>." done Text07db: ; 57112 (15:7112) - text TX_RAM3, " opponent is ", TX_RAM2, "." + text "<RAMNUM> opponent is <RAMTEXT>." done Text07dc: ; 57124 (15:7124) @@ -1063,13 +1064,13 @@ Text07e0: ; 571bd (15:71bd) done Text07e1: ; 571df (15:71df) - text "You lost to the ", TX_RAM3, " opponent," - line TX_RAM2, "!" + text "You lost to the <RAMNUM> opponent," + line "<RAMTEXT>!" done Text07e2: ; 571ff (15:71ff) - text TX_RAM1, "'s consecutive wins" - line "ended at ", TX_RAM3, "." + text "<RAMNAME>'s consecutive wins" + line "ended at <RAMNUM>." done Text07e3: ; 57221 (15:7221) @@ -1082,7 +1083,7 @@ Text07e4: ; 57240 (15:7240) Text07e5: ; 5725f (15:725f) text "Congratulations!" - line "You won against ", TX_RAM3, " opponents!" + line "You won against <RAMNUM> opponents!" done DefeatedFiveOpponentsText: ; 5728e (15:728e) @@ -1091,13 +1092,14 @@ DefeatedFiveOpponentsText: ; 5728e (15:728e) done Text07e7: ; 572ba (15:72ba) - text TX_RAM1, " successfully defeated " - line "5 opponents ", TX_START, TX_RAM3, " time(s)!!!" + text "<RAMNAME> successfully defeated " + line "5 opponents " + text "<RAMNUM> time(s)!!!" done ConsecutiveWinRecordIncreasedText: ; 572ee (15:72ee) - text TX_RAM1, "'s consecutive win" - line "record increased to ", TX_RAM3, "!" + text "<RAMNAME>'s consecutive win" + line "record increased to <RAMNUM>!" done Text07e9: ; 5731a (15:731a) @@ -1121,59 +1123,59 @@ Text07ed: ; 5734d (15:734d) done Text07ee: ; 5735b (15:735b) - db $61 + textfw0 "1" done Text07ef: ; 5735d (15:735d) - db $62 + textfw0 "2" done Text07f0: ; 5735f (15:735f) - db $63 + textfw0 "3" done Text07f1: ; 57361 (15:7361) - db $64 + textfw0 "4" done Text07f2: ; 57363 (15:7363) - db $65 + textfw0 "5" done Text07f3: ; 57365 (15:7365) - db $70 + textfw0 " " done Text07f4: ; 57367 (15:7367) - db $03,$55 + textfw3 "☆" done Text07f5: ; 5736a (15:736a) - db $03,$54 + textfw3 "★" done Text07f6: ; 5736d (15:736d) - db $03,$50, "<FIRE>", $03,$51 + textfw3 "【", "<FIRE>", "】" done Text07f7: ; 57374 (15:7374) - db $03,$50, "<LIGHTNING>", $03,$51 + textfw3 "【", "<LIGHTNING>", "】" done Text07f8: ; 5737b (15:737b) - db $03,$50, "<WATER>", $03,$51 + textfw3 "【", "<WATER>", "】" done Text07f9: ; 57382 (15:7382) - db $03,$50, "<FIGHTING>", $03,$51 + textfw3 "【", "<FIGHTING>", "】" done Text07fa: ; 57389 (15:7389) - db $03,$50, "<PSYCHIC>", $03,$51 + textfw3 "【", "<PSYCHIC>", "】" done Text07fb: ; 57390 (15:7390) - db $03,$50, "<GRASS>", $03,$51 + textfw3 "【", "<GRASS>", "】" done GrassEnergyName: ; 57397 (15:7397) diff --git a/src/wram.asm b/src/wram.asm index 9289a0f..e40d382 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -373,7 +373,7 @@ SECTION "WRAM Engine 1", WRAM0 wOAM:: ; ca00 ds $a0 -wcaa0:: ; caa0 +wTextBuf:: ; caa0 ds $10 wcab0:: ; cab0 @@ -394,6 +394,7 @@ wInitialA:: ; cab3 wConsole:: ; cab4 ds $1 +; used to select a sprite or a starting sprite from wOAM wOAMOffset:: ; cab5 ds $1 @@ -403,7 +404,7 @@ wTileMapFill:: ; cab6 wIE:: ; cab7 ds $1 -wVBlankCtr:: ; cab8 +wVBlankCounter:: ; cab8 ds $1 ds $1 @@ -431,13 +432,15 @@ wFlushPaletteFlags:: ; cabf wVBlankOAMCopyToggle:: ; cac0 ds $1 -wcac1:: ; cac1 +; used by HblankWriteByteToBGMap0 +wTempByte:: ; cac1 ds $1 wcac2:: ; cac2 ds $1 -wCounterCtr:: ; cac3 +; used to increase the play time counter every four timer interrupts (60.24 Hz) +wTimerCounter:: ; cac3 ds $1 wPlayTimeCounterEnable:: ; cac4 @@ -457,7 +460,7 @@ wRNG1:: ; caca wRNG2:: ; cacb ds $1 -wCounter:: ; cacc +wRNGCounter:: ; cacc ds $1 ; the LCDC status interrupt is always disabled and this always reads as jp $0000 @@ -753,6 +756,7 @@ wGotHeadsFromSandAttackOrSmokescreenCheck:: ; cc0a wAlreadyPlayedEnergy:: ; cc0b ds $1 +; set to 1 if the confusion check coin toss in AttemptRetreat is heads wGotHeadsFromConfusionCheckDuringRetreat:: ; cc0c ds $1 @@ -881,6 +885,7 @@ wDamageToSelfMode:: ; cce6 wcce9:: ; cce9 ds $2 +; a PLAY_AREA_* constant (0: arena card, 1-5: bench card) wTempPlayAreaLocationOffset_cceb:: ; cceb ds $1 @@ -912,8 +917,8 @@ SECTION "WRAM Engine 2", WRAM0 wTextBoxFrameType:: ; ccf3 ds $1 -wVWFOrRegularFontTile:: ; ccf4 - ds $10 +wTextTileBuffer:: ; ccf4 + ds TILE_SIZE wcd04:: ; cd04 ds $1 @@ -942,15 +947,23 @@ wCurTextLine:: ; cd09 ds $1 ; how to process the current text tile -; 0: regular font | non-0: VWF -wRegularFontOrVWF:: ; cd0a +; 0: full-width font | non-0: half-width font +wFontWidth:: ; cd0a ds $1 -wcd0b:: ; cd0b - ds $2 +; when printing half-width text, this variable alternates between 0 and the value +; of the first character. 0 signals that no text should be printed in the current +; iteration of Func_235e, while non-0 means to print the character pair +; made of [wHalfWidthPrintState] (first char) and register e (second char). +wHalfWidthPrintState:: ; cd0b + ds $1 + +; used by CopyTextData +wTextMaxLength:: ; cd0c + ds $1 -; VWF letters become uppercase if non-0, lowercase if 0 -wUppercaseVWFLetters:: ; cd0d +; half-width font letters become uppercase if non-0, lowercase if 0 +wUppercaseHalfWidthLetters:: ; cd0d ds $1 ds $1 @@ -974,7 +987,7 @@ wYDisplacementBetweenMenuItems:: ; cd13 wNumMenuItems:: ; cd14 ds $1 -wCursorTileNumber:: ; cd15 +wCursorTile:: ; cd15 ds $1 wTileBehindCursor:: ; cd16 @@ -1092,10 +1105,17 @@ wce22:: ; ce22 wCardPalette:: ; ce23 ds CGB_PAL_SIZE -wce2b:: ; ce2b - ds $1 - - ds $13 +; information about the text being currently processed, including font width, +; the rom bank, and the memory address of the next character to be printed. +; supports up to four nested texts (used with TX_RAM). +wTextHeader1:: ; ce2b + text_header wTextHeader1 +wTextHeader2:: ; ce30 + text_header wTextHeader2 +wTextHeader3:: ; ce35 + text_header wTextHeader3 +wTextHeader4:: ; ce3a + text_header wTextHeader4 ; text id for the first TX_RAM2 of a text ; prints from wDefaultText if $0000 @@ -1106,23 +1126,30 @@ wTxRam2:: ; cd3f wTxRam2_b:: ; ce41 ds $2 -; a number between 0 and 65535 for TX_RAM3 +; text id for the first TX_RAM3 of a text +; a number between 0 and 65535 wTxRam3:: ; ce43 ds $2 +; text id for the second TX_RAM3 of a text +; a number between 0 and 65535 +wTxRam3_b:: ; ce45 ds $2 ; when printing text, number of frames to wait between each text tile wTextSpeed:: ; ce47 ds $1 -wce48:: ; ce48 +; a number between 0 and 3 to select a wTextHeader to use for the current text +wWhichTextHeader:: ; ce48 ds $1 -wce49:: ; ce49 +; selects wTxRam2 or wTxRam2_b +wWhichTxRam2:: ; ce49 ds $1 -wce4a:: ; ce4a +; selects wTxRam3 or wTxRam3_b +wWhichTxRam3:: ; ce4a ds $1 wIsTextBoxLabeled:: ; ce4b @@ -1494,8 +1521,11 @@ wBoosterViableCardList:: ; d133 NEXTU -; map of the current room with unpassable objects (walls, NPCs, etc). Might be a permission map -wFloorObjectMap:: +; permission map of the current room with unpassable objects (walls, NPCs, etc). +; $00: passable (floor) +; $40: unpassable and talkable (NPC or talkable wall) +; $80: unpassable and untalkable (wall) +wPermissionMap:: ds $100 ENDU @@ -1822,12 +1852,26 @@ wSpriteAnimBuffer:: ; d4d0 sprite_anim_struct wSprite15 sprite_anim_struct wSprite16 - ds $3 +wd5d0:: ; d5d0 + ds $1 + +wd5d1:: ; d5d1 + ds $1 + +wd5d2:: ; d5d2 + ds $1 wd5d3:: ; d5d3 ds $1 - ds $3 +wd5d4:: ; d5d4 + ds $1 + +wd5d5:: ; d5d5 + ds $1 + +wd5d6:: ; d5d6 + ds $1 wd5d7:: ; d5d7 ds $1 @@ -1877,7 +1921,41 @@ wd635:: ; d635 wd636:: ; d635 ds $1 - ds $32 + ds $14 + +; wd64b to wd665 used by Func_3e44 +wd64b:: ; d64b + ds $6 + +wd651:: ; d651 + ds $6 + +wd657:: ; d657 + ds $1 + +wd658:: ; d658 + ds $1 + +wd659:: ; d659 + ds $6 + +wd65f:: ; d65f + ds $6 + +wd665:: ; d665 + ds $1 + +; used by GetNextBackgroundScroll +wBGScrollMod:: ; d666 + ds $1 + +; used by ApplyBackgroundScroll +wApplyBGScroll:: ; d667 + ds $1 + +; used by ApplyBackgroundScroll +wNextScrollLY:: ; d668 + ds $1 ; which BoosterPack_* corresponds to the booster pack that the player is opening wBoosterPackID:: ; d669 |