From 0473d5e2999dbc5e49e3f757a385f302392cd1e3 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Thu, 5 Jul 2018 03:46:20 +0200 Subject: Misc additions and corrections --- src/engine/bank01.asm | 12 +++++---- src/engine/home.asm | 75 ++++++++++++++++++++++++++++++++------------------- src/hram.asm | 6 +++-- src/wram.asm | 2 ++ 4 files changed, 61 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 97fe32a..09b9db2 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -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 @@ -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 diff --git a/src/engine/home.asm b/src/engine/home.asm index 29c9de2..e50384c 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -6848,6 +6848,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 @@ -7001,27 +7004,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,10 +7044,10 @@ 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 @@ -7063,12 +7066,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 +7099,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 +7388,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 @@ -7419,17 +7427,23 @@ SetCursorParametersForTextBox: ; 2a1a (0:2a1a) 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 @@ -7447,6 +7461,8 @@ Func_2a44: ; 2a44 (0:2a44) ld hl, wDefaultText jp Func_21c5 +; 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 @@ -7458,7 +7474,7 @@ DrawWideTextBox_PrintText: ; 2a59 (0:2a59) 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 +7482,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 +7506,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 +7514,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 +7541,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 +7560,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 +7631,7 @@ HandleYesOrNoMenu: scf ret -; prints YES NO at de +; prints "YES NO" at de PrintYesOrNoItems: ; 2b66 (0:2b66) call AdjustCoordinatesForBGScroll ldtx hl, YesOrNoText @@ -7763,7 +7784,7 @@ Func_2c23: ; 2c23 (0:2c23) Func_2c29: ; 2c29 (0:2c29) ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID call Func_21c5 pop af call BankswitchHome @@ -7776,7 +7797,7 @@ Func_2c37: ; 2c37 (0:2c37) push bc ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID ld c, $00 .char_loop ld a, [hli] @@ -7832,7 +7853,7 @@ Func_2c84: ; 2c84 (0:2c84) ld [wIsTextBoxLabeled], a ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID call Func_2d15 call Func_2cc8 .asm_2c93 @@ -8001,7 +8022,7 @@ Func_2d43: ; 2d43 (0:2d43) ld a, l or h jr z, .asm_2dab - call ReadTextOffset + call GetTextOffsetFromTextID call Func_2cd7 jr Func_2d43 .asm_2dab @@ -8046,7 +8067,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 @@ -8120,7 +8141,7 @@ PrintText: ; 2e41 (0:2e41) jr z, .from_ram ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID call .print_text pop af call BankswitchHome @@ -8155,7 +8176,7 @@ PrintText: ; 2e41 (0:2e41) PrintTextNoDelay: ; 2e76 (0:2e76) ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID call Func_2cc8 .next_tile_loop call Func_2d43 @@ -8172,7 +8193,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,7 +8215,7 @@ Func_2ea9: ; 2ea9 (0:2ea9) ldh [hff96], a ldh a, [hBankROM] push af - call ReadTextOffset + call GetTextOffsetFromTextID ldh a, [hff96] call $23fd pop af diff --git a/src/hram.asm b/src/hram.asm index 25f8f10..2bf432f 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 diff --git a/src/wram.asm b/src/wram.asm index 9289a0f..b417199 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -753,6 +753,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 +882,7 @@ wDamageToSelfMode:: ; cce6 wcce9:: ; cce9 ds $2 +; a PLAY_AREA_* constant (0: arena card, 1-5: bench card) wTempPlayAreaLocationOffset_cceb:: ; cceb ds $1 -- cgit v1.2.3 From 3d15aab87f4d7430037257424ac83ef130198dc7 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Sun, 8 Jul 2018 18:43:07 +0200 Subject: VWF -> Half-width font ; Regular font -> Full-width font --- src/engine/bank01.asm | 4 +- src/engine/home.asm | 148 ++++++++++++++++++++-------------------- src/gfx.asm | 8 +-- src/gfx/fonts.t3.png | Bin 7972 -> 0 bytes src/gfx/fonts/full_width.t3.png | Bin 0 -> 7972 bytes src/gfx/fonts/half_width.png | Bin 0 -> 387 bytes src/gfx/vwf.png | Bin 387 -> 0 bytes src/wram.asm | 14 ++-- 8 files changed, 88 insertions(+), 86 deletions(-) delete mode 100644 src/gfx/fonts.t3.png create mode 100644 src/gfx/fonts/full_width.t3.png create mode 100644 src/gfx/fonts/half_width.png delete mode 100644 src/gfx/vwf.png (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 09b9db2..d08d128 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,7 +38,7 @@ 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) diff --git a/src/engine/home.asm b/src/engine/home.asm index e50384c..ab209eb 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -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" @@ -5952,7 +5952,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(FullWidthFonts); BANK(DuelGraphics); BANK(HalfWidthFont) call BankpushHome ld c, TILE_SIZE call CopyGfxData @@ -6060,12 +6060,12 @@ Func_21f2: ; 21f2 (0:21f2) ret .asm_220f ld a, $1 - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ret .asm_2215 call Func_230f xor a - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ld a, $f ldh [hffaf], a ret @@ -6074,13 +6074,13 @@ Func_21f2: ; 21f2 (0:21f2) xor a ret .asm_2225 - ld a, [wRegularFontOrVWF] + ld a, [wFontWidth] push af ld a, $1 - ld [wRegularFontOrVWF], a + ld [wFontWidth], a call Func_230f pop af - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ldh a, [hffb0] or a jr nz, .asm_2240 @@ -6148,13 +6148,13 @@ Func_2275: ; 2275 (0:2275) jr nz, .asm_2292 ret -; wRegularFontOrVWF <- 0 +; wFontWidth <- 0 ; hTextLineCurPos <- 0 ; wcd0b <- 0 ; hffaf <- $f Func_2298: ; 2298 (0:2298) xor a - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ldh [hTextLineCurPos], a ld [wcd0b], a ld a, $f @@ -6245,7 +6245,7 @@ PlaceNextTextTile: ; 22f2 (0:22f2) ret Func_230f: ; 230f (0:230f) - ld a, [wRegularFontOrVWF] + ld a, [wFontWidth] or a ret z ld a, [wcd0b] @@ -6309,10 +6309,11 @@ 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] + ld a, [wFontWidth] or a ; - jr z, .asm_2376 ; if [wRegularFontOrVWF] nonzero: - call CaseVWFLetter ; uppercase e if wUppercaseVWFLetters != 0 + jr z, .asm_2376 ; if [wFontWidth] nonzero: + ; uppercase e if wUppercaseHalfWidthLetters != 0 + call CaseHalfWidthLetter ld a, [wcd0b] ld d, a ; d ← [wcd0b] or a @@ -6370,9 +6371,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 @@ -6396,7 +6397,7 @@ Func_23c1: ; 23c1 (0:23c1) ret .asm_23cf xor a - ld [wRegularFontOrVWF], a + ld [wFontWidth], a Func_23d3: ; 23d3 (0:23d3) push hl push de @@ -6492,52 +6493,53 @@ 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 == 0 + ; de = full-width font tile number (d = $e and d = $f are treated differently) +; if wFontWidth != 0 + ; 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 de, wTextTileBuffer + 1 + call CopyHalfWidthCharacterToDE + ; construct the resulting half-width font tile + ld hl, wTextTileBuffer ld b, TILE_SIZE / 2 .loop ld a, [hli] @@ -6550,20 +6552,20 @@ 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 half-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 .loop @@ -6575,13 +6577,13 @@ CopyVWFCharacterToDE: ; 24fa (0:24fa) 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 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,12 +6608,12 @@ 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 offset within the full-width font graphics in hl +CreateFullWidthFontTile: ; 252e (0:252e) + ld a, BANK(FullWidthFonts); BANK(DuelGraphics); BANK(HalfWidthFont) call BankpushHome - ld de, wVWFOrRegularFontTile + ld de, wTextTileBuffer push de ld c, TILE_SIZE / 2 .loop @@ -6627,7 +6629,7 @@ CreateRegularFontTile: ; 252e (0:252e) ret Func_2546: ; 2546 (0:2546) - ld a, [wRegularFontOrVWF] + ld a, [wFontWidth] or a jr nz, .asm_255f ld a, e @@ -6657,10 +6659,10 @@ Func_2546: ; 2546 (0:2546) scf ret -; convert the regular font tile number at de to the -; equivalent offset within the font tile graphics. +; convert the full-width font tile number at de to the +; equivalent offset within the full-width font tile graphics. ; d = $e and d = $f are treated differently -GetRegularFontTileOffset: ; 256d (0:256d) +GetFullWidthFontTileOffset: ; 256d (0:256d) ld bc, 40 tiles ld a, d cp $e @@ -6709,7 +6711,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] @@ -6864,7 +6866,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) @@ -6890,9 +6892,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) @@ -7420,7 +7422,7 @@ 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 @@ -7902,7 +7904,7 @@ Func_2cd7: ; 2cd7 (0:2cd7) pop bc ld a, [hffaf] ld [hli], a - ld a, [wRegularFontOrVWF] + ld a, [wFontWidth] ld [hli], a ldh a, [hBankROM] ld [hli], a @@ -7922,7 +7924,7 @@ Func_2cf3: ; 2cf3 (0:2cf3) ld a, [hli] ld [hffaf], a ld a, [hli] - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ld a, [hli] call BankswitchHome ld a, [hli] @@ -8015,7 +8017,7 @@ Func_2d43: ; 2d43 (0:2d43) ld a, $f ld [hffaf], a xor a - ld [wRegularFontOrVWF], a + ld [wFontWidth], a ld de, wTxRam2 ld hl, wce49 call Func_2de0 @@ -8095,14 +8097,14 @@ GetTextOffsetFromTextID: ; 2ded (0:2ded) pop de ret -; if [wRegularFontOrVWF] != 0: +; if [wFontWidth] != 0: ; convert the number at hl to text (ascii) format and write it to wcaa0 ; return c = 4 - leading_zeros -; if [wRegularFontOrVWF] == 0: +; if [wFontWidth] == 0: ; convert the number at hl to TX_SYMBOL text format and write it to wcaa0 ; replace leading zeros with SYM_SPACE TwoByteNumberToText_CountLeadingZeros: ; 2e12 (0:2e12) - ld a, [wRegularFontOrVWF] + ld a, [wFontWidth] or a jp z, TwoByteNumberToTxSymbol_TrimLeadingZeros ld de, wcaa0 @@ -8404,7 +8406,7 @@ LoadCardGfx: ; 2fa0 (0:2fa0) ; identical to CopyFontsOrDuelGraphicsTiles CopyFontsOrDuelGraphicsTiles2: ; 2fcb (0:2fcb) - ld a, BANK(Fonts); BANK(DuelGraphics); BANK(VWF) + ld a, BANK(FullWidthFonts); BANK(DuelGraphics); BANK(HalfWidthFont) call BankpushHome ld c, TILE_SIZE call CopyGfxData diff --git a/src/gfx.asm b/src/gfx.asm index aa5527d..bee55be 100644 --- a/src/gfx.asm +++ b/src/gfx.asm @@ -2,11 +2,11 @@ INCLUDE "macros.asm" SECTION "Gfx 1", ROMX -Fonts:: ; 74000 (1d:4000) -INCBIN "gfx/fonts.t3.1bpp" +FullWidthFonts:: ; 74000 (1d:4000) +INCBIN "gfx/fonts/full_width.t3.1bpp" -VWF:: ; 76668 (1d:6668) -INCBIN "gfx/vwf.1bpp" +HalfWidthFont:: ; 76668 (1d:6668) +INCBIN "gfx/fonts/half_width.1bpp" DuelGraphics:: diff --git a/src/gfx/fonts.t3.png b/src/gfx/fonts.t3.png deleted file mode 100644 index 5dc1fe8..0000000 Binary files a/src/gfx/fonts.t3.png and /dev/null differ diff --git a/src/gfx/fonts/full_width.t3.png b/src/gfx/fonts/full_width.t3.png new file mode 100644 index 0000000..5dc1fe8 Binary files /dev/null and b/src/gfx/fonts/full_width.t3.png differ diff --git a/src/gfx/fonts/half_width.png b/src/gfx/fonts/half_width.png new file mode 100644 index 0000000..39e783e Binary files /dev/null and b/src/gfx/fonts/half_width.png differ diff --git a/src/gfx/vwf.png b/src/gfx/vwf.png deleted file mode 100644 index 39e783e..0000000 Binary files a/src/gfx/vwf.png and /dev/null differ diff --git a/src/wram.asm b/src/wram.asm index b417199..330a9ed 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -914,8 +914,8 @@ SECTION "WRAM Engine 2", WRAM0 wTextBoxFrameType:: ; ccf3 ds $1 -wVWFOrRegularFontTile:: ; ccf4 - ds $10 +wTextTileBuffer:: ; ccf4 + ds TILE_SIZE wcd04:: ; cd04 ds $1 @@ -944,15 +944,15 @@ 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 -; 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 @@ -976,7 +976,7 @@ wYDisplacementBetweenMenuItems:: ; cd13 wNumMenuItems:: ; cd14 ds $1 -wCursorTileNumber:: ; cd15 +wCursorTile:: ; cd15 ds $1 wTileBehindCursor:: ; cd16 -- cgit v1.2.3 From 1ef94a8af1a7232bf6e54911b16e0dd63c4f602f Mon Sep 17 00:00:00 2001 From: xCrystal Date: Tue, 10 Jul 2018 11:52:24 +0200 Subject: Document some text engine functions --- src/constants/text_constants.asm | 4 + src/engine/bank01.asm | 12 +-- src/engine/bank02.asm | 2 +- src/engine/bank03.asm | 2 +- src/engine/bank04.asm | 2 +- src/engine/home.asm | 160 ++++++++++++++++++++++----------------- src/gfx.asm | 6 +- src/gfx/duel/hud.png | Bin 1398 -> 0 bytes src/gfx/fonts/symbols.png | Bin 0 -> 1398 bytes src/macros/wram.asm | 7 ++ src/text/text3.asm | 4 +- src/wram.asm | 30 ++++++-- 12 files changed, 137 insertions(+), 92 deletions(-) delete mode 100644 src/gfx/duel/hud.png create mode 100644 src/gfx/fonts/symbols.png (limited to 'src') diff --git a/src/constants/text_constants.asm b/src/constants/text_constants.asm index b5e6e22..70e0ab7 100644 --- a/src/constants/text_constants.asm +++ b/src/constants/text_constants.asm @@ -15,6 +15,10 @@ done EQUS "db TX_END" charmap "♀", "%" charmap "”", "\"" +; wFontWidth constants +FULL_WIDTH EQU $0 +HALF_WIDTH EQU $1 ; non-0 + ; 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_* diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index d08d128..a67d672 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -45,7 +45,7 @@ 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 @@ -1558,7 +1558,7 @@ Func_49ed: ; 49ed (1:49ed) INCROM $4a35, $4a97 Func_4a97: ; 4a97 (1:4a97) - call LoadDuelHUDTiles + call LoadSymbolsFont ld de, wDefaultText push de call CopyPlayerName @@ -2003,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 @@ -2507,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 @@ -3311,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 diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index 87810fa..ffcc1d8 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 diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index 865cc5b..b44d07a 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 diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm index 215132c..256a2f6 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 diff --git a/src/engine/home.asm b/src/engine/home.asm index ab209eb..cc00b7d 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -5941,10 +5941,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 @@ -5960,9 +5960,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 @@ -5998,7 +5998,7 @@ DrawDuelBoxMessage: ; 2167 (0:2167) ; hl = a * $280 ld de, DuelBoxMessages add hl, de - ld de, v0Tiles1 + $200 + ld de, v0Tiles1 + $20 tiles ld b, $28 call CopyFontsOrDuelGraphicsTiles ld a, $a0 @@ -6059,12 +6059,12 @@ Func_21f2: ; 21f2 (0:21f2) scf ret .asm_220f - ld a, $1 + ld a, HALF_WIDTH ld [wFontWidth], a ret .asm_2215 call Func_230f - xor a + xor a ; FULL_WIDTH ld [wFontWidth], a ld a, $f ldh [hffaf], a @@ -6076,7 +6076,7 @@ Func_21f2: ; 21f2 (0:21f2) .asm_2225 ld a, [wFontWidth] push af - ld a, $1 + ld a, HALF_WIDTH ld [wFontWidth], a call Func_230f pop af @@ -6148,12 +6148,12 @@ Func_2275: ; 2275 (0:2275) jr nz, .asm_2292 ret -; wFontWidth <- 0 +; wFontWidth <- FULL_WIDTH ; hTextLineCurPos <- 0 ; wcd0b <- 0 ; hffaf <- $f Func_2298: ; 2298 (0:2298) - xor a + xor a ; FULL_WIDTH ld [wFontWidth], a ldh [hTextLineCurPos], a ld [wcd0b], a @@ -6246,7 +6246,7 @@ PlaceNextTextTile: ; 22f2 (0:22f2) Func_230f: ; 230f (0:230f) ld a, [wFontWidth] - or a + or a ; FULL_WIDTH ret z ld a, [wcd0b] or a @@ -6254,7 +6254,7 @@ Func_230f: ; 230f (0:230f) push hl push de push bc - ld e, $20 + ld e, " " call Func_22ca pop bc pop de @@ -6311,7 +6311,7 @@ Func_2325: ; 2325 (0:2325) Func_235e: ; 235e (0:235e) ld a, [wFontWidth] or a ; - jr z, .asm_2376 ; if [wFontWidth] nonzero: + jr z, .asm_2376 ; if [wFontWidth] == HALF_WIDTH: ; uppercase e if wUppercaseHalfWidthLetters != 0 call CaseHalfWidthLetter ld a, [wcd0b] @@ -6396,7 +6396,7 @@ Func_23c1: ; 23c1 (0:23c1) sub b ret .asm_23cf - xor a + xor a ; FULL_WIDTH ld [wFontWidth], a Func_23d3: ; 23d3 (0:23d3) push hl @@ -6493,9 +6493,9 @@ TwoByteNumberToTxSymbol_TrimLeadingZeros: ; 245d (0:245d) ret ; generates a text tile and copies it to VRAM -; if wFontWidth == 0 +; if wFontWidth == FULL_WIDTH ; de = full-width font tile number (d = $e and d = $f are treated differently) -; if wFontWidth != 0 +; if wFontWidth == HALF_WIDTH ; d = half-width character 1 (left) ; e = half-width character 2 (right) ; b = destination VRAM tile number @@ -6630,7 +6630,7 @@ CreateFullWidthFontTile: ; 252e (0:252e) Func_2546: ; 2546 (0:2546) ld a, [wFontWidth] - or a + or a ; FULL_WIDTH jr nz, .asm_255f ld a, e cp $10 @@ -7829,7 +7829,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 @@ -7844,7 +7844,9 @@ Func_2c73: ; 2c73 (0:2c73) xor a call Func_2c84 -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 @@ -7857,50 +7859,58 @@ Func_2c84: ; 2c84 (0:2c84) push af call GetTextOffsetFromTextID call Func_2d15 - call Func_2cc8 -.asm_2c93 + call InitRegistersForPrintingText +.print_char_loop ld a, [wTextSpeed] ld c, a inc c jr .asm_2cac -.asm_2c9a +.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 dec c - jr nz, .asm_2c9a -.asm_2caf + jr nz, .nonzero_text_speed +.skip_delay call Func_2d43 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 wWhichTextStruct, wWhichTxRam2 and wWhichTxRam3, and set hffaf to $f +; fill wTextStruct1 with $f, wFontWidth, hBankROM, and register bc for the text's pointer. +InitRegistersForPrintingText: ; 2cc8 (0:2cc8) xor a - ld [wce48], a - ld [wce49], a - ld [wce4a], a + ld [wWhichTextStruct], a + ld [wWhichTxRam2], a + ld [wWhichTxRam3], a ld a, $f ld [hffaf], a -Func_2cd7: ; 2cd7 (0:2cd7) +; fallthrough + +; fill the wTextStruct specified in wWhichTextStruct (0-3) with hffaf, +; wFontWidth, hBankROM, and register bc for the text's pointer. +WriteToTextStruct: ; 2cd7 (0:2cd7) push hl - call Func_2d06 + call GetPointerToTextStruct pop bc ld a, [hffaf] ld [hli], a @@ -7913,14 +7923,20 @@ Func_2cd7: ; 2cd7 (0:2cd7) ld [hl], b ret -Func_2ceb: ; 2ceb (0:2ceb) - call Func_2cd7 - ld hl, wce48 +; same as WriteToTextStruct, except it then increases wWhichTextStruct to +; set the following text struct to the current one (usually, because +; it will soon be written to due to a TX_RAM command). +WriteToTextStruct_MoveToNext: ; 2ceb (0:2ceb) + call WriteToTextStruct + ld hl, wWhichTextStruct inc [hl] ret -Func_2cf3: ; 2cf3 (0:2cf3) - call Func_2d06 +; read the wTextStruct specified in wWhichTextStruct (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. +ReadTextStruct: ; 2cf3 (0:2cf3) + call GetPointerToTextStruct ld a, [hli] ld [hffaf], a ld a, [hli] @@ -7932,15 +7948,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 wTextStruct specified in wWhichTextStruct (0-3) +GetPointerToTextStruct: ; 2d06 (0:2d06) + ld a, [wWhichTextStruct] ld e, a add a add a add e ld e, a ld d, $0 - ld hl, wce2b + ld hl, wTextStruct1 add hl, de ret @@ -7970,7 +7987,7 @@ Func_2d15: ; 2d15 (0:2d15) ret Func_2d43: ; 2d43 (0:2d43) - call Func_2cf3 + call ReadTextStruct ld a, [hli] or a ; TX_END jr z, .asm_2d79 @@ -7998,49 +8015,49 @@ Func_2d43: ; 2d43 (0:2d43) xor a call Func_21f2 .asm_2d74 - call Func_2cd7 + call WriteToTextStruct or a ret .asm_2d79 - ld a, [wce48] + ld a, [wWhichTextStruct] or a jr z, .asm_2d85 dec a - ld [wce48], a + ld [wWhichTextStruct], a jr Func_2d43 .asm_2d85 call Func_230f scf ret .tx_ram2 - call Func_2ceb + call WriteToTextStruct_MoveToNext ld a, $f ld [hffaf], a - xor 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 GetTextOffsetFromTextID - call Func_2cd7 + call WriteToTextStruct jr Func_2d43 .asm_2dab ld hl, wDefaultText - call Func_2cd7 + call WriteToTextStruct jr Func_2d43 .tx_ram3 - call Func_2ceb + call WriteToTextStruct_MoveToNext ld de, wTxRam3 - ld hl, wce4a - call Func_2de0 + ld hl, wWhichTxRam3 + call HandleTxRam2Or3 call TwoByteNumberToText_CountLeadingZeros - call Func_2cd7 + call WriteToTextStruct jp Func_2d43 .tx_ram1 - call Func_2ceb + call WriteToTextStruct_MoveToNext call CopyTurnDuelistName ld a, [wcaa0] cp $6 @@ -8048,12 +8065,15 @@ Func_2d43: ; 2d43 (0:2d43) ld a, $7 call Func_21f2 .asm_2dda - call Func_2cd7 + call WriteToTextStruct jp Func_2d43 -; inc [hl] -; hl = [de + 2*[hl]] -Func_2de0: ; 2de0 (0:2de0) +; 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] @@ -8097,15 +8117,15 @@ GetTextOffsetFromTextID: ; 2ded (0:2ded) pop de ret -; if [wFontWidth] != 0: +; if [wFontWidth] == HALF_WIDTH: ; convert the number at hl to text (ascii) format and write it to wcaa0 ; return c = 4 - leading_zeros -; if [wFontWidth] == 0: +; if [wFontWidth] == FULL_WIDTH: ; convert the number at hl to TX_SYMBOL text format and write it to wcaa0 ; replace leading zeros with SYM_SPACE TwoByteNumberToText_CountLeadingZeros: ; 2e12 (0:2e12) ld a, [wFontWidth] - or a + or a ; FULL_WIDTH jp z, TwoByteNumberToTxSymbol_TrimLeadingZeros ld de, wcaa0 push de @@ -8151,7 +8171,7 @@ PrintText: ; 2e41 (0:2e41) .from_ram ld hl, wDefaultText .print_text - call Func_2cc8 + call InitRegistersForPrintingText .next_tile_loop ldh a, [hButtonsHeld] ld b, a @@ -8179,7 +8199,7 @@ PrintTextNoDelay: ; 2e76 (0:2e76) ldh a, [hBankROM] push af call GetTextOffsetFromTextID - call Func_2cc8 + call InitRegistersForPrintingText .next_tile_loop call Func_2d43 jr nc, .next_tile_loop diff --git a/src/gfx.asm b/src/gfx.asm index bee55be..f26662c 100644 --- a/src/gfx.asm +++ b/src/gfx.asm @@ -8,10 +8,10 @@ INCBIN "gfx/fonts/full_width.t3.1bpp" HalfWidthFont:: ; 76668 (1d:6668) INCBIN "gfx/fonts/half_width.1bpp" -DuelGraphics:: +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/duel/hud.png b/src/gfx/duel/hud.png deleted file mode 100644 index 81afc3b..0000000 Binary files a/src/gfx/duel/hud.png and /dev/null differ diff --git a/src/gfx/fonts/symbols.png b/src/gfx/fonts/symbols.png new file mode 100644 index 0000000..81afc3b Binary files /dev/null and b/src/gfx/fonts/symbols.png differ diff --git a/src/macros/wram.asm b/src/macros/wram.asm index cedb0dd..a904d87 100644 --- a/src/macros/wram.asm +++ b/src/macros/wram.asm @@ -39,6 +39,13 @@ move_data_struct: MACRO \1Animation:: ds 1 ENDM +text_struct: MACRO +\1Unknown:: 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/text3.asm b/src/text/text3.asm index 3231b66..0617435 100644 --- a/src/text/text3.asm +++ b/src/text/text3.asm @@ -1201,7 +1201,7 @@ Text035b: ; 3eb62 (f:6b62) done Text035c: ; 3eb88 (f:6b88) - db "ppppp" + db $70,$70,$70,$70,$70 done Text035d: ; 3eb8e (f:6b8e) @@ -1587,7 +1587,7 @@ Text03a6: ; 3f631 (f:7631) done Text03a7: ; 3f643 (f:7643) - db TX_END + done Text03a8: ; 3f644 (f:7644) text "COLOSSEUM" diff --git a/src/wram.asm b/src/wram.asm index 330a9ed..0691a19 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -1094,10 +1094,17 @@ wce22:: ; ce22 wCardPalette:: ; ce23 ds CGB_PAL_SIZE -wce2b:: ; ce2b - ds $1 - - ds $13 +; information about the text being currently processed, like the 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). +wTextStruct1:: ; ce2b + text_struct wTextStruct1 +wTextStruct2:: ; ce30 + text_struct wTextStruct2 +wTextStruct3:: ; ce35 + text_struct wTextStruct3 +wTextStruct4:: ; ce3a + text_struct wTextStruct4 ; text id for the first TX_RAM2 of a text ; prints from wDefaultText if $0000 @@ -1108,23 +1115,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 wTextStruct to use for the current text +wWhichTextStruct:: ; 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 -- cgit v1.2.3 From 1cb35e7d97933f146ad9ab7966bb496536aa3d93 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Tue, 10 Jul 2018 23:14:39 +0200 Subject: More text engine TODO: update charmaps and text/ --- src/constants/gfx_constants.asm | 3 + src/constants/text_constants.asm | 42 +++++-- src/engine/bank06.asm | 2 +- src/engine/home.asm | 240 +++++++++++++++++++++------------------ src/hram.asm | 7 +- src/macros/wram.asm | 8 +- src/text/text4.asm | 6 +- src/text/text6.asm | 16 +-- src/text/text9.asm | 2 +- src/wram.asm | 2 +- 10 files changed, 187 insertions(+), 141 deletions(-) (limited to 'src') 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/text_constants.asm b/src/constants/text_constants.asm index 70e0ab7..ed0938b 100644 --- a/src/constants/text_constants.asm +++ b/src/constants/text_constants.asm @@ -1,14 +1,36 @@ -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 -text EQUS "db TX_START, " -line EQUS "db TX_LINE, " -done EQUS "db TX_END" +; TX_FULLWIDTH*, char1, TX_FULLWIDTH*, char2, ... +TX_FULLWIDTH1 EQU $01 +TX_FULLWIDTH2 EQU $02 +TX_FULLWIDTH3 EQU $03 +TX_FULLWIDTH4 EQU $04 + +TX_CTRL_BEGIN EQU $05 + +; TX_SYMBOL, char1, TX_SYMBOL, char2, ... +TX_SYMBOL EQU $05 + +; TX_HALFWIDTH, char1, char2, ... +TX_HALFWIDTH EQU $06 ; sets wFontWidth to HALF_WIDTH + +TX_HALF2FULL EQU $07 ; sets wFontWidth to FULL_WIDTH, and hDefaultFont to TX_FULLWIDTH6 +TX_RAM1 EQU $09 +TX_LINE EQU "\n" ; $0a +TX_RAM2 EQU $0b +TX_RAM3 EQU $0c + +; usage: TX_FULLWIDTH*, char1, char2, ... +; db char1, char2, ... defaults to the value at hDefaultFont, unless +; wFontWidth was set to HALF_WIDTH by TX_HALFWIDTH (it is FULL_WIDTH by default) +TX_FULLWIDTH5 EQU $0e ; sets hDefaultFont to TX_FULLWIDTH5 +TX_FULLWIDTH6 EQU $0f ; sets hDefaultFont to TX_FULLWIDTH6 + +TX_CTRL_END EQU $10 + +text EQUS "db TX_HALFWIDTH, " +line EQUS "db TX_LINE, " +done EQUS "db TX_END" charmap "é", "`" charmap "♂", "$" diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm index 7c19b74..f952585 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 diff --git a/src/engine/home.asm b/src/engine/home.asm index cc00b7d..add74b6 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -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 @@ -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 @@ -5991,7 +5991,7 @@ Func_212f: ; 212f (0:212f) 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 @@ -6016,16 +6016,16 @@ Func_21c5: ; 21c5 (0:21c5) call Func_2298 jr .asm_21e8 .asm_21cc - cp $5 + cp TX_CTRL_BEGIN jr c, .asm_21d9 - cp $10 + cp TX_CTRL_END jr nc, .asm_21d9 call Func_21f2 jr .asm_21e8 .asm_21d9 ld e, a ld d, [hl] - call Func_2546 + call ProcessFullWidthFontCharacterPair jr nc, .asm_21e1 inc hl .asm_21e1 @@ -6042,38 +6042,38 @@ Func_21c5: ; 21c5 (0:21c5) ret Func_21f2: ; 21f2 (0:21f2) - or a - jr z, .asm_2241 - cp $e + or a ; TX_END + jr z, .tx_end + cp TX_FULLWIDTH5 jr z, .asm_2221 - cp $f + cp TX_FULLWIDTH6 jr z, .asm_2221 - cp $a - jr z, .reached_line_length + 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 +.tx_halfwidth ld a, HALF_WIDTH ld [wFontWidth], a ret -.asm_2215 +.tx_half2full call Func_230f xor a ; FULL_WIDTH ld [wFontWidth], a - ld a, $f - ldh [hffaf], a + ld a, TX_FULLWIDTH6 + ldh [hDefaultFont], a ret .asm_2221 - ldh [hffaf], a + ldh [hDefaultFont], a xor a ret -.asm_2225 +.tx_symbol ld a, [wFontWidth] push af ld a, HALF_WIDTH @@ -6090,17 +6090,17 @@ Func_21f2: ; 21f2 (0:21f2) pop hl .asm_2240 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 +.end_of_line call Func_230f ld a, [wLineSeparation] or a @@ -6151,14 +6151,14 @@ Func_2275: ; 2275 (0:2275) ; wFontWidth <- FULL_WIDTH ; hTextLineCurPos <- 0 ; wcd0b <- 0 -; hffaf <- $f +; hDefaultFont <- TX_FULLWIDTH6 Func_2298: ; 2298 (0:2298) xor a ; FULL_WIDTH ld [wFontWidth], a ldh [hTextLineCurPos], a ld [wcd0b], a - ld a, $f - ldh [hffaf], a + ld a, TX_FULLWIDTH6 + ldh [hDefaultFont], a ret ; Func_22ae @@ -6387,7 +6387,7 @@ CaseHalfWidthLetter: ; 23b1 (0:23b1) Func_23c1: ; 23c1 (0:23c1) ld a, [hl] - cp TX_START + cp TX_HALFWIDTH jr nz, .asm_23cf call Func_23d3 inc b @@ -6407,9 +6407,9 @@ Func_23d3: ; 23d3 (0:23d3) or a jr z, .asm_23f8 inc c - cp $5 + cp TX_CTRL_BEGIN jr c, .asm_23ec - cp $10 + cp TX_CTRL_END jr nc, .asm_23ec cp TX_SYMBOL jr nz, .asm_23d8 @@ -6419,7 +6419,7 @@ Func_23d3: ; 23d3 (0:23d3) ld e, a ld d, [hl] inc b - call Func_2546 + call ProcessFullWidthFontCharacterPair jr nc, .asm_23d8 .asm_23f4 inc c @@ -6435,12 +6435,12 @@ Func_23d3: ; 23d3 (0:23d3) INCROM $23fd, $245d -; convert the number at hl to TX_SYMBOL text format and write it to wcaa0 +; 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 @@ -6538,9 +6538,9 @@ CreateHalfWidthFontTile: ; 24ca (0:24ca) ld a, d ld de, wTextTileBuffer + 1 call CopyHalfWidthCharacterToDE - ; construct the resulting half-width font tile + ; construct the 2bpp-converted half-width font tile ld hl, wTextTileBuffer - ld b, TILE_SIZE / 2 + ld b, TILE_SIZE_1BPP .loop ld a, [hli] swap a @@ -6555,7 +6555,7 @@ CreateHalfWidthFontTile: ; 24ca (0:24ca) ld de, wTextTileBuffer ret -; copies a half-tile corresponding to a half-width font character to de. +; 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) @@ -6567,12 +6567,12 @@ CopyHalfWidthCharacterToDE: ; 24fa (0:24fa) add hl, hl 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 @@ -6615,7 +6615,7 @@ CreateFullWidthFontTile: ; 252e (0:252e) call BankpushHome ld de, wTextTileBuffer push de - ld c, TILE_SIZE / 2 + ld c, TILE_SIZE_1BPP .loop ld a, [hli] ld [de], a @@ -6628,32 +6628,37 @@ CreateFullWidthFontTile: ; 252e (0:252e) call BankpopHome ret -Func_2546: ; 2546 (0:2546) +; given two text characters at de, use the char at d to determine +; which type of TX_FULLWIDTH this pair of characters belongs to. +; return carry if TX_FULLWIDTH1 to TX_FULLWIDTH4. +ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) ld a, [wFontWidth] or a ; FULL_WIDTH - jr nz, .asm_255f + 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, .first_font + ldh a, [hDefaultFont] + cp TX_FULLWIDTH6 + jr nz, .first_font + ld d, TX_FULLWIDTH6 or a ret -.asm_255f +.half_width or a ret -.asm_2561 - cp $5 - jr c, .asm_2569 -.asm_2565 +.continue_check + cp TX_CTRL_BEGIN + jr c, .ath_font +.first_font +; TX_FULLWIDTH5 ld d, $0 or a ret -.asm_2569 +.ath_font +; TX_FULLWIDTH1 to TX_FULLWIDTH4 ld e, d ld d, a scf @@ -6661,19 +6666,21 @@ Func_2546: ; 2546 (0:2546) ; convert the full-width font tile number at de to the ; equivalent offset within the full-width font tile graphics. -; d = $e and d = $f are treated differently +; if d == TX_FULLWIDTH6: get tile from the 80-tile font at the top of the graphics. +; if d == TX_FULLWIDTH5 or d == $0: get tile from first 256-tile font of the graphics. +; if d >= TX_FULLWIDTH1 and d <= TX_FULLWIDTH4: get tile from N+1th 256-tile font of the graphics. GetFullWidthFontTileOffset: ; 256d (0:256d) - ld bc, 40 tiles + ld bc, $50 tiles_1bpp ld a, d - cp $e - jr z, .asm_2580 - cp $f + cp TX_FULLWIDTH5 + jr z, .first_font + cp TX_FULLWIDTH6 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 +.first_font ld d, $0 .get_address ld l, e @@ -7805,9 +7812,9 @@ Func_2c37: ; 2c37 (0:2c37) 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 @@ -7838,11 +7845,11 @@ 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 ; 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. @@ -7853,7 +7860,11 @@ WaitForPlayerToAdvanceText: ; 2c77 (0:2c77) 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 @@ -7864,7 +7875,7 @@ Func_2c84: ; 2c84 (0:2c84) ld a, [wTextSpeed] ld c, a inc c - jr .asm_2cac + jr .go .nonzero_text_speed ld a, [wTextSpeed] cp 2 @@ -7877,7 +7888,7 @@ Func_2c84: ; 2c84 (0:2c84) push bc call DoFrame pop bc -.asm_2cac +.go dec c jr nz, .nonzero_text_speed .skip_delay @@ -7895,24 +7906,24 @@ Func_2c84: ; 2c84 (0:2c84) call BankswitchHome ret -; zero wWhichTextStruct, wWhichTxRam2 and wWhichTxRam3, and set hffaf to $f -; fill wTextStruct1 with $f, wFontWidth, hBankROM, and register bc for the text's pointer. +; zero wWhichTextStruct, wWhichTxRam2 and wWhichTxRam3, and set hDefaultFont to TX_FULLWIDTH6 +; fill wTextStruct1 with TX_FULLWIDTH6, wFontWidth, hBankROM, and register bc for the text's pointer. InitRegistersForPrintingText: ; 2cc8 (0:2cc8) xor a ld [wWhichTextStruct], a ld [wWhichTxRam2], a ld [wWhichTxRam3], a - ld a, $f - ld [hffaf], a + ld a, TX_FULLWIDTH6 + ld [hDefaultFont], a ; fallthrough -; fill the wTextStruct specified in wWhichTextStruct (0-3) with hffaf, +; fill the wTextStruct specified in wWhichTextStruct (0-3) with hDefaultFont, ; wFontWidth, hBankROM, and register bc for the text's pointer. WriteToTextStruct: ; 2cd7 (0:2cd7) push hl call GetPointerToTextStruct pop bc - ld a, [hffaf] + ld a, [hDefaultFont] ld [hli], a ld a, [wFontWidth] ld [hli], a @@ -7938,7 +7949,7 @@ WriteToTextStruct_MoveToNext: ; 2ceb (0:2ceb) ReadTextStruct: ; 2cf3 (0:2cf3) call GetPointerToTextStruct ld a, [hli] - ld [hffaf], a + ld [hDefaultFont], a ld a, [hli] ld [wFontWidth], a ld a, [hli] @@ -7990,11 +8001,12 @@ Func_2d43: ; 2d43 (0:2d43) call ReadTextStruct ld a, [hli] or a ; TX_END - jr z, .asm_2d79 - cp $5 - jr c, .asm_2d65 - cp $10 - jr nc, .asm_2d65 + jr z, .tx_end + cp TX_CTRL_BEGIN + jr c, .full_width_font + cp TX_CTRL_END + jr nc, .full_width_font + ; special character call Func_21f2 jr nc, .asm_2d74 cp TX_RAM1 @@ -8004,10 +8016,10 @@ Func_2d43: ; 2d43 (0:2d43) cp TX_RAM3 jr z, .tx_ram3 jr .asm_2d74 -.asm_2d65 - ld e, a - ld d, [hl] - call Func_2546 +.full_width_font + ld e, a ; first char + ld d, [hl] ; second char + call ProcessFullWidthFontCharacterPair jr nc, .asm_2d6d inc hl .asm_2d6d @@ -8018,21 +8030,22 @@ Func_2d43: ; 2d43 (0:2d43) call WriteToTextStruct or a ret -.asm_2d79 +.tx_end ld a, [wWhichTextStruct] or a - jr z, .asm_2d85 + jr z, .no_more_text + ; handle text struct in the above level dec a ld [wWhichTextStruct], a jr Func_2d43 -.asm_2d85 +.no_more_text call Func_230f scf ret .tx_ram2 call WriteToTextStruct_MoveToNext - ld a, $f - ld [hffaf], a + ld a, TX_FULLWIDTH6 + ld [hDefaultFont], a xor a ; FULL_WIDTH ld [wFontWidth], a ld de, wTxRam2 @@ -8058,11 +8071,11 @@ Func_2d43: ; 2d43 (0:2d43) jp Func_2d43 .tx_ram1 call WriteToTextStruct_MoveToNext - call CopyTurnDuelistName - ld a, [wcaa0] - cp $6 + call CopyPlayerNameOrTurnDuelistName + ld a, [wTextBuf] + cp TX_HALFWIDTH jr z, .asm_2dda - ld a, $7 + ld a, TX_HALF2FULL call Func_21f2 .asm_2dda call WriteToTextStruct @@ -8118,16 +8131,16 @@ GetTextOffsetFromTextID: ; 2ded (0:2ded) ret ; if [wFontWidth] == HALF_WIDTH: -; convert the number at hl to text (ascii) format and write it to wcaa0 +; convert the number at hl to text (ascii) format and write it to wTextBuf ; return c = 4 - leading_zeros ; if [wFontWidth] == FULL_WIDTH: -; convert the number at hl to TX_SYMBOL text format and write it to wcaa0 +; 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, [wFontWidth] or a ; FULL_WIDTH jp z, TwoByteNumberToTxSymbol_TrimLeadingZeros - ld de, wcaa0 + ld de, wTextBuf push de call TwoByteNumberToText pop hl @@ -8141,9 +8154,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 @@ -8156,7 +8170,8 @@ 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 @@ -8194,7 +8209,8 @@ PrintText: ; 2e41 (0:2e41) 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 diff --git a/src/hram.asm b/src/hram.asm index 2bf432f..aac2753 100644 --- a/src/hram.asm +++ b/src/hram.asm @@ -108,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 first 50 tiles of the full width font graphics as characters $0 to $50 +; (TX_FULLWIDTH6 mode), or map to the first 256-tile font located right after (TX_FULLWIDTH5 mode). +; the TX_FULLWIDTH5 and TX_FULLWIDTH6 control characters are used to set this address to said value. +; only these two values are admitted, as any other is interpreted as TX_FULLWIDTH5. +hDefaultFont:: ; ffaf ds $1 hffb0:: ; ffb0 diff --git a/src/macros/wram.asm b/src/macros/wram.asm index a904d87..fc32615 100644 --- a/src/macros/wram.asm +++ b/src/macros/wram.asm @@ -40,10 +40,10 @@ move_data_struct: MACRO ENDM text_struct: MACRO -\1Unknown:: ds 1 -\1FontWidth:: ds 1 -\1Address:: ds 2 -\1RomBank:: ds 1 +\1DefaultFont:: ds 1 +\1FontWidth:: ds 1 +\1Address:: ds 2 +\1RomBank:: ds 1 ENDM ; TODO: Figure out what the rest are for diff --git a/src/text/text4.asm b/src/text/text4.asm index dd9f326..f2a432e 100644 --- a/src/text/text4.asm +++ b/src/text/text4.asm @@ -120,7 +120,7 @@ Text040d: ; 40819 (10:4819) done Text040e: ; 409c6 (10:49c6) - text "Fight to the end, ", TX_START, TX_RAM1, "," + text "Fight to the end, ", TX_HALFWIDTH, TX_RAM1, "," line "and don't give up!" line "Mason Laboratory" line " Dr. Mason ;)" @@ -815,7 +815,7 @@ Text0467: ; 43221 (10:7221) 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 $07,$03,$63, TX_HALFWIDTH, "La di da la di da" line " La di da la di da..." line "Hey!" line "Move those feet!" @@ -878,7 +878,7 @@ 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 $07,$03,$63, TX_HALFWIDTH, "La di da la di da" line " La di da la di da..." line "... You dance weird!" done diff --git a/src/text/text6.asm b/src/text/text6.asm index a99de27..b60447c 100644 --- a/src/text/text6.asm +++ b/src/text/text6.asm @@ -263,7 +263,7 @@ Text054f: ; 48b5b (12:4b5b) Text0550: ; 48b73 (12:4b73) text "The Winner of this Challenge Cup " - line "is ", TX_START, TX_RAM1, "!!!" + line "is ", TX_HALFWIDTH, TX_RAM1, "!!!" done Text0551: ; 48b9f (12:4b9f) @@ -272,7 +272,7 @@ Text0551: ; 48b9f (12:4b9f) done Text0552: ; 48bb4 (12:4bb4) - text "Congratulations, ", TX_START, TX_RAM1, "!!!" + text "Congratulations, ", TX_HALFWIDTH, TX_RAM1, "!!!" done Text0553: ; 48bcc (12:4bcc) @@ -352,7 +352,7 @@ Text055e: ; 48fcb (12:4fcb) Text055f: ; 48ff9 (12:4ff9) text "You've really improved your " - line "game, ", TX_START, TX_RAM1, "." + line "game, ", TX_HALFWIDTH, TX_RAM1, "." line "Use my card to make it better!" done @@ -374,7 +374,7 @@ Text0561: ; 490c6 (12:50c6) Text0562: ; 4911e (12:511e) text TX_RAM1, ", That is not the way" line "to the Hall of Honor." - line "Hurry, ", TX_START, TX_RAM1, "! Go through to" + line "Hurry, ", TX_HALFWIDTH, TX_RAM1, "! Go through to" line "the Hall of Honor!" done @@ -543,7 +543,7 @@ Text057e: ; 49980 (12:5980) done Text057f: ; 4999c (12:599c) - text "Is your Deck ready, ", TX_START, TX_RAM1, "?" + text "Is your Deck ready, ", TX_HALFWIDTH, TX_RAM1, "?" done Text0580: ; 499b5 (12:59b5) @@ -682,7 +682,7 @@ Text0597: ; 49f7e (12:5f7e) done Text0598: ; 49fb5 (12:5fb5) - text "Is your Deck ready, ", TX_START, TX_RAM1, "?" + text "Is your Deck ready, ", TX_HALFWIDTH, TX_RAM1, "?" done Text0599: ; 49fce (12:5fce) @@ -786,7 +786,7 @@ Text05a8: ; 4a452 (12:6452) done Text05a9: ; 4a49a (12:649a) - text "Is your Deck ready, ", TX_START, TX_RAM1, "?" + text "Is your Deck ready, ", TX_HALFWIDTH, TX_RAM1, "?" done Text05aa: ; 4a4b3 (12:64b3) @@ -802,7 +802,7 @@ 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, ", TX_HALFWIDTH, TX_RAM1, "!" done Text05ad: ; 4a559 (12:6559) diff --git a/src/text/text9.asm b/src/text/text9.asm index b329238..6569d18 100644 --- a/src/text/text9.asm +++ b/src/text/text9.asm @@ -1092,7 +1092,7 @@ DefeatedFiveOpponentsText: ; 5728e (15:728e) Text07e7: ; 572ba (15:72ba) text TX_RAM1, " successfully defeated " - line "5 opponents ", TX_START, TX_RAM3, " time(s)!!!" + line "5 opponents ", TX_HALFWIDTH, TX_RAM3, " time(s)!!!" done ConsecutiveWinRecordIncreasedText: ; 572ee (15:72ee) diff --git a/src/wram.asm b/src/wram.asm index 0691a19..51ff973 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 -- cgit v1.2.3 From 8993df3b7e15782492ae74f146b44d79a265905c Mon Sep 17 00:00:00 2001 From: xCrystal Date: Wed, 11 Jul 2018 11:21:23 +0200 Subject: Split full width font graphics --- src/constants/text_constants.asm | 3 ++- src/engine/home.asm | 4 ++-- src/gfx.asm | 8 +++++++- src/gfx/fonts/full_width.t3.png | Bin 7972 -> 0 bytes src/gfx/fonts/full_width/0_0_katakana.png | Bin 0 -> 1430 bytes src/gfx/fonts/full_width/0_1_hiragana.png | Bin 0 -> 1622 bytes src/gfx/fonts/full_width/0_2_digits_kanji1.png | Bin 0 -> 3250 bytes src/gfx/fonts/full_width/1_kanji2.png | Bin 0 -> 5119 bytes src/gfx/fonts/full_width/2_kanji3.png | Bin 0 -> 5030 bytes src/gfx/fonts/full_width/3.png | Bin 0 -> 4201 bytes src/gfx/fonts/full_width/4.t3.png | Bin 0 -> 2279 bytes 11 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 src/gfx/fonts/full_width.t3.png create mode 100644 src/gfx/fonts/full_width/0_0_katakana.png create mode 100644 src/gfx/fonts/full_width/0_1_hiragana.png create mode 100644 src/gfx/fonts/full_width/0_2_digits_kanji1.png create mode 100644 src/gfx/fonts/full_width/1_kanji2.png create mode 100644 src/gfx/fonts/full_width/2_kanji3.png create mode 100644 src/gfx/fonts/full_width/3.png create mode 100644 src/gfx/fonts/full_width/4.t3.png (limited to 'src') diff --git a/src/constants/text_constants.asm b/src/constants/text_constants.asm index ed0938b..434a93a 100644 --- a/src/constants/text_constants.asm +++ b/src/constants/text_constants.asm @@ -22,7 +22,8 @@ TX_RAM3 EQU $0c ; usage: TX_FULLWIDTH*, char1, char2, ... ; db char1, char2, ... defaults to the value at hDefaultFont, unless -; wFontWidth was set to HALF_WIDTH by TX_HALFWIDTH (it is FULL_WIDTH by default) +; wFontWidth was set to HALF_WIDTH by TX_HALFWIDTH (it is FULL_WIDTH by default). +; hDefaultFont is TX_FULLWIDTH6 by default. TX_FULLWIDTH5 EQU $0e ; sets hDefaultFont to TX_FULLWIDTH5 TX_FULLWIDTH6 EQU $0f ; sets hDefaultFont to TX_FULLWIDTH6 diff --git a/src/engine/home.asm b/src/engine/home.asm index add74b6..3935919 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -6389,7 +6389,7 @@ Func_23c1: ; 23c1 (0:23c1) ld a, [hl] cp TX_HALFWIDTH jr nz, .asm_23cf - call Func_23d3 + call .asm_23d3 inc b srl b xor a @@ -6398,7 +6398,7 @@ Func_23c1: ; 23c1 (0:23c1) .asm_23cf xor a ; FULL_WIDTH ld [wFontWidth], a -Func_23d3: ; 23d3 (0:23d3) +.asm_23d3 push hl push de ld bc, $0000 diff --git a/src/gfx.asm b/src/gfx.asm index f26662c..c2e3489 100644 --- a/src/gfx.asm +++ b/src/gfx.asm @@ -3,7 +3,13 @@ INCLUDE "macros.asm" SECTION "Gfx 1", ROMX FullWidthFonts:: ; 74000 (1d:4000) -INCBIN "gfx/fonts/full_width.t3.1bpp" +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" HalfWidthFont:: ; 76668 (1d:6668) INCBIN "gfx/fonts/half_width.1bpp" diff --git a/src/gfx/fonts/full_width.t3.png b/src/gfx/fonts/full_width.t3.png deleted file mode 100644 index 5dc1fe8..0000000 Binary files a/src/gfx/fonts/full_width.t3.png and /dev/null differ diff --git a/src/gfx/fonts/full_width/0_0_katakana.png b/src/gfx/fonts/full_width/0_0_katakana.png new file mode 100644 index 0000000..70b6612 Binary files /dev/null and b/src/gfx/fonts/full_width/0_0_katakana.png differ diff --git a/src/gfx/fonts/full_width/0_1_hiragana.png b/src/gfx/fonts/full_width/0_1_hiragana.png new file mode 100644 index 0000000..3fda24a Binary files /dev/null and b/src/gfx/fonts/full_width/0_1_hiragana.png differ diff --git a/src/gfx/fonts/full_width/0_2_digits_kanji1.png b/src/gfx/fonts/full_width/0_2_digits_kanji1.png new file mode 100644 index 0000000..393d6b3 Binary files /dev/null and b/src/gfx/fonts/full_width/0_2_digits_kanji1.png differ diff --git a/src/gfx/fonts/full_width/1_kanji2.png b/src/gfx/fonts/full_width/1_kanji2.png new file mode 100644 index 0000000..0739069 Binary files /dev/null and b/src/gfx/fonts/full_width/1_kanji2.png differ diff --git a/src/gfx/fonts/full_width/2_kanji3.png b/src/gfx/fonts/full_width/2_kanji3.png new file mode 100644 index 0000000..7259463 Binary files /dev/null and b/src/gfx/fonts/full_width/2_kanji3.png differ diff --git a/src/gfx/fonts/full_width/3.png b/src/gfx/fonts/full_width/3.png new file mode 100644 index 0000000..6eccd3e Binary files /dev/null and b/src/gfx/fonts/full_width/3.png differ diff --git a/src/gfx/fonts/full_width/4.t3.png b/src/gfx/fonts/full_width/4.t3.png new file mode 100644 index 0000000..6ccef5d Binary files /dev/null and b/src/gfx/fonts/full_width/4.t3.png differ -- cgit v1.2.3 From 3921b82124e51a1d1054bf5339b15c00ed8298cf Mon Sep 17 00:00:00 2001 From: xCrystal Date: Wed, 11 Jul 2018 13:22:46 +0200 Subject: Create more text macros, rename/document some text engine things --- src/constants.asm | 1 + src/constants/charmaps.asm | 65 ++++++++++++++++++++++++ src/constants/text_constants.asm | 106 +++++++++++---------------------------- src/engine/home.asm | 74 +++++++++++++-------------- src/hram.asm | 12 ++--- src/macros.asm | 3 +- src/macros/text.asm | 4 ++ src/text/text1.asm | 16 +++--- 8 files changed, 151 insertions(+), 130 deletions(-) create mode 100644 src/constants/charmaps.asm create mode 100644 src/macros/text.asm (limited to 'src') 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..4731f7d --- /dev/null +++ b/src/constants/charmaps.asm @@ -0,0 +1,65 @@ +; control characters + charmap "", TX_RAM1 + charmap "", TX_RAM2 + charmap "", TX_RAM3 + +; ascii half-width font + charmap "é", "`" + charmap "♂", "$" + charmap "♀", "%" + charmap "”", "\"" + +; TX_SYMBOL (full-tile icons/symbols loaded at the beginning of v0Tiles2) +; 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 x ; $2d + txsymbol SLASH ; $2e + txsymbol CURSOR_D ; $2f + txsymbol PRIZE ; $30 diff --git a/src/constants/text_constants.asm b/src/constants/text_constants.asm index 434a93a..fbef11a 100644 --- a/src/constants/text_constants.asm +++ b/src/constants/text_constants.asm @@ -1,99 +1,49 @@ -TX_END EQU $00 +TX_END EQU $00 ; terminates the text -; TX_FULLWIDTH*, char1, TX_FULLWIDTH*, char2, ... +; 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 TX_CTRL_BEGIN EQU $05 -; TX_SYMBOL, char1, TX_SYMBOL, char2, ... +; usage: TX_SYMBOL, char1, TX_SYMBOL, char2, ... +; source: gfx/fonts/symbols.2bpp TX_SYMBOL EQU $05 -; TX_HALFWIDTH, char1, char2, ... +; usage: TX_HALFWIDTH, char1, char2, ... +; source: gfx/fonts/half_width.1bpp TX_HALFWIDTH EQU $06 ; sets wFontWidth to HALF_WIDTH -TX_HALF2FULL EQU $07 ; sets wFontWidth to FULL_WIDTH, and hDefaultFont to TX_FULLWIDTH6 -TX_RAM1 EQU $09 -TX_LINE EQU "\n" ; $0a -TX_RAM2 EQU $0b -TX_RAM3 EQU $0c +; usage: , TX_HALF2FULL, +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, ... -; db char1, char2, ... defaults to the value at hDefaultFont, unless +; 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). -; hDefaultFont is TX_FULLWIDTH6 by default. -TX_FULLWIDTH5 EQU $0e ; sets hDefaultFont to TX_FULLWIDTH5 -TX_FULLWIDTH6 EQU $0f ; sets hDefaultFont to TX_FULLWIDTH6 +; hJapaneseSyllabary is TX_KATAKANA by default. TX_CTRL_END EQU $10 -text EQUS "db TX_HALFWIDTH, " -line EQUS "db TX_LINE, " -done EQUS "db TX_END" - - charmap "é", "`" - charmap "♂", "$" - charmap "♀", "%" - charmap "”", "\"" - ; wFontWidth constants FULL_WIDTH EQU $0 HALF_WIDTH EQU $1 ; non-0 - -; 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_* - - 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 diff --git a/src/engine/home.asm b/src/engine/home.asm index 3935919..d68951b 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -6044,9 +6044,9 @@ Func_21c5: ; 21c5 (0:21c5) Func_21f2: ; 21f2 (0:21f2) or a ; TX_END jr z, .tx_end - cp TX_FULLWIDTH5 + cp TX_HIRAGANA jr z, .asm_2221 - cp TX_FULLWIDTH6 + cp TX_KATAKANA jr z, .asm_2221 cp "\n" jr z, .end_of_line @@ -6066,11 +6066,11 @@ Func_21f2: ; 21f2 (0:21f2) call Func_230f xor a ; FULL_WIDTH ld [wFontWidth], a - ld a, TX_FULLWIDTH6 - ldh [hDefaultFont], a + ld a, TX_KATAKANA + ldh [hJapaneseSyllabary], a ret .asm_2221 - ldh [hDefaultFont], a + ldh [hJapaneseSyllabary], a xor a ret .tx_symbol @@ -6151,14 +6151,14 @@ Func_2275: ; 2275 (0:2275) ; wFontWidth <- FULL_WIDTH ; hTextLineCurPos <- 0 ; wcd0b <- 0 -; hDefaultFont <- TX_FULLWIDTH6 +; hJapaneseSyllabary <- TX_KATAKANA Func_2298: ; 2298 (0:2298) xor a ; FULL_WIDTH ld [wFontWidth], a ldh [hTextLineCurPos], a ld [wcd0b], a - ld a, TX_FULLWIDTH6 - ldh [hDefaultFont], a + ld a, TX_KATAKANA + ldh [hJapaneseSyllabary], a ret ; Func_22ae @@ -6494,7 +6494,7 @@ TwoByteNumberToTxSymbol_TrimLeadingZeros: ; 245d (0:245d) ; generates a text tile and copies it to VRAM ; if wFontWidth == FULL_WIDTH - ; de = full-width font tile number (d = $e and d = $f are treated differently) + ; de = full-width font tile number ; if wFontWidth == HALF_WIDTH ; d = half-width character 1 (left) ; e = half-width character 2 (right) @@ -6577,8 +6577,8 @@ CopyHalfWidthCharacterToDE: ; 24fa (0:24fa) jr nz, .loop ret -; create, at wTextTileBuffer, a full-width font tile -; given its tile number within the full-width 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. CreateFullWidthFontTile_ConvertToTileDataAddress: ; 2510 (0:2510) push bc @@ -6608,8 +6608,8 @@ ConvertTileNumberToTileDataAddress: ; 2518 (0:2518) ld c, TILE_SIZE ret -; create, at wTextTileBuffer, a full-width font tile -; given its offset within the full-width font graphics in hl +; 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(FullWidthFonts); BANK(DuelGraphics); BANK(HalfWidthFont) call BankpushHome @@ -6629,7 +6629,7 @@ CreateFullWidthFontTile: ; 252e (0:252e) ret ; given two text characters at de, use the char at d to determine -; which type of TX_FULLWIDTH this pair of characters belongs to. +; which type of full width text this pair of characters belongs to. ; return carry if TX_FULLWIDTH1 to TX_FULLWIDTH4. ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) ld a, [wFontWidth] @@ -6639,11 +6639,11 @@ ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) cp TX_CTRL_END jr c, .continue_check cp $60 - jr nc, .first_font - ldh a, [hDefaultFont] - cp TX_FULLWIDTH6 - jr nz, .first_font - ld d, TX_FULLWIDTH6 + jr nc, .not_katakana + ldh a, [hJapaneseSyllabary] + cp TX_KATAKANA + jr nz, .not_katakana + ld d, TX_KATAKANA or a ret .half_width @@ -6652,8 +6652,8 @@ ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) .continue_check cp TX_CTRL_BEGIN jr c, .ath_font -.first_font -; TX_FULLWIDTH5 +.not_katakana +; 0_1_hiragana.1bpp (e < $60) or 0_2_digits_kanji1.1bpp (e >= $60) ld d, $0 or a ret @@ -6666,21 +6666,21 @@ ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) ; convert the full-width font tile number at de to the ; equivalent offset within the full-width font tile graphics. -; if d == TX_FULLWIDTH6: get tile from the 80-tile font at the top of the graphics. -; if d == TX_FULLWIDTH5 or d == $0: get tile from first 256-tile font of the graphics. -; if d >= TX_FULLWIDTH1 and d <= TX_FULLWIDTH4: get tile from N+1th 256-tile font of the 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 TX_FULLWIDTH5 - jr z, .first_font - cp TX_FULLWIDTH6 + cp TX_HIRAGANA + jr z, .hiragana + cp TX_KATAKANA jr nz, .get_address ld bc, $0 tiles ld a, e sub $10 ; the first $10 are control characters, but this font's graphics start at $0 ld e, a -.first_font +.hiragana ld d, $0 .get_address ld l, e @@ -7906,24 +7906,24 @@ PrintScrollableText: ; 2c84 (0:2c84) call BankswitchHome ret -; zero wWhichTextStruct, wWhichTxRam2 and wWhichTxRam3, and set hDefaultFont to TX_FULLWIDTH6 -; fill wTextStruct1 with TX_FULLWIDTH6, wFontWidth, hBankROM, and register bc for the text's pointer. +; zero wWhichTextStruct, wWhichTxRam2 and wWhichTxRam3, and set hJapaneseSyllabary to TX_KATAKANA +; fill wTextStruct1 with TX_KATAKANA, wFontWidth, hBankROM, and register bc for the text's pointer. InitRegistersForPrintingText: ; 2cc8 (0:2cc8) xor a ld [wWhichTextStruct], a ld [wWhichTxRam2], a ld [wWhichTxRam3], a - ld a, TX_FULLWIDTH6 - ld [hDefaultFont], a + ld a, TX_KATAKANA + ld [hJapaneseSyllabary], a ; fallthrough -; fill the wTextStruct specified in wWhichTextStruct (0-3) with hDefaultFont, +; fill the wTextStruct specified in wWhichTextStruct (0-3) with hJapaneseSyllabary, ; wFontWidth, hBankROM, and register bc for the text's pointer. WriteToTextStruct: ; 2cd7 (0:2cd7) push hl call GetPointerToTextStruct pop bc - ld a, [hDefaultFont] + ld a, [hJapaneseSyllabary] ld [hli], a ld a, [wFontWidth] ld [hli], a @@ -7949,7 +7949,7 @@ WriteToTextStruct_MoveToNext: ; 2ceb (0:2ceb) ReadTextStruct: ; 2cf3 (0:2cf3) call GetPointerToTextStruct ld a, [hli] - ld [hDefaultFont], a + ld [hJapaneseSyllabary], a ld a, [hli] ld [wFontWidth], a ld a, [hli] @@ -8044,8 +8044,8 @@ Func_2d43: ; 2d43 (0:2d43) ret .tx_ram2 call WriteToTextStruct_MoveToNext - ld a, TX_FULLWIDTH6 - ld [hDefaultFont], a + ld a, TX_KATAKANA + ld [hJapaneseSyllabary], a xor a ; FULL_WIDTH ld [wFontWidth], a ld de, wTxRam2 diff --git a/src/hram.asm b/src/hram.asm index aac2753..13c4756 100644 --- a/src/hram.asm +++ b/src/hram.asm @@ -108,12 +108,12 @@ hTextHorizontalAlign:: ; ffad hTextLineLength:: ; ffae ds $1 -; when printing text and no leading control character is specified, whether characters $10 to $60 -; map to the first 50 tiles of the full width font graphics as characters $0 to $50 -; (TX_FULLWIDTH6 mode), or map to the first 256-tile font located right after (TX_FULLWIDTH5 mode). -; the TX_FULLWIDTH5 and TX_FULLWIDTH6 control characters are used to set this address to said value. -; only these two values are admitted, as any other is interpreted as TX_FULLWIDTH5. -hDefaultFont:: ; 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/text.asm b/src/macros/text.asm new file mode 100644 index 0000000..24c5987 --- /dev/null +++ b/src/macros/text.asm @@ -0,0 +1,4 @@ +text EQUS "db TX_HALFWIDTH, " +textfw EQUS "db TX_FULLWIDTH3, " +line EQUS "db TX_LINE, " +done EQUS "db TX_END" diff --git a/src/text/text1.asm b/src/text/text1.asm index 4274caf..50210fb 100644 --- a/src/text/text1.asm +++ b/src/text/text1.asm @@ -55,7 +55,7 @@ PokemonText: ; 36378 (d:6378) done Text000f: ; 36382 (d:6382) - db $03,$4c + textfw $4c done LbsText: ; 36385 (d:6385) @@ -67,15 +67,15 @@ Text0011: ; 3638b (d:638b) done Text0012: ; 3638d (d:638d) - db $03,$52 + textfw $52 done Text0013: ; 36390 (d:6390) - db $03,$53 + textfw $53 done Text0014: ; 36393 (d:6393) - db $03,$54 + textfw $54 done Text0015: ; 36396 (d:6396) @@ -278,16 +278,16 @@ DiscardDescription: ; 36757 (d:6757) done Text0042: ; 367cc (d:67cc) - text TX_RAM1, " will draw ", TX_RAM3, " Prize(s)." + text " will draw Prize(s)." done Text0043: ; 367e5 (d:67e5) - text TX_RAM1, " drew ", TX_RAM3, " Prize(s)." + text " drew Prize(s)." done Text0044: ; 367f9 (d:67f9) - text TX_RAM1, " placed" - line "a ", TX_RAM2, "." + text " placed" + line "a ." done Text0045: ; 36808 (d:6808) -- cgit v1.2.3 From 04eb7f89a4ccce5c578f9e960749de4ba6a62366 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Wed, 11 Jul 2018 20:38:37 +0200 Subject: More text engine documentation --- src/engine/bank01.asm | 34 +++--- src/engine/bank02.asm | 10 +- src/engine/bank04.asm | 2 +- src/engine/bank06.asm | 2 +- src/engine/home.asm | 287 ++++++++++++++++++++++++++++---------------------- src/wram.asm | 11 +- 6 files changed, 193 insertions(+), 153 deletions(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index a67d672..7687865 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -1563,23 +1563,23 @@ Func_4a97: ; 4a97 (1:4a97) 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 GetTextSizeInHalfTiles 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 @@ -1662,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 @@ -1914,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 @@ -2149,13 +2149,13 @@ DrawDuelHUD: ; 5093 (1:5093) or a jr nz, .print_color_icon ld hl, wDefaultText - call Func_23c1 + call GetTextSizeInHalfTiles 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 @@ -2633,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] @@ -2644,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 @@ -3689,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 @@ -3709,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 @@ -3833,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 @@ -4443,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 ffcc1d8..1ebde42 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -670,7 +670,7 @@ Func_9253: ; 9253 (2:5253) ld de, wDefaultText call Func_92ad ld hl, wDefaultText - call Func_23c1 + call GetTextSizeInHalfTiles 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 GetTextSizeInHalfTiles 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/bank04.asm b/src/engine/bank04.asm index 256a2f6..28108fb 100644 --- a/src/engine/bank04.asm +++ b/src/engine/bank04.asm @@ -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 f952585..8e6f07d 100644 --- a/src/engine/bank06.asm +++ b/src/engine/bank06.asm @@ -38,7 +38,7 @@ _CopyCardNameAndLevel: ; 18000 (6:4000) pop hl push de ld e, c - call Func_23c1 + call GetTextSizeInHalfTiles add e ld c, a pop hl diff --git a/src/engine/home.asm b/src/engine/home.asm index d68951b..f4c7441 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -5162,8 +5162,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 @@ -5565,7 +5566,7 @@ DrawLabeledTextBox: ; 1e00 (0:1e00) pop hl call CopyText ld hl, wc000 + 3 - call Func_23c1 + call GetTextSizeInHalfTiles ld l, e ld h, d ; white tile after the text @@ -5598,9 +5599,9 @@ DrawLabeledTextBox: ; 1e00 (0:1e00) 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] @@ -6010,44 +6011,50 @@ DrawDuelBoxMessage: ; 2167 (0:2167) INCROM $2189, $21c5 -Func_21c5: ; 21c5 (0:21c5) +; 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 Func_2298 - jr .asm_21e8 -.asm_21cc + call InitTextFormat + jr .next_char +.char_loop cp TX_CTRL_BEGIN - jr c, .asm_21d9 + jr c, .character_pair cp TX_CTRL_END - jr nc, .asm_21d9 - call Func_21f2 - jr .asm_21e8 -.asm_21d9 - ld e, a - ld d, [hl] - call ProcessFullWidthFontCharacterPair - jr nc, .asm_21e1 + 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 -.asm_21e1 +.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) +; 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, .asm_2221 + jr z, .set_syllabary cp TX_KATAKANA - jr z, .asm_2221 + jr z, .set_syllabary cp "\n" jr z, .end_of_line cp TX_SYMBOL @@ -6063,13 +6070,13 @@ Func_21f2: ; 21f2 (0:21f2) ld [wFontWidth], a ret .tx_half2full - call Func_230f + call TerminateHalfWidthText xor a ; FULL_WIDTH ld [wFontWidth], a ld a, TX_KATAKANA ldh [hJapaneseSyllabary], a ret -.asm_2221 +.set_syllabary ldh [hJapaneseSyllabary], a xor a ret @@ -6078,17 +6085,17 @@ Func_21f2: ; 21f2 (0:21f2) push af ld a, HALF_WIDTH ld [wFontWidth], a - call Func_230f + call TerminateHalfWidthText pop af 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 .tx_end ldh a, [hTextLineLength] @@ -6101,7 +6108,7 @@ Func_21f2: ; 21f2 (0:21f2) xor a ret .end_of_line - call Func_230f + call TerminateHalfWidthText ld a, [wLineSeparation] or a call z, .next_line @@ -6132,7 +6139,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 @@ -6150,22 +6157,22 @@ Func_2275: ; 2275 (0:2275) ; wFontWidth <- FULL_WIDTH ; hTextLineCurPos <- 0 -; wcd0b <- 0 +; wHalfWidthPrintState <- 0 ; hJapaneseSyllabary <- TX_KATAKANA -Func_2298: ; 2298 (0:2298) +InitTextFormat: ; 2298 (0:2298) xor a ; FULL_WIDTH ld [wFontWidth], a ldh [hTextLineCurPos], a - ld [wcd0b], 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 +6180,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 +6194,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,13 +6249,16 @@ PlaceNextTextTile: ; 22f2 (0:22f2) inc [hl] ret -Func_230f: ; 230f (0:230f) +; 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 @@ -6310,22 +6318,25 @@ Func_2325: ; 2325 (0:2325) ; the result to head of list and return it. carry flag denotes success. Func_235e: ; 235e (0:235e) ld a, [wFontWidth] - or a ; - jr z, .asm_2376 ; if [wFontWidth] == HALF_WIDTH: - ; uppercase e if wUppercaseHalfWidthLetters != 0 + or a + jr z, .print call CaseHalfWidthLetter - ld a, [wcd0b] - ld d, a ; d ← [wcd0b] + ; 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, .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 + 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 @@ -6385,47 +6396,64 @@ CaseHalfWidthLetter: ; 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 half-tiles +; c = size of text in bytes +; a = -b +GetTextSizeInHalfTiles: ; 23c1 (0:23c1) ld a, [hl] cp TX_HALFWIDTH - jr nz, .asm_23cf - call .asm_23d3 + jr nz, .full_width + call GetTextSizeInTiles + ; return a = - ceil(b/2) inc b srl b xor a sub b ret -.asm_23cf +.full_width xor a ; FULL_WIDTH ld [wFontWidth], a -.asm_23d3 +; fallthrough + +GetTextSizeInTiles: ; 23d3 (0:23d3) +; iterates over text at hl until TX_END is found +; returns: +; b = size of text in tiles +; c = size of text in bytes +; a = -b 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 + 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_BEGIN - jr c, .asm_23ec + jr c, .character_pair cp TX_CTRL_END - jr nc, .asm_23ec + 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 ProcessFullWidthFontCharacterPair - 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 @@ -6628,10 +6656,10 @@ CreateFullWidthFontTile: ; 252e (0:252e) call BankpopHome ret -; given two text characters at de, use the char at d to determine -; which type of full width text this pair of characters belongs to. +; 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. -ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) +ClassifyTextCharacterPair: ; 2546 (0:2546) ld a, [wFontWidth] or a ; FULL_WIDTH jr nz, .half_width @@ -6647,6 +6675,7 @@ ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) or a ret .half_width +; in half width mode, the first character goes in e, so leave them like that or a ret .continue_check @@ -6659,6 +6688,7 @@ ProcessFullWidthFontCharacterPair: ; 2546 (0:2546) ret .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 @@ -7062,11 +7092,11 @@ PrintCardListItems: ; 2799 (0:2799) 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 @@ -7462,13 +7492,13 @@ 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 @@ -7478,7 +7508,7 @@ DrawWideTextBox_PrintText: ; 2a59 (0:2a59) ld a, 19 lb de, 1, 14 call AdjustCoordinatesForBGScroll - call Func_22a6 + call InitTextPrintingInTextbox call EnableLCD pop hl jp PrintText @@ -7769,7 +7799,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 @@ -7778,11 +7808,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] @@ -7794,7 +7824,7 @@ Func_2c29: ; 2c29 (0:2c29) ldh a, [hBankROM] push af call GetTextOffsetFromTextID - call Func_21c5 + call ProcessText pop af call BankswitchHome ret @@ -7892,7 +7922,7 @@ PrintScrollableText: ; 2c84 (0:2c84) dec c jr nz, .nonzero_text_speed .skip_delay - call Func_2d43 + call ProcessTextStruct jr c, .asm_2cc3 ld a, [wCurTextLine] cp 3 @@ -7982,51 +8012,54 @@ 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) +; reads the incoming character from the current wTextStruct and processes it +; then updates the current wTextStruct to point to the next character. +; a TX_RAM command causes a switch to a wTextStruct in the level below, and a TX_END +; command terminates the text unless there is a pending wTextStruct in the above level. +ProcessTextStruct: ; 2d43 (0:2d43) call ReadTextStruct ld a, [hli] or a ; TX_END jr z, .tx_end cp TX_CTRL_BEGIN - jr c, .full_width_font + jr c, .character_pair cp TX_CTRL_END - jr nc, .full_width_font - ; special character - call Func_21f2 - jr nc, .asm_2d74 + 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 -.full_width_font + jr .processed_char +.character_pair ld e, a ; first char ld d, [hl] ; second char - call ProcessFullWidthFontCharacterPair - jr nc, .asm_2d6d + 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 ProcessSpecialTextCharacter +.processed_char call WriteToTextStruct or a ret @@ -8037,9 +8070,9 @@ Func_2d43: ; 2d43 (0:2d43) ; handle text struct in the above level dec a ld [wWhichTextStruct], a - jr Func_2d43 + jr ProcessTextStruct .no_more_text - call Func_230f + call TerminateHalfWidthText scf ret .tx_ram2 @@ -8053,14 +8086,14 @@ Func_2d43: ; 2d43 (0:2d43) call HandleTxRam2Or3 ld a, l or h - jr z, .asm_2dab + jr z, .empty call GetTextOffsetFromTextID call WriteToTextStruct - jr Func_2d43 -.asm_2dab + jr ProcessTextStruct +.empty ld hl, wDefaultText call WriteToTextStruct - jr Func_2d43 + jr ProcessTextStruct .tx_ram3 call WriteToTextStruct_MoveToNext ld de, wTxRam3 @@ -8068,18 +8101,18 @@ Func_2d43: ; 2d43 (0:2d43) call HandleTxRam2Or3 call TwoByteNumberToText_CountLeadingZeros call WriteToTextStruct - jp Func_2d43 + jp ProcessTextStruct .tx_ram1 call WriteToTextStruct_MoveToNext call CopyPlayerNameOrTurnDuelistName ld a, [wTextBuf] cp TX_HALFWIDTH - jr z, .asm_2dda + jr z, .tx_halfwidth ld a, TX_HALF2FULL - call Func_21f2 -.asm_2dda + call ProcessSpecialTextCharacter +.tx_halfwidth call WriteToTextStruct - jp Func_2d43 + jp ProcessTextStruct ; input: ; de: wTxRam2 or wTxRam3 @@ -8205,7 +8238,7 @@ PrintText: ; 2e41 (0:2e41) dec a jr nz, .text_delay_loop .skip_delay - call Func_2d43 + call ProcessTextStruct jr nc, .next_tile_loop ret @@ -8217,7 +8250,7 @@ PrintTextNoDelay: ; 2e76 (0:2e76) call GetTextOffsetFromTextID call InitRegistersForPrintingText .next_tile_loop - call Func_2d43 + call ProcessTextStruct jr nc, .next_tile_loop pop af call BankswitchHome diff --git a/src/wram.asm b/src/wram.asm index 51ff973..17736b8 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -948,8 +948,15 @@ wCurTextLine:: ; cd09 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 + +wcd0c:: ; cd0c + ds $1 ; half-width font letters become uppercase if non-0, lowercase if 0 wUppercaseHalfWidthLetters:: ; cd0d -- cgit v1.2.3 From 0dca8d215f0a0c8e6a3438b84d8dc714da84d0e3 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Thu, 12 Jul 2018 17:44:48 +0200 Subject: Create charmaps and update text/ --- src/constants/charmaps.asm | 194 ++++++++++++++++++++++++- src/macros/data.asm | 4 + src/macros/text.asm | 54 ++++++- src/text/text1.asm | 128 +++++++++-------- src/text/text12.asm | 6 +- src/text/text13.asm | 2 +- src/text/text2.asm | 346 ++++++++++++++++++++++++++++++++------------- src/text/text3.asm | 89 +++++++----- src/text/text4.asm | 66 +++++---- src/text/text5.asm | 22 +-- src/text/text6.asm | 122 ++++++++-------- src/text/text7.asm | 48 +++---- src/text/text8.asm | 56 ++++---- src/text/text9.asm | 86 ++++++----- 14 files changed, 833 insertions(+), 390 deletions(-) (limited to 'src') diff --git a/src/constants/charmaps.asm b/src/constants/charmaps.asm index 4731f7d..8a36eb1 100644 --- a/src/constants/charmaps.asm +++ b/src/constants/charmaps.asm @@ -9,7 +9,197 @@ charmap "♀", "%" charmap "”", "\"" -; TX_SYMBOL (full-tile icons/symbols loaded at the beginning of v0Tiles2) +; 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, "o", $61 + fwcharmap 3, "^", $62 + fwcharmap 3, "♪", $63 + fwcharmap 3, "'", $7a + fwcharmap 3, "”", $7b + +; 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-$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-$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 + +; TX_SYMBOL ; TODO: If user-defined functions ever become a thing a symbol(*) syntax ; would probably be preferred over SYM_* charmap "<", TX_SYMBOL @@ -59,7 +249,7 @@ txsymbol DOT ; $2a txsymbol PLUS ; $2b txsymbol MINUS ; $2c - txsymbol x ; $2d + txsymbol CROSS ; $2d txsymbol SLASH ; $2e txsymbol CURSOR_D ; $2f txsymbol PRIZE ; $30 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 index 24c5987..4a4211a 100644 --- a/src/macros/text.asm +++ b/src/macros/text.asm @@ -1,4 +1,56 @@ text EQUS "db TX_HALFWIDTH, " -textfw EQUS "db TX_FULLWIDTH3, " 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 + db STRCAT("FW0_", \1) + shift + endr +ENDM + +textfw1: MACRO + rept _NARG + db TX_FULLWIDTH1, STRCAT("FW1_", \1) + shift + endr +ENDM + +textfw2: MACRO + rept _NARG + db TX_FULLWIDTH2, STRCAT("FW2_", \1) + shift + endr +ENDM + +textfw3: MACRO + rept _NARG + db TX_FULLWIDTH3, STRCAT("FW3_", \1) + shift + endr +ENDM + +textfw4: MACRO + rept _NARG + db TX_FULLWIDTH2, STRCAT("FW4_", \1) + shift + endr +ENDM diff --git a/src/text/text1.asm b/src/text/text1.asm index 50210fb..ce5da88 100644 --- a/src/text/text1.asm +++ b/src/text/text1.asm @@ -39,7 +39,9 @@ PKMNPWRText: ; 36356 (d:6356) done Text000b: ; 36360 (d:6360) - db $56,$19,$33,$3d,$16,$78,$4c + db $56 + textfw0 "ケ", "モ", "ン", "カ", "-(2)" + db $4c done LengthText: ; 36368 (d:6368) @@ -55,7 +57,7 @@ PokemonText: ; 36378 (d:6378) done Text000f: ; 36382 (d:6382) - textfw $4c + textfw3 "m" done LbsText: ; 36385 (d:6385) @@ -63,19 +65,19 @@ LbsText: ; 36385 (d:6385) done Text0011: ; 3638b (d:638b) - db $70 + textfw0 " " done Text0012: ; 3638d (d:638d) - textfw $52 + textfw3 "●" done Text0013: ; 36390 (d:6390) - textfw $53 + textfw3 "◆" done Text0014: ; 36393 (d:6393) - textfw $54 + textfw3 "★" done Text0015: ; 36396 (d:6396) @@ -147,27 +149,27 @@ UnableDueToParalysisText: ; 364a1 (d:64a1) done Received10DamageDueToPoisonText: ; 364be (d:64be) - text TX_RAM2, " received" + text " received" line "10 damage due to Poison." done Received20DamageDueToPoisonText: ; 364e3 (d:64e3) - text TX_RAM2, " received" + text " received" line "20 damage due to Double Poison." done IsStillAsleepText: ; 3650f (d:650f) - text TX_RAM2, " is" + text " is" line "still Asleep." done IsCuredOfSleepText: ; 36523 (d:6523) - text TX_RAM2, " is" + text " is" line "cured of Sleep." done IsCuredOfParalysisText: ; 36539 (d:6539) - text TX_RAM2, " is" + text " is" line "cured of Paralysis." done @@ -204,7 +206,7 @@ Text0032: ; 365b6 (d:65b6) done UsedText: ; 365be (d:65be) - text "Used ", TX_RAM2, "." + text "Used ." done Text0034: ; 365c7 (d:65c7) @@ -212,38 +214,38 @@ Text0034: ; 365c7 (d:65c7) done PokemonsAttackText: ; 365d8 (d:65d8) - text TX_RAM2, "'s" + text "'s" line "" - text TX_RAM2, "!" + text "!" done Text0036: ; 365e1 (d:65e1) - text TX_RAM2, " received" - line TX_RAM3, " damage due to Resistance!" + text " received" + line " damage due to Resistance!" done Text0037: ; 36609 (d:6609) - text TX_RAM2, " received" - line TX_RAM3, " damage due to Weakness!" + text " received" + line " damage due to Weakness!" done Text0038: ; 3662f (d:662f) - text TX_RAM2, " received" - line TX_RAM3, " damage due to Weakness!" + text " received" + line " damage due to Weakness!" done Text0039: ; 36655 (d:6655) - text TX_RAM2, " did not" + text " did not" line "receive damage due to Resistance." done Text003a: ; 36682 (d:6682) - text TX_RAM2, " took" - line TX_RAM3, " damage." + text " took" + line " damage." done Text003b: ; 36694 (d:6694) - text TX_RAM2, " did not" + text " did not" line "receive damage!" done @@ -387,18 +389,18 @@ Text0059: ; 369dc (d:69dc) done RetreatedToTheBenchText: ; 36a19 (d:6a19) - text TX_RAM2, "" + text "" line "Retreated to the Bench." done RetreatWasUnsuccessfulText: ; 36a34 (d:6a34) - text TX_RAM2, "'s" + text "'s" line "Retreat was unsuccessful." done WillUseThePokemonPowerText: ; 36a53 (d:6a53) - text TX_RAM2, " will use the" - line "Pokémon Power ", TX_RAM2, "." + text " will use the" + line "Pokémon Power ." done FinishedTurnWithoutAttackingText: ; 36a74 (d:6a74) @@ -407,31 +409,31 @@ FinishedTurnWithoutAttackingText: ; 36a74 (d:6a74) done Text005e: ; 36a9a (d:6a9a) - text TX_RAM1, "'s Turn." + text "'s Turn." done Text005f: ; 36aa5 (d:6aa5) - text "Attached ", TX_RAM2, "" - line "to ", TX_RAM2, "." + text "Attached " + line "to ." done Text0060: ; 36ab7 (d:6ab7) - text TX_RAM2, " evolved" - line "into ", TX_RAM2, "." + text " evolved" + line "into ." done PlacedOnTheBenchText: ; 36aca (d:6aca) - text "Placed ", TX_RAM2, "" + text "Placed " line "on the Bench." done PlacedInTheArenaText: ; 36ae2 (d:6ae2) - text TX_RAM2, "" + text "" line "was placed in the Arena." done ShufflesTheDeckText: ; 36afe (d:6afe) - text TX_RAM1, " shuffles the Deck." + text " shuffles the Deck." done Text0064: ; 36b14 (d:6b14) @@ -449,12 +451,12 @@ Text0066: ; 36b7a (d:6b7a) done Text0067: ; 36b9a (d:6b9a) - text TX_RAM1, "" + text "" line "drew 7 cards." done DeckHasXCardsText: ; 36bab (d:6bab) - text TX_RAM1, "'s deck has ", TX_RAM3, " cards." + text "'s deck has cards." done ChooseBasicPkmnToPlaceInArenaText: ; 36bc2 (d:6bc2) @@ -464,7 +466,7 @@ ChooseBasicPkmnToPlaceInArenaText: ; 36bc2 (d:6bc2) Text006a: ; 36bf1 (d:6bf1) text "There are no Basic Pokémon" - line "in ", TX_RAM1, "'s hand." + line "in 's hand." done NeitherPlayerHasBasicPkmnText: ; 36c1a (d:6c1a) @@ -493,7 +495,7 @@ Text006f: ; 36ce1 (d:6ce1) done YouDrewText: ; 36cfd (d:6cfd) - text "You drew ", TX_RAM2, "." + text "You drew ." done Text0071: ; 36d0a (d:6d0a) @@ -506,13 +508,13 @@ PlacingThePrizesText: ; 36d28 (d:6d28) PleasePlacePrizesText: ; 36d3f (d:6d3f) text "Please place" - line TX_RAM3, " Prizes." + line " Prizes." done IfHeadPlayerPlaysFirstText: ; 36d57 (d:6d57) text "If heads," line "" - text TX_RAM2, " plays first." + text " plays first." done CoinTossToDetermineWhoFirstText: ; 36d72 (d:6d72) @@ -525,17 +527,17 @@ DecisionText: ; 36da4 (d:6da4) done DuelWasADrawText: ; 36db1 (d:6db1) - text "The Duel with ", TX_RAM1, "" + text "The Duel with " line "was a Draw!" done WonDuelText: ; 36dce (d:6dce) - text "You won the Duel with ", TX_RAM1, "!" + text "You won the Duel with !" done LostDuelText: ; 36de8 (d:6de8) text "You lost the Duel" - line "with ", TX_RAM1, "..." + line "with ..." done StartSuddenDeathMatchText: ; 36e05 (d:6e05) @@ -562,22 +564,22 @@ Text007e: ; 36e63 (d:6e63) done Text007f: ; 36e6a (d:6e6a) - text TX_RAM1, " took" + text " 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 's Play Area!" done WasKnockedOutText: ; 36eaa (d:6eaa) - text TX_RAM2, " was" + text " was" line "Knocked Out!" done HavePokemonPowerText: ; 36ebe (d:6ebe) - text TX_RAM2, " have" + text " have" line "Pokémon Power." done @@ -602,15 +604,18 @@ Text0086: ; 36f31 (d:6f31) done Text0087: ; 36f43 (d:6f43) - db $03,$31,$0c,$03,$42,$0c + textfw3 "B" + db "" + textfw3 "S" + db "" done DuelistIsThinkingText: ; 36f4a (d:6f4a) - text TX_RAM1, " is thinking." + text " 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 +708,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 +788,15 @@ Text00a6: ; 3737b (d:737b) done DuelistHandText: ; 37392 (d:7392) - text TX_RAM1, "'s Hand" + text "'s Hand" done DuelistPlayAreaText: ; 3739c (d:739c) - text TX_RAM1, "'s Play Area" + text "'s Play Area" done DuelistDeckText: ; 373ab (d:73ab) - text TX_RAM1, "'s Deck" + text "'s Deck" done PleaseSelectHandText: ; 373b5 (d:73b5) @@ -892,7 +900,7 @@ Text00be: ; 37715 (d:7715) done EnergyCardsRequiredToRetreatText: ; 37758 (d:7758) - text TX_RAM3, " Energy cards" + text " Energy cards" line "are required to Retreat." done @@ -1108,7 +1116,7 @@ Text00ec: ; 37e73 (d:7e73) done Text00ed: ; 37e92 (d:7e92) - text "If Tails, ", TX_RAM3, " damage" + text "If Tails, damage" line "to yourself, too." done @@ -1138,10 +1146,10 @@ Text00f2: ; 37f9a (d:7f9a) Text00f3: ; 37fa8 (d:7fa8) text "Damage check!" - line "If Heads, +", TX_RAM3, " damage!!" + line "If Heads, + damage!!" done Text00f4: ; 37fcd (d:7fcd) text "Damage check!" - line "If Heads, x ", TX_RAM3, " damage!!" + line "If Heads, x 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..5705f38 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 "'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 " was Knocked Out" line "due to the effects of Destiny Bond." done ReceivesDamageDueToStrikesBackText: ; 38320 (e:4320) - text TX_RAM2, " receives ", TX_RAM3, " damage" + text " receives 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 "" + line "metamorphs to ." 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 " 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 " to ." done Text0115: ; 386af (e:46af) text "Changed the Resistance of" line "" - text TX_RAM2, " to ", TX_RAM2, "." + text " to ." done Text0116: ; 386d3 (e:46d3) text "Changed the color of" line "" - text TX_RAM2, " to ", TX_RAM2, "." + text " to ." 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 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 " 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 " 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 " and all attached" line "cards were returned to the Hand." done Text0148: ; 39392 (e:5392) - text TX_RAM2, " was chosen" + text " 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 "'s" + line " was unsuccessful." done Text014b: ; 393ff (e:53ff) text "There was no effect" - line "from ", TX_RAM2, "." + line "from ." done Text014c: ; 3941c (e:541c) - text "The Energy card from ", TX_RAM1, "'s" + text "The Energy card from 's" line "Play Area was moved." done Text014d: ; 3944b (e:544b) - text TX_RAM1, " drew" - line TX_RAM3, " Fire Energy from the Hand." + text " drew" + line " 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 '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 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 " 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 " and all attached" line "cards were returned to the Deck." done Text016c: ; 399bc (e:59bc) - text TX_RAM2, " was returned" + text " was returned" line "from the Arena to the Hand." done Text016d: ; 399e8 (e:59e8) - text TX_RAM2, " was returned" + text " was returned" line "from the Bench to the Hand." done Text016e: ; 39a14 (e:5a14) - text TX_RAM2, " was returned" + text " was returned" line "to the Deck." done Text016f: ; 39a31 (e:5a31) - text TX_RAM2, " was placed" + text " 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 cards" + line "from 's Deck." done Text0175: ; 39adb (e:5adb) - text "Discarded ", TX_RAM2, "" + text "Discarded " line "from the Hand." done @@ -694,23 +694,23 @@ Text0176: ; 39af7 (e:5af7) done Text0177: ; 39b03 (e:5b03) - text TX_RAM2, "" + text "" line "came to the Bench!" done Text0178: ; 39b19 (e:5b19) - text TX_RAM1, " has" + text " has" line "no cards in Hand!" done Text0179: ; 39b32 (e:5b32) - text TX_RAM2, " healed" - line TX_RAM3, " damage!" + text " healed" + line " damage!" done Text017a: ; 39b46 (e:5b46) - text TX_RAM2, " devolved" - line "to ", TX_RAM2, "!" + text " devolved" + line "to !" 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 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 '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 -Prize Duel" + line "with ." done Text018a: ; 39d39 (e:5d39) @@ -805,32 +805,32 @@ Text018d: ; 39dcc (e:5dcc) done Text018e: ; 39e02 (e:5e02) - text "Received ", TX_RAM2, "" + text "Received " line "through Card Pop!" done ReceivedCardText: ; 39e20 (e:5e20) - text TX_RAM1, " received" - line "a ", TX_RAM2, "!" + text " received" + line "a !" done ReceivedPromotionalCardText: ; 39e31 (e:5e31) - text TX_RAM1, " received a Promotional" - line "card ", TX_RAM2, "!" + text " received a Promotional" + line "card !" done ReceivedLegendaryCardText: ; 39e53 (e:5e53) - text TX_RAM1, " received the Legendary" - line "card ", TX_RAM2, "!" + text " received the Legendary" + line "card !" done ReceivedPromotionalFlyingPikachuText: ; 39e75 (e:5e75) - text TX_RAM1, " received a Promotinal" + text " received a Promotinal" line "card Flyin' Pikachu!" done ReceivedPromotionalSurfingPikachuText: ; 39ea3 (e:5ea3) - text TX_RAM1, " received a Promotional" + text " 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 ." done Text0199: ; 39f59 (e:5f59) - text "Received from ", TX_RAM1, "." + text "Received from ." 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 " 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 "'s turn ", TX_RAM3 done Text01dc: ; 3b40a (e:740a) @@ -1483,19 +1484,27 @@ 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" + textfw0 " " + textfw3 "T", "O", + textfw0 " " + textfw3 "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" + textfw0 " " + textfw3 "T", "O", + textfw0 " " + textfw3 "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 +1520,17 @@ Text0219: ; 3b7e8 (e:77e8) done Text021a: ; 3b7ee (e:77ee) - db $0e,$2b,$37,$3e,$25 + hiragana "ひ", "ら" + db $3e + textfw0 "ナ" 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 +1542,171 @@ 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 "“" + 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 "“" + 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" + textfw0 " " + textfw3 "B" + textfw0 " " + textfw3 "C" + textfw0 " " + textfw3 "D" + textfw0 " " + textfw3 "E" + textfw0 " " + textfw3 "F" + textfw0 " " + textfw3 "G" + textfw0 " " + textfw3 "H" + textfw0 " " + textfw3 "I" + line "" + textfw3 "J" + textfw0 " " + textfw3 "K" + textfw0 " " + textfw3 "L" + textfw0 " " + textfw3 "M" + textfw0 " " + textfw3 "N" + textfw0 " " + textfw3 "O" + textfw0 " " + textfw3 "P" + textfw0 " " + textfw3 "Q" + textfw0 " " + textfw3 "R" + line "" + textfw3 "S" + textfw0 " " + textfw3 "T" + textfw0 " " + textfw3 "U" + textfw0 " " + textfw3 "V" + textfw0 " " + textfw3 "W" + textfw0 " " + textfw3 "X" + textfw0 " " + textfw3 "Y" + textfw0 " " + textfw3 "Z" + textfw0 " ", "!" + line "" + textfw0 "?", " " + textfw3 "&" + textfw0 " ", "+", " ", "-", " ", "·", " ", "0", " ", "1", " ", "2", " ", "3" + line "" + textfw0 "4", " ", "5", " ", "6", " ", "7", " ", "8", " ", "9", " " + db "" + textfw0 " " + db "" + textfw0 " ", " " + 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" + textfw0 " " + textfw3 "B" + textfw0 " " + textfw3 "C" + textfw0 " " + textfw3 "D" + textfw0 " " + textfw3 "E" + textfw0 " " + textfw3 "F" + textfw0 " " + textfw3 "G" + textfw0 " " + textfw3 "H" + textfw0 " " + textfw3 "I" + line "" + textfw3 "J" + textfw0 " " + textfw3 "K" + textfw0 " " + textfw3 "L" + textfw0 " " + textfw3 "M" + textfw0 " " + textfw3 "N" + textfw0 " " + textfw3 "O" + textfw0 " " + textfw3 "P" + textfw0 " " + textfw3 "Q" + textfw0 " " + textfw3 "R" + line "" + textfw3 "S" + textfw0 " " + textfw3 "T" + textfw0 " " + textfw3 "U" + textfw0 " " + textfw3 "V" + textfw0 " " + textfw3 "W" + textfw0 " " + textfw3 "X" + textfw0 " " + textfw3 "Y" + textfw0 " " + textfw3 "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 +1738,24 @@ Text0229: ; 3ba51 (e:7a51) done ChosenAsDuelingDeckText: ; 3ba55 (e:7a55) - text TX_RAM2, " was" + text " 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 +1858,7 @@ Text0246: ; 3bc85 (e:7c85) done Text0247: ; 3bc9e (e:7c9e) - text TX_RAM1, "'s Play Area" + text "'s Play Area" done Text0248: ; 3bcad (e:7cad) @@ -1747,15 +1890,16 @@ Text024e: ; 3bd20 (e:7d20) done Text024f: ; 3bd26 (e:7d26) - text TX_RAM1, "'s Hand" + text "'s Hand" done Text0250: ; 3bd30 (e:7d30) - text TX_RAM1, "'s Discard Pile" + text "'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 +1931,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 +1939,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 +1974,7 @@ Text0262: ; 3be7d (e:7e7d) Text0263: ; 3be82 (e:7e82) text "Saved the configuration for" line "" - text TX_RAM2, "! " + text "! " done Text0264: ; 3bea4 (e:7ea4) @@ -1849,7 +1993,7 @@ Text0266: ; 3bee7 (e:7ee7) Text0267: ; 3bf06 (e:7f06) text "Deleted the configuration for" line "" - text TX_RAM2, "." + text "." done Text0268: ; 3bf29 (e:7f29) @@ -1863,7 +2007,7 @@ Text0269: ; 3bf46 (e:7f46) Text026a: ; 3bf63 (e:7f63) text "Dismantled" line "" - text TX_RAM2, "." + text "." done Text026b: ; 3bf73 (e:7f73) diff --git a/src/text/text3.asm b/src/text/text3.asm index 0617435..f705781 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 "" 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 !" 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 !" 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 " @@ -1069,15 +1070,19 @@ Text033f: ; 3e85f (f:685f) 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 "'s diary" done Text0343: ; 3e89d (f:689d) @@ -1089,7 +1094,7 @@ Text0344: ; 3e8b1 (f:68b1) done Text0345: ; 3e8d2 (f:68d2) - text TX_RAM1, "" + text "" 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 []" + line "SELECT []" 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 "" line "turned the PC on!" done TurnedPCOffText: ; 3ea7e (f:6a7e) - text TX_RAM1, "" + text "" 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 " done Text035a: ; 3eb3e (f:6b3e) @@ -1201,7 +1206,7 @@ Text035b: ; 3eb62 (f:6b62) done Text035c: ; 3eb88 (f:6b88) - db $70,$70,$70,$70,$70 + 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 " " + line " Master Medals Won " + half2full + db "" + 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 " is crazy about Pokémon" line "and Pokémon card collecting!" line "One day," - line TX_RAM1, " heard a rumor:" + line " 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 " 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 Prizes Duel" + line "LOSE with ()" done Text0386: ; 3f2f1 (f:72f1) - text " Use ", TX_RAM3, "'s Deck" + text " Use 's Deck" done ReceivedBoosterPackText: ; 3f308 (f:7308) - text TX_RAM1, " received a Booster" - line "Pack: ", TX_RAM2, "." + text " received a Booster" + line "Pack: ." done AndAnotherBoosterPackText: ; 3f327 (f:7327) text "...And another Booster Pack:" - line TX_RAM2, "." + line "." done CheckedCardsInBoosterPackText: ; 3f348 (f:7348) - text TX_RAM1, " checked the cards" + text " 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 "" + line "Won the 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 " ", TX_RAM2 done Text0396: ; 3f4f9 (f:74f9) - text TX_RAM2, " Deck" + text " Deck" done Text0397: ; 3f501 (f:7501) @@ -1935,7 +1950,7 @@ Text03fd: ; 3f9d0 (f:79d0) done Text03fe: ; 3f9f2 (f:79f2) - text "Hi, ", TX_RAM1, "." + text "Hi, ." line "How can I help you?" done @@ -1958,7 +1973,7 @@ Text0400: ; 3fa32 (f:7a32) done Text0401: ; 3faaa (f:7aaa) - text TX_RAM1, "," + text "," 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 "," 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 ", 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 f2a432e..74bec46 100644 --- a/src/text/text4.asm +++ b/src/text/text4.asm @@ -1,5 +1,5 @@ Text0405: ; 40000 (10:4000) - text TX_RAM1, "," + text "," 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 "! 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 "," 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 "!" 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, ?" 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_HALFWIDTH, TX_RAM1, "," + text "Fight to the end, " + text "," 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, ?" 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 "!" line "Mason Laboratory" line " Dr. Mason ;)" done @@ -226,7 +227,7 @@ Text0414: ; 40fca (10:4fca) done Text0415: ; 4123d (10:523d) - text TX_RAM1, "," + text "," 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 "," 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 "!!!" 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, !" 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, !" 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 " traded a Lapras" line "for an Arcanine!" done Text0425: ; 41d4e (10:5d4e) - text "Thanks, ", TX_RAM1, "!" + text "Thanks, !" 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 ?" 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 ?" 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, ." 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 "?" 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 ?" 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 " 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 ?" 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 !" 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 ." 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 " 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_HALFWIDTH, "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_HALFWIDTH, "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, ." 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, !" 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, ." 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 - 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 , 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, ." 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, ." 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 - 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 ?" line "Late as always!" done @@ -1017,6 +1017,6 @@ Text0522: ; 47e73 (11:7e73) done Text0523: ; 47f08 (11:7f08) - text "Hey, ", TX_RAM1, "!" + text "Hey, !" line "What are you doing here?" done diff --git a/src/text/text6.asm b/src/text/text6.asm index b60447c..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, is still" line "a contender!" done Text0534: ; 485c6 (12:45c6) - text TX_RAM1, " is the new challenger!" + text " 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 !!" line "" - text TX_RAM2, " has defeated 2 opponents!" + text " 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, ." line "Have a safe trip home!" done Text0538: ; 4869b (12:469b) - text "The Winner is ", TX_RAM2, "!!!" + text "The Winner is !!!" line "" - text TX_RAM2, " has defeated 1 opponent!" + text " 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 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 !" line "" - text TX_RAM1, " has defeated" + text " has defeated" line "1 opponent!!!" done Text053d: ; 4885c (12:485c) - text "Way to go, ", TX_RAM1, "!" + text "Way to go, !" 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, ." 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 "!" done Text0541: ; 48922 (12:4922) text "The third opponent is" line "" - text TX_RAM2, "!" + text "!" done Text0542: ; 4893d (12:493d) - text "Hey, ", TX_RAM1, "!" + text "Hey, !" line "I'm not gonna lose to you!" line "" text "60 Mewtwo belongs to me!!!" done Text0543: ; 4897f (12:497f) - text TX_RAM1, "!" + text "!" line "I'm going to defeat you!" line "" text "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, !" line "Let the second match begin!" done Text0548: ; 48a34 (12:4a34) - text "Well, ", TX_RAM1, ", let the third," + text "Well, , 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, ." 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 "!" line "I won't lose next time!" done Text054f: ; 48b5b (12:4b5b) - text TX_RAM1, "!" + text "!" line "I'll win next time!" done Text0550: ; 48b73 (12:4b73) text "The Winner of this Challenge Cup " - line "is ", TX_HALFWIDTH, TX_RAM1, "!!!" + line "is " + text "!!!" done Text0551: ; 48b9f (12:4b9f) - text TX_RAM1, ", your prize" - line "is ", TX_RAM2, "!" + text ", your prize" + line "is !" done Text0552: ; 48bb4 (12:4bb4) - text "Congratulations, ", TX_HALFWIDTH, TX_RAM1, "!!!" + text "Congratulations, " + text "!!!" done Text0553: ; 48bcc (12:4bcc) - text "Hi, ", TX_RAM1, "." + text "Hi, ." 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, !" + line "You only have Medals!" + line "I've already collected !" 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, ." 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_HALFWIDTH, TX_RAM1, "." + line "game, " + text "." 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 ". 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 ", That is not the way" line "to the Hall of Honor." - line "Hurry, ", TX_HALFWIDTH, TX_RAM1, "! Go through to" + line "Hurry, " + text "! Go through to" line "the Hall of Honor!" done Text0563: ; 49178 (12:5178) - text TX_RAM1, ", if you leave the " + text ", 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 "," 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, !" line "Your second opponent is Steve!" done Text057c: ; 498e6 (12:58e6) - text TX_RAM1, "! Next, you must duel " + text "! 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, !" line "Come battle Steve!" done Text057f: ; 4999c (12:599c) - text "Is your Deck ready, ", TX_HALFWIDTH, TX_RAM1, "?" + text "Is your Deck ready, " + text "?" 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, ." line "Your next opponent is Jack!" done Text0588: ; 49b7b (12:5b7b) - text "That's great, ", TX_RAM1, "!" + text "That's great, !" line "Jack is your next opponent!" done @@ -609,7 +614,7 @@ Text058a: ; 49c1c (12:5c1c) done Text058b: ; 49c5f (12:5c5f) - text TX_RAM1, "," + text "," 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_HALFWIDTH, TX_RAM1, "?" + text "Is your Deck ready, " + text "?" 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, . " 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, !" 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, !" 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! !" 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 "!" done Text05a9: ; 4a49a (12:649a) - text "Is your Deck ready, ", TX_HALFWIDTH, TX_RAM1, "?" + text "Is your Deck ready, " + text "?" 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_HALFWIDTH, TX_RAM1, "!" + line "you, " + text "!" 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 ." done Text05b1: ; 4a6ba (12:66ba) @@ -843,7 +851,7 @@ Text05b2: ; 4a6f4 (12:66f4) done Text05b3: ; 4a72d (12:672d) - text "Congratulations, ", TX_RAM1, "!" + text "Congratulations, !" 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 " 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, !!!" 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 "! 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, !" 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, !" 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, ?" 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, ." done Text05e5: ; 4c9f2 (13:49f2) @@ -121,7 +121,7 @@ Text05e5: ; 4c9f2 (13:49f2) done Text05e6: ; 4ca0c (13:4a0c) - text "Hey! ", TX_RAM1, "!" + text "Hey! !" 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, ." 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 " 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, , what kind" line "of Deck do you want?" done Text05f3: ; 4cf12 (13:4f12) - text "A ", TX_RAM2, "?" + text "A ?" done Text05f4: ; 4cf18 (13:4f18) - text "OK, a ", TX_RAM2, "!" + text "OK, a !" line "Here are the remaining cards!" done Text05f5: ; 4cf40 (13:4f40) - text TX_RAM1, " received" - line "a ", TX_RAM2, "!" + text " received" + line "a !" line "" - text TX_RAM1, " received" + text " 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 ", 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 ?" 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 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 " Medal is not inserted." done Text0609: ; 4d6cf (13:56cf) - text "Insert the ", TX_RAM2, " Medal?" + text "Insert the 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! !" 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 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, !" 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, !" line "Ha ha ha ha ha!!!" done Text064a: ; 4eb39 (13:6b39) - text "Hi, ", TX_RAM1, "!" + text "Hi, !" line "How ya doin'?" done @@ -793,7 +793,7 @@ Text064e: ; 4ec9a (13:6c9a) done Text064f: ; 4ed1c (13:6d1c) - text "Hi, ", TX_RAM1, "!" + text "Hi, !" 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, ." 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, !" 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 ." 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 ", 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 " lost all " line "his Energy cards!" done @@ -206,10 +206,10 @@ Text06a1: ; 509f2 (14:49f2) done Text06a2: ; 50a9e (14:4a9e) - text TX_RAM1, "" + text "" line "checked the wall!" line "" - text TX_RAM1, "" + text "" line "found a 9 Slowpoke!" done @@ -472,7 +472,7 @@ Text06cd: ; 51720 (14:5720) Text06ce: ; 5175f (14:575f) text "OK, " - line "To ", TX_RAM2, "." + line "To ." 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 "" 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 "!" 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 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 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 ." 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, ." 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 " 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 " 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 " 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, ." 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, ." 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, ." 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, ." 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 " 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, ." 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, . " 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 " 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, ." 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, . " 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 " 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, !" 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 6569d18..2088d0e 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, ..." 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......" 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 ..." 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 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, ." 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, ." 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, ...?" 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 "'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 " [ ]" 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 " Consecutive Wins!" line "" - text TX_RAM3, " opponent is ", TX_RAM2, "." + text " opponent is ." done Text07db: ; 57112 (15:7112) - text TX_RAM3, " opponent is ", TX_RAM2, "." + text " opponent is ." 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 opponent," + line "!" done Text07e2: ; 571ff (15:71ff) - text TX_RAM1, "'s consecutive wins" - line "ended at ", TX_RAM3, "." + text "'s consecutive wins" + line "ended at ." 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 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_HALFWIDTH, TX_RAM3, " time(s)!!!" + text " successfully defeated " + line "5 opponents " + text " time(s)!!!" done ConsecutiveWinRecordIncreasedText: ; 572ee (15:72ee) - text TX_RAM1, "'s consecutive win" - line "record increased to ", TX_RAM3, "!" + text "'s consecutive win" + line "record increased to !" done Text07e9: ; 5731a (15:731a) @@ -1121,59 +1123,71 @@ 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, "", $03,$51 + textfw3 "[" + db "" + textfw3 "]" done Text07f7: ; 57374 (15:7374) - db $03,$50, "", $03,$51 + textfw3 "[" + db "" + textfw3 "]" done Text07f8: ; 5737b (15:737b) - db $03,$50, "", $03,$51 + textfw3 "[" + db "" + textfw3 "]" done Text07f9: ; 57382 (15:7382) - db $03,$50, "", $03,$51 + textfw3 "[" + db "" + textfw3 "]" done Text07fa: ; 57389 (15:7389) - db $03,$50, "", $03,$51 + textfw3 "[" + db "" + textfw3 "]" done Text07fb: ; 57390 (15:7390) - db $03,$50, "", $03,$51 + textfw3 "[" + db "" + textfw3 "]" done GrassEnergyName: ; 57397 (15:7397) -- cgit v1.2.3 From e6645b205d8e8043449dace65f50544e8864b3eb Mon Sep 17 00:00:00 2001 From: xCrystal Date: Fri, 13 Jul 2018 20:57:01 +0200 Subject: Improve text macros --- src/macros/text.asm | 30 ++++++++++- src/text/text1.asm | 16 +++--- src/text/text2.asm | 148 +++++++--------------------------------------------- src/text/text3.asm | 6 +-- src/text/text9.asm | 24 +++------ 5 files changed, 66 insertions(+), 158 deletions(-) (limited to 'src') diff --git a/src/macros/text.asm b/src/macros/text.asm index 4a4211a..dd47c02 100644 --- a/src/macros/text.asm +++ b/src/macros/text.asm @@ -22,35 +22,63 @@ 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 - db TX_FULLWIDTH2, STRCAT("FW4_", \1) +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/text/text1.asm b/src/text/text1.asm index ce5da88..4c7e74c 100644 --- a/src/text/text1.asm +++ b/src/text/text1.asm @@ -306,27 +306,27 @@ Text0046: ; 3681b (d:681b) done Text0047: ; 36848 (d:6848) - db "" + textfw0 "" done Text0048: ; 3684b (d:684b) - db "" + textfw0 "" done Text0049: ; 3684e (d:684e) - db "" + textfw0 "" done Text004a: ; 36851 (d:6851) - db "" + textfw0 "" done Text004b: ; 36854 (d:6854) - db "" + textfw0 "" done Text004c: ; 36857 (d:6857) - db "" + textfw0 "" done Text004d: ; 3685a (d:685a) @@ -605,9 +605,9 @@ Text0086: ; 36f31 (d:6f31) Text0087: ; 36f43 (d:6f43) textfw3 "B" - db "" + textfw0 "" textfw3 "S" - db "" + textfw0 "" done DuelistIsThinkingText: ; 36f4a (d:6f4a) diff --git a/src/text/text2.asm b/src/text/text2.asm index 5705f38..cc41751 100644 --- a/src/text/text2.asm +++ b/src/text/text2.asm @@ -1260,7 +1260,7 @@ Text01da: ; 3b3bb (e:73bb) done Text01db: ; 3b3fe (e:73fe) - text "'s turn ", TX_RAM3 + text "'s turn " done Text01dc: ; 3b40a (e:740a) @@ -1484,19 +1484,11 @@ Text0212: ; 3b76e (e:776e) done Text0213: ; 3b77c (e:777c) - textfw3 "S", "W", "I", "T", "C", "H" - textfw0 " " - textfw3 "T", "O", - textfw0 " " - textfw3 "U", "P", "P", "E", "R" + textfw3 "S", "W", "I", "T", "C", "H", " ", "T", "O", " ", "U", "P", "P", "E", "R" done Text0214: ; 3b799 (e:7799) - textfw3 "S", "W", "I", "T", "C", "H" - textfw0 " " - textfw3 "T", "O", - textfw0 " " - textfw3 "L", "O", "W", "E", "R" + textfw3 "S", "W", "I", "T", "C", "H", " ", "T", "O", " ", "L", "O", "W", "E", "R" done Text0215: ; 3b7b6 (e:77b6) @@ -1553,10 +1545,8 @@ Text021f: ; 3b819 (e:7819) textfw0 "お", " ", "こ", " ", "そ", " ", "と", " ", "の", " ", "ほ", " ", "も", " ", "ん", " ", "ろ" line "" textfw0 "ゃ", " ", "ゅ", " ", "ょ", " ", "っ", " ", "を", " " - textfw3 "“" - textfw0 " " - textfw3 "º(2)" - textfw0 " ", "-(2)" + textfw3 "“", " ", "º(2)", " " + textfw0 "-(2)" done Text0220: ; 3b886 (e:7886) @@ -1571,136 +1561,38 @@ Text0220: ; 3b886 (e:7886) textfw0 "オ", " ", "コ", " ", "ソ", " ", "ト", " ", "ノ", " ", "ホ", " ", "モ", " ", "ン", " ", "ロ" line "" textfw0 "ャ", " ", "ュ", " ", "ョ", " ", "ッ", " ", "ヲ", " " - textfw3 "“" - textfw0 " " - textfw3 "º(2)" - textfw0 " ", "-(2)" + textfw3 "“", " ", "º(2)", " " + textfw0 "-(2)" done Text0221: ; 3b8f2 (e:78f2) - textfw3 "A" - textfw0 " " - textfw3 "B" - textfw0 " " - textfw3 "C" - textfw0 " " - textfw3 "D" - textfw0 " " - textfw3 "E" - textfw0 " " - textfw3 "F" - textfw0 " " - textfw3 "G" - textfw0 " " - textfw3 "H" - textfw0 " " - textfw3 "I" + textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I" line "" - textfw3 "J" - textfw0 " " - textfw3 "K" - textfw0 " " - textfw3 "L" - textfw0 " " - textfw3 "M" - textfw0 " " - textfw3 "N" - textfw0 " " - textfw3 "O" - textfw0 " " - textfw3 "P" - textfw0 " " - textfw3 "Q" - textfw0 " " - textfw3 "R" + textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R" line "" - textfw3 "S" - textfw0 " " - textfw3 "T" - textfw0 " " - textfw3 "U" - textfw0 " " - textfw3 "V" - textfw0 " " - textfw3 "W" - textfw0 " " - textfw3 "X" - textfw0 " " - textfw3 "Y" - textfw0 " " - textfw3 "Z" - textfw0 " ", "!" + textfw3 "S", " ", "T", " ", "U", " ", "V", " ", "W", " ", "X", " ", "Y", " ", "Z", " " + textfw0 "!" line "" textfw0 "?", " " - textfw3 "&" - textfw0 " ", "+", " ", "-", " ", "·", " ", "0", " ", "1", " ", "2", " ", "3" + textfw3 "&", " " + textfw0 "+", " ", "-", " ", "·", " ", "0", " ", "1", " ", "2", " ", "3" line "" - textfw0 "4", " ", "5", " ", "6", " ", "7", " ", "8", " ", "9", " " - db "" - textfw0 " " - db "" - textfw0 " ", " " + textfw0 "4", " ", "5", " ", "6", " ", "7", " ", "8", " ", "9", " ", "", " ", "", " ", " " line "" textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " done Text0222: ; 3b97b (e:797b) - textfw3 "A" - textfw0 " " - textfw3 "B" - textfw0 " " - textfw3 "C" - textfw0 " " - textfw3 "D" - textfw0 " " - textfw3 "E" - textfw0 " " - textfw3 "F" - textfw0 " " - textfw3 "G" - textfw0 " " - textfw3 "H" - textfw0 " " - textfw3 "I" + textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I" line "" - textfw3 "J" - textfw0 " " - textfw3 "K" - textfw0 " " - textfw3 "L" - textfw0 " " - textfw3 "M" - textfw0 " " - textfw3 "N" - textfw0 " " - textfw3 "O" - textfw0 " " - textfw3 "P" - textfw0 " " - textfw3 "Q" - textfw0 " " - textfw3 "R" + textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R" line "" - textfw3 "S" - textfw0 " " - textfw3 "T" - textfw0 " " - textfw3 "U" - textfw0 " " - textfw3 "V" - textfw0 " " - textfw3 "W" - textfw0 " " - textfw3 "X" - textfw0 " " - textfw3 "Y" - textfw0 " " - textfw3 "Z" - textfw0 " ", "!" + textfw3 "S", " ", "T", " ", "U", " ", "V", " ", "W", " ", "X", " ", "Y", " ", "Z", " " + textfw0 "!" line "" textfw0 "?", " " - textfw3 "&" - textfw0 " ", "+", " ", "-", " " + textfw3 "&", " " + textfw0 "+", " ", "-", " " textfw3 "'" textfw0 " ", "0", " ", "1", " ", "2", " ", "3" line "" diff --git a/src/text/text3.asm b/src/text/text3.asm index f705781..04d0b05 100644 --- a/src/text/text3.asm +++ b/src/text/text3.asm @@ -1066,7 +1066,7 @@ Text033e: ; 3e834 (f:6834) done Text033f: ; 3e85f (f:685f) - text "Name ", TX_RAM1 + text "Name " done Text0340: ; 3e867 (f:6867) @@ -1295,7 +1295,7 @@ Text0370: ; 3ecb9 (f:6cb9) text " " line " Master Medals Won " half2full - db "" + textfw0 "" text "" line " Album " half2full @@ -1530,7 +1530,7 @@ Text0394: ; 3f4d6 (f:74d6) done Text0395: ; 3f4f3 (f:74f3) - text " ", TX_RAM2 + text " " done Text0396: ; 3f4f9 (f:74f9) diff --git a/src/text/text9.asm b/src/text/text9.asm index 2088d0e..b354edb 100644 --- a/src/text/text9.asm +++ b/src/text/text9.asm @@ -1155,39 +1155,27 @@ Text07f5: ; 5736a (15:736a) done Text07f6: ; 5736d (15:736d) - textfw3 "[" - db "" - textfw3 "]" + textfw3 "[", "", "]" done Text07f7: ; 57374 (15:7374) - textfw3 "[" - db "" - textfw3 "]" + textfw3 "[", "", "]" done Text07f8: ; 5737b (15:737b) - textfw3 "[" - db "" - textfw3 "]" + textfw3 "[", "", "]" done Text07f9: ; 57382 (15:7382) - textfw3 "[" - db "" - textfw3 "]" + textfw3 "[", "", "]" done Text07fa: ; 57389 (15:7389) - textfw3 "[" - db "" - textfw3 "]" + textfw3 "[", "", "]" done Text07fb: ; 57390 (15:7390) - textfw3 "[" - db "" - textfw3 "]" + textfw3 "[", "", "]" done GrassEnergyName: ; 57397 (15:7397) -- cgit v1.2.3 From e56bf98bd90208031e036bf308c67a5d50a6e902 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Sat, 14 Jul 2018 11:57:07 +0200 Subject: Add missing characters to charmaps --- src/constants/charmaps.asm | 123 ++++++++++++++++++++++++++++++++++++++++++--- src/text/text1.asm | 4 +- src/text/text2.asm | 8 ++- src/text/text9.asm | 12 ++--- 4 files changed, 126 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/constants/charmaps.asm b/src/constants/charmaps.asm index 8a36eb1..e4229bb 100644 --- a/src/constants/charmaps.asm +++ b/src/constants/charmaps.asm @@ -42,8 +42,8 @@ fwcharmap 3, "r.", $4d fwcharmap 3, "♀", $4e fwcharmap 3, "♂", $4f - fwcharmap 3, "[", $50 - fwcharmap 3, "]", $51 + fwcharmap 3, "【", $50 + fwcharmap 3, "】", $51 fwcharmap 3, "●", $52 fwcharmap 3, "◆", $53 fwcharmap 3, "★", $54 @@ -59,11 +59,67 @@ fwcharmap 3, ":", $5e fwcharmap 3, "○", $5f fwcharmap 3, "❄", $60 - fwcharmap 3, "o", $61 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 @@ -95,7 +151,7 @@ fwcharmap 0, "ハ", $2a fwcharmap 0, "ヒ", $2b fwcharmap 0, "フ", $2c -; fwcharmap 0, " ", $2d + fwcharmap 0, "ヘ", $2d fwcharmap 0, "ホ", $2e fwcharmap 0, "マ", $2f fwcharmap 0, "ミ", $30 @@ -106,13 +162,37 @@ fwcharmap 0, "ユ", $35 fwcharmap 0, "ヨ", $36 fwcharmap 0, "ラ", $37 -; fwcharmap 0, " ", $38 + fwcharmap 0, "リ", $38 fwcharmap 0, "ル", $39 fwcharmap 0, "レ", $3a fwcharmap 0, "ロ", $3b fwcharmap 0, "ワ", $3c fwcharmap 0, "ン", $3d -; fwcharmap 0, " ", $3e-$56 + 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 @@ -170,7 +250,36 @@ fwcharmap 0, "ろ", $3b fwcharmap 0, "わ", $3c fwcharmap 0, "ん", $3d -; fwcharmap 0, " ", $3e-$5b + 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 diff --git a/src/text/text1.asm b/src/text/text1.asm index 4c7e74c..0274dc2 100644 --- a/src/text/text1.asm +++ b/src/text/text1.asm @@ -39,9 +39,7 @@ PKMNPWRText: ; 36356 (d:6356) done Text000b: ; 36360 (d:6360) - db $56 - textfw0 "ケ", "モ", "ン", "カ", "-(2)" - db $4c + textfw0 "ポ", "ケ", "モ", "ン", "カ", "-(2)", "ド" done LengthText: ; 36368 (d:6368) diff --git a/src/text/text2.asm b/src/text/text2.asm index cc41751..cd3aeed 100644 --- a/src/text/text2.asm +++ b/src/text/text2.asm @@ -1512,9 +1512,7 @@ Text0219: ; 3b7e8 (e:77e8) done Text021a: ; 3b7ee (e:77ee) - hiragana "ひ", "ら" - db $3e - textfw0 "ナ" + hiragana "ひ", "ら", "が", "ナ" done Text021b: ; 3b7f4 (e:77f4) @@ -1552,11 +1550,11 @@ Text021f: ; 3b819 (e:7819) Text0220: ; 3b886 (e:7886) textfw0 "ア", " ", "カ", " ", "サ", " ", "タ", " ", "ナ", " ", "ハ", " ", "マ", " ", "ヤ", " ", "ラ" line "" - textfw0 "イ", " ", "キ", " ", "シ", " ", "チ", " ", "ニ", " ", "ヒ", " ", "ミ", " ", "ユ", " ", "り" + textfw0 "イ", " ", "キ", " ", "シ", " ", "チ", " ", "ニ", " ", "ヒ", " ", "ミ", " ", "ユ", " ", "リ" line "" textfw0 "ウ", " ", "ク", " ", "ス", " ", "ツ", " ", "ヌ", " ", "フ", " ", "ム", " ", "ヨ", " ", "ル" line "" - textfw0 "エ", " ", "ケ", " ", "セ", " ", "テ", " ", "ネ", " ", "へ", " ", "メ", " ", "ワ", " ", "レ" + textfw0 "エ", " ", "ケ", " ", "セ", " ", "テ", " ", "ネ", " ", "ヘ", " ", "メ", " ", "ワ", " ", "レ" line "" textfw0 "オ", " ", "コ", " ", "ソ", " ", "ト", " ", "ノ", " ", "ホ", " ", "モ", " ", "ン", " ", "ロ" line "" diff --git a/src/text/text9.asm b/src/text/text9.asm index b354edb..295d7c1 100644 --- a/src/text/text9.asm +++ b/src/text/text9.asm @@ -1155,27 +1155,27 @@ Text07f5: ; 5736a (15:736a) done Text07f6: ; 5736d (15:736d) - textfw3 "[", "", "]" + textfw3 "【", "", "】" done Text07f7: ; 57374 (15:7374) - textfw3 "[", "", "]" + textfw3 "【", "", "】" done Text07f8: ; 5737b (15:737b) - textfw3 "[", "", "]" + textfw3 "【", "", "】" done Text07f9: ; 57382 (15:7382) - textfw3 "[", "", "]" + textfw3 "【", "", "】" done Text07fa: ; 57389 (15:7389) - textfw3 "[", "", "]" + textfw3 "【", "", "】" done Text07fb: ; 57390 (15:7390) - textfw3 "[", "", "]" + textfw3 "【", "", "】" done GrassEnergyName: ; 57397 (15:7397) -- cgit v1.2.3 From 6f9b7d17ccfa4c7c7ba0e33b23a78074495adf16 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Sun, 15 Jul 2018 10:56:34 +0200 Subject: Text struct -> Text header --- src/engine/home.asm | 86 ++++++++++++++++++++++++++--------------------------- src/macros/wram.asm | 2 +- src/wram.asm | 22 +++++++------- 3 files changed, 55 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/engine/home.asm b/src/engine/home.asm index f4c7441..fe6a148 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -7922,7 +7922,7 @@ PrintScrollableText: ; 2c84 (0:2c84) dec c jr nz, .nonzero_text_speed .skip_delay - call ProcessTextStruct + call ProcessTextHeader jr c, .asm_2cc3 ld a, [wCurTextLine] cp 3 @@ -7936,22 +7936,22 @@ PrintScrollableText: ; 2c84 (0:2c84) call BankswitchHome ret -; zero wWhichTextStruct, wWhichTxRam2 and wWhichTxRam3, and set hJapaneseSyllabary to TX_KATAKANA -; fill wTextStruct1 with TX_KATAKANA, wFontWidth, hBankROM, and register bc for the text's pointer. +; 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. InitRegistersForPrintingText: ; 2cc8 (0:2cc8) xor a - ld [wWhichTextStruct], a + ld [wWhichTextHeader], a ld [wWhichTxRam2], a ld [wWhichTxRam3], a ld a, TX_KATAKANA ld [hJapaneseSyllabary], a ; fallthrough -; fill the wTextStruct specified in wWhichTextStruct (0-3) with hJapaneseSyllabary, +; fill the wTextHeader specified in wWhichTextHeader (0-3) with hJapaneseSyllabary, ; wFontWidth, hBankROM, and register bc for the text's pointer. -WriteToTextStruct: ; 2cd7 (0:2cd7) +WriteToTextHeader: ; 2cd7 (0:2cd7) push hl - call GetPointerToTextStruct + call GetPointerToTextHeader pop bc ld a, [hJapaneseSyllabary] ld [hli], a @@ -7964,20 +7964,20 @@ WriteToTextStruct: ; 2cd7 (0:2cd7) ld [hl], b ret -; same as WriteToTextStruct, except it then increases wWhichTextStruct to -; set the following text struct to the current one (usually, because +; 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). -WriteToTextStruct_MoveToNext: ; 2ceb (0:2ceb) - call WriteToTextStruct - ld hl, wWhichTextStruct +WriteToTextHeader_MoveToNext: ; 2ceb (0:2ceb) + call WriteToTextHeader + ld hl, wWhichTextHeader inc [hl] ret -; read the wTextStruct specified in wWhichTextStruct (0-3) and use the data to +; 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. -ReadTextStruct: ; 2cf3 (0:2cf3) - call GetPointerToTextStruct +ReadTextHeader: ; 2cf3 (0:2cf3) + call GetPointerToTextHeader ld a, [hli] ld [hJapaneseSyllabary], a ld a, [hli] @@ -7989,16 +7989,16 @@ ReadTextStruct: ; 2cf3 (0:2cf3) ld l, a ret -; return in hl, the address of the wTextStruct specified in wWhichTextStruct (0-3) -GetPointerToTextStruct: ; 2d06 (0:2d06) - ld a, [wWhichTextStruct] +; 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, wTextStruct1 + ld hl, wTextHeader1 add hl, de ret @@ -8027,12 +8027,12 @@ Func_2d15: ; 2d15 (0:2d15) pop hl ret -; reads the incoming character from the current wTextStruct and processes it -; then updates the current wTextStruct to point to the next character. -; a TX_RAM command causes a switch to a wTextStruct in the level below, and a TX_END -; command terminates the text unless there is a pending wTextStruct in the above level. -ProcessTextStruct: ; 2d43 (0:2d43) - call ReadTextStruct +; 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, .tx_end @@ -8060,23 +8060,23 @@ ProcessTextStruct: ; 2d43 (0:2d43) xor a call ProcessSpecialTextCharacter .processed_char - call WriteToTextStruct + call WriteToTextHeader or a ret .tx_end - ld a, [wWhichTextStruct] + ld a, [wWhichTextHeader] or a jr z, .no_more_text - ; handle text struct in the above level + ; handle text header in the above level dec a - ld [wWhichTextStruct], a - jr ProcessTextStruct + ld [wWhichTextHeader], a + jr ProcessTextHeader .no_more_text call TerminateHalfWidthText scf ret .tx_ram2 - call WriteToTextStruct_MoveToNext + call WriteToTextHeader_MoveToNext ld a, TX_KATAKANA ld [hJapaneseSyllabary], a xor a ; FULL_WIDTH @@ -8088,22 +8088,22 @@ ProcessTextStruct: ; 2d43 (0:2d43) or h jr z, .empty call GetTextOffsetFromTextID - call WriteToTextStruct - jr ProcessTextStruct + call WriteToTextHeader + jr ProcessTextHeader .empty ld hl, wDefaultText - call WriteToTextStruct - jr ProcessTextStruct + call WriteToTextHeader + jr ProcessTextHeader .tx_ram3 - call WriteToTextStruct_MoveToNext + call WriteToTextHeader_MoveToNext ld de, wTxRam3 ld hl, wWhichTxRam3 call HandleTxRam2Or3 call TwoByteNumberToText_CountLeadingZeros - call WriteToTextStruct - jp ProcessTextStruct + call WriteToTextHeader + jp ProcessTextHeader .tx_ram1 - call WriteToTextStruct_MoveToNext + call WriteToTextHeader_MoveToNext call CopyPlayerNameOrTurnDuelistName ld a, [wTextBuf] cp TX_HALFWIDTH @@ -8111,8 +8111,8 @@ ProcessTextStruct: ; 2d43 (0:2d43) ld a, TX_HALF2FULL call ProcessSpecialTextCharacter .tx_halfwidth - call WriteToTextStruct - jp ProcessTextStruct + call WriteToTextHeader + jp ProcessTextHeader ; input: ; de: wTxRam2 or wTxRam3 @@ -8238,7 +8238,7 @@ PrintText: ; 2e41 (0:2e41) dec a jr nz, .text_delay_loop .skip_delay - call ProcessTextStruct + call ProcessTextHeader jr nc, .next_tile_loop ret @@ -8250,7 +8250,7 @@ PrintTextNoDelay: ; 2e76 (0:2e76) call GetTextOffsetFromTextID call InitRegistersForPrintingText .next_tile_loop - call ProcessTextStruct + call ProcessTextHeader jr nc, .next_tile_loop pop af call BankswitchHome diff --git a/src/macros/wram.asm b/src/macros/wram.asm index fc32615..ad6075f 100644 --- a/src/macros/wram.asm +++ b/src/macros/wram.asm @@ -39,7 +39,7 @@ move_data_struct: MACRO \1Animation:: ds 1 ENDM -text_struct: MACRO +text_header: MACRO \1DefaultFont:: ds 1 \1FontWidth:: ds 1 \1Address:: ds 2 diff --git a/src/wram.asm b/src/wram.asm index 17736b8..34993bc 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -1101,17 +1101,17 @@ wce22:: ; ce22 wCardPalette:: ; ce23 ds CGB_PAL_SIZE -; information about the text being currently processed, like the font width +; 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). -wTextStruct1:: ; ce2b - text_struct wTextStruct1 -wTextStruct2:: ; ce30 - text_struct wTextStruct2 -wTextStruct3:: ; ce35 - text_struct wTextStruct3 -wTextStruct4:: ; ce3a - text_struct wTextStruct4 +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 @@ -1136,8 +1136,8 @@ wTxRam3_b:: ; ce45 wTextSpeed:: ; ce47 ds $1 -; a number between 0 and 3 to select a wTextStruct to use for the current text -wWhichTextStruct:: ; ce48 +; a number between 0 and 3 to select a wTextHeader to use for the current text +wWhichTextHeader:: ; ce48 ds $1 ; selects wTxRam2 or wTxRam2_b -- cgit v1.2.3 From a32f257d89e9f92c8962130724ff36a4b28d2be8 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Sun, 15 Jul 2018 17:57:20 +0200 Subject: Disassemble more from home.asm --- src/engine/home.asm | 289 +++++++++++++++++++++++++++++++++++++++++++++++----- src/gfx.asm | 2 + src/wram.asm | 9 +- 3 files changed, 273 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/engine/home.asm b/src/engine/home.asm index fe6a148..7d6381c 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -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 @@ -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 @@ -5844,7 +5848,195 @@ 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 +LoadCardSetTiles: ; 2066 (0:2066) + and $7 + 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 + 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) @@ -5953,7 +6145,7 @@ LoadSymbolsFont: ; 2119 (0:2119) ; if $4000 ≤ hl ≤ $7fff ; copy b tiles from Gfx2:hl to de CopyFontsOrDuelGraphicsTiles: ; 2121 (0:2121) - ld a, BANK(FullWidthFonts); BANK(DuelGraphics); BANK(HalfWidthFont) + ld a, BANK(Fonts); BANK(DuelGraphics) call BankpushHome ld c, TILE_SIZE call CopyGfxData @@ -5990,17 +6182,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 call HtimesL add hl, hl add hl, hl - ; hl = a * $280 + ; hl = a * 40 tiles ld de, DuelBoxMessages add hl, de ld de, v0Tiles1 + $20 tiles - ld b, $28 + ld b, 40 call CopyFontsOrDuelGraphicsTiles ld a, $a0 lb hl, 1, 10 @@ -6009,7 +6202,55 @@ 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 + +; 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 + ld d, [hl] + inc hl + 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. @@ -6639,7 +6880,7 @@ ConvertTileNumberToTileDataAddress: ; 2518 (0:2518) ; 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(FullWidthFonts); BANK(DuelGraphics); BANK(HalfWidthFont) + ld a, BANK(Fonts); BANK(DuelGraphics) call BankpushHome ld de, wTextTileBuffer push de @@ -6979,7 +7220,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 @@ -6997,12 +7238,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 @@ -7900,7 +8141,7 @@ PrintScrollableText: ; 2c84 (0:2c84) push af call GetTextOffsetFromTextID call Func_2d15 - call InitRegistersForPrintingText + call ResetTxRam_WriteToTextHeader .print_char_loop ld a, [wTextSpeed] ld c, a @@ -7938,7 +8179,7 @@ PrintScrollableText: ; 2c84 (0:2c84) ; 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. -InitRegistersForPrintingText: ; 2cc8 (0:2cc8) +ResetTxRam_WriteToTextHeader: ; 2cc8 (0:2cc8) xor a ld [wWhichTextHeader], a ld [wWhichTxRam2], a @@ -8219,7 +8460,7 @@ PrintText: ; 2e41 (0:2e41) .from_ram ld hl, wDefaultText .print_text - call InitRegistersForPrintingText + call ResetTxRam_WriteToTextHeader .next_tile_loop ldh a, [hButtonsHeld] ld b, a @@ -8248,7 +8489,7 @@ PrintTextNoDelay: ; 2e76 (0:2e76) ldh a, [hBankROM] push af call GetTextOffsetFromTextID - call InitRegistersForPrintingText + call ResetTxRam_WriteToTextHeader .next_tile_loop call ProcessTextHeader jr nc, .next_tile_loop @@ -8475,7 +8716,7 @@ LoadCardGfx: ; 2fa0 (0:2fa0) ; identical to CopyFontsOrDuelGraphicsTiles CopyFontsOrDuelGraphicsTiles2: ; 2fcb (0:2fcb) - ld a, BANK(FullWidthFonts); BANK(DuelGraphics); BANK(HalfWidthFont) + ld a, BANK(Fonts); BANK(DuelGraphics) call BankpushHome ld c, TILE_SIZE call CopyGfxData diff --git a/src/gfx.asm b/src/gfx.asm index c2e3489..d568802 100644 --- a/src/gfx.asm +++ b/src/gfx.asm @@ -2,6 +2,8 @@ INCLUDE "macros.asm" SECTION "Gfx 1", ROMX +Fonts:: + FullWidthFonts:: ; 74000 (1d:4000) INCBIN "gfx/fonts/full_width/0_0_katakana.1bpp" INCBIN "gfx/fonts/full_width/0_1_hiragana.1bpp" diff --git a/src/wram.asm b/src/wram.asm index 34993bc..f1cfb5f 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -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 @@ -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 -- cgit v1.2.3 From 291ff5bebffdbe39281732d443043b244bf1ffb0 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Mon, 16 Jul 2018 20:04:34 +0200 Subject: Disassemble more home incbins --- src/constants/charmaps.asm | 2 + src/constants/hardware_constants.asm | 5 +- src/constants/text_constants.asm | 2 +- src/engine/bank01.asm | 4 +- src/engine/bank02.asm | 4 +- src/engine/bank03.asm | 4 +- src/engine/bank06.asm | 2 +- src/engine/home.asm | 463 ++++++++++++++++++++++++++++++++--- src/wram.asm | 3 +- 9 files changed, 441 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/constants/charmaps.asm b/src/constants/charmaps.asm index e4229bb..5bd21be 100644 --- a/src/constants/charmaps.asm +++ b/src/constants/charmaps.asm @@ -308,6 +308,8 @@ 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_* 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 fbef11a..3a50b59 100644 --- a/src/constants/text_constants.asm +++ b/src/constants/text_constants.asm @@ -10,7 +10,7 @@ TX_FULLWIDTH3 EQU $03 ; source: gfx/fonts/full_width/4.1bpp TX_FULLWIDTH4 EQU $04 -TX_CTRL_BEGIN EQU $05 +TX_CTRL_START EQU $05 ; usage: TX_SYMBOL, char1, TX_SYMBOL, char2, ... ; source: gfx/fonts/symbols.2bpp diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 7687865..09e6efd 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -1572,7 +1572,7 @@ Func_4a97: ; 4a97 (1:4a97) push de call CopyOpponentName pop hl - call GetTextSizeInHalfTiles + call GetTextSizeInTiles push hl add SCREEN_WIDTH ld d, a @@ -2149,7 +2149,7 @@ DrawDuelHUD: ; 5093 (1:5093) or a jr nz, .print_color_icon ld hl, wDefaultText - call GetTextSizeInHalfTiles + call GetTextSizeInTiles add SCREEN_WIDTH ld d, a .print_color_icon diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index 1ebde42..4f88d0a 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -670,7 +670,7 @@ Func_9253: ; 9253 (2:5253) ld de, wDefaultText call Func_92ad ld hl, wDefaultText - call GetTextSizeInHalfTiles + 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 GetTextSizeInHalfTiles + call GetTextSizeInTiles ld b, $0 ld hl, wDefaultText add hl, bc diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index b44d07a..aac9c1b 100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -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 @@ -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/bank06.asm b/src/engine/bank06.asm index 8e6f07d..fc5e5c4 100644 --- a/src/engine/bank06.asm +++ b/src/engine/bank06.asm @@ -38,7 +38,7 @@ _CopyCardNameAndLevel: ; 18000 (6:4000) pop hl push de ld e, c - call GetTextSizeInHalfTiles + call GetTextSizeInTiles add e ld c, a pop hl diff --git a/src/engine/home.asm b/src/engine/home.asm index 7d6381c..ddace8f 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -3793,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 @@ -3813,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] @@ -5562,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 @@ -5570,13 +5574,13 @@ DrawLabeledTextBox: ; 1e00 (0:1e00) pop hl call CopyText ld hl, wc000 + 3 - call GetTextSizeInHalfTiles + 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 @@ -5598,7 +5602,7 @@ 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 @@ -6015,8 +6019,9 @@ Func_2057: ; 2057 (0:2057) ; 0x2066 ; loads the four tiles of the card set 2 icon constant provided in register a -LoadCardSetTiles: ; 2066 (0:2066) - and $7 +; 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 @@ -6036,6 +6041,7 @@ LoadCardSetTiles: ; 2066 (0:2066) 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 @@ -6260,7 +6266,7 @@ ProcessText: ; 21c5 (0:21c5) call InitTextFormat jr .next_char .char_loop - cp TX_CTRL_BEGIN + cp TX_CTRL_START jr c, .character_pair cp TX_CTRL_END jr nc, .character_pair @@ -6640,14 +6646,14 @@ CaseHalfWidthLetter: ; 23b1 (0:23b1) ; 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 half-tiles +; b = size of text in tiles ; c = size of text in bytes ; a = -b -GetTextSizeInHalfTiles: ; 23c1 (0:23c1) +GetTextSizeInTiles: ; 23c1 (0:23c1) ld a, [hl] cp TX_HALFWIDTH jr nz, .full_width - call GetTextSizeInTiles + call GetTextSizeInHalfTiles ; return a = - ceil(b/2) inc b srl b @@ -6659,12 +6665,12 @@ GetTextSizeInHalfTiles: ; 23c1 (0:23c1) ld [wFontWidth], a ; fallthrough -GetTextSizeInTiles: ; 23d3 (0:23d3) ; iterates over text at hl until TX_END is found ; returns: -; b = size of text in tiles +; b = size of text in half-tiles ; c = size of text in bytes ; a = -b +GetTextSizeInHalfTiles: ; 23d3 (0:23d3) push hl push de lb bc, $00, $00 @@ -6674,7 +6680,7 @@ GetTextSizeInTiles: ; 23d3 (0:23d3) jr z, .tx_end inc c ; any char except TX_END: c ++ ; TX_FULLWIDTH, TX_SYMBOL, or > TX_CTRL_END : b ++ - cp TX_CTRL_BEGIN + cp TX_CTRL_START jr c, .character_pair cp TX_CTRL_END jr nc, .character_pair @@ -6702,7 +6708,88 @@ GetTextSizeInTiles: ; 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 + +.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 @@ -6920,7 +7007,7 @@ ClassifyTextCharacterPair: ; 2546 (0:2546) or a ret .continue_check - cp TX_CTRL_BEGIN + cp TX_CTRL_START jr c, .ath_font .not_katakana ; 0_1_hiragana.1bpp (e < $60) or 0_2_digits_kanji1.1bpp (e >= $60) @@ -6963,7 +7050,57 @@ GetFullWidthFontTileOffset: ; 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: @@ -8277,7 +8414,7 @@ ProcessTextHeader: ; 2d43 (0:2d43) ld a, [hli] or a ; TX_END jr z, .tx_end - cp TX_CTRL_BEGIN + cp TX_CTRL_START jr c, .character_pair cp TX_CTRL_END jr nc, .character_pair @@ -8529,7 +8666,7 @@ Func_2ea9: ; 2ea9 (0:2ea9) push af call GetTextOffsetFromTextID ldh a, [hff96] - call $23fd + call CopyTextData pop af call BankswitchHome ret @@ -8552,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) @@ -8681,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 = (CardGfx - CardGraphics) / 8 ; using absolute ROM addresses +; card_gfx_index = (CardGfx - CardGraphics) / 8 (using absolute ROM addresses) ; also copies the card's palette to wCardPalette LoadCardGfx: ; 2fa0 (0:2fa0) ldh a, [hBankROM] @@ -8700,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 @@ -10174,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] @@ -10790,7 +11052,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) @@ -10836,13 +11124,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 -Func_3c45: ; 3c45 (0:3c45) +; 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_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 @@ -11002,6 +11345,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 @@ -11022,7 +11368,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 @@ -11064,20 +11430,45 @@ Func_3e2a: ; 3e2a (0:3e2a) jr Func_3e17 ; 0x3e31 - INCROM $3e31, $3fe0 + INCROM $3e31, $3f5a + +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 -; jumps to 3f:hl +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/wram.asm b/src/wram.asm index f1cfb5f..992f157 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -958,7 +958,8 @@ wFontWidth:: ; cd0a wHalfWidthPrintState:: ; cd0b ds $1 -wcd0c:: ; cd0c +; used by CopyTextData +wTextMaxLength:: ; cd0c ds $1 ; half-width font letters become uppercase if non-0, lowercase if 0 -- cgit v1.2.3 From 80a5aa82a0ab5b786ceaf1edb2e05375fa89d7c4 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Tue, 17 Jul 2018 13:57:07 +0200 Subject: Finish disassembling home.asm --- src/engine/bank01.asm | 6 +- src/engine/home.asm | 290 ++++++++++++++++++++++++++++++++++++++++++++++++-- src/wram.asm | 56 +++++++++- 3 files changed, 336 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 09e6efd..9ca9c10 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -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 @@ -3903,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 @@ -3920,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 diff --git a/src/engine/home.asm b/src/engine/home.asm index ddace8f..948d810 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] @@ -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 @@ -11285,7 +11285,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] @@ -11430,7 +11543,166 @@ Func_3e2a: ; 3e2a (0:3e2a) jr Func_3e17 ; 0x3e31 - INCROM $3e31, $3f5a +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 + +; 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 diff --git a/src/wram.asm b/src/wram.asm index 992f157..9f8acc7 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -404,7 +404,7 @@ wTileMapFill:: ; cab6 wIE:: ; cab7 ds $1 -wVBlankCtr:: ; cab8 +wVBlankCounter:: ; cab8 ds $1 ds $1 @@ -1849,12 +1849,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 @@ -1904,7 +1918,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 -- cgit v1.2.3 From eb87f849ff7a0ec07a27035fb183234ed04ef540 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Tue, 17 Jul 2018 14:24:09 +0200 Subject: map permission functions --- src/engine/bank03.asm | 6 +++--- src/engine/home.asm | 23 ++++++++++++++--------- src/wram.asm | 7 +++++-- 3 files changed, 22 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index aac9c1b..744a3ef 100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -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 diff --git a/src/engine/home.asm b/src/engine/home.asm index 948d810..a922861 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -10592,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 @@ -10626,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 @@ -10637,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 diff --git a/src/wram.asm b/src/wram.asm index 9f8acc7..e40d382 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -1521,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 -- cgit v1.2.3