src/system/system_debug_text.c
Number text, the debug text screen and the window graphics. More…
Included by system.c.
Macros
| Name | Description | |
|---|---|---|
#define | DEBUG_TEXT_SCREEN_BYTES (BG_SCREEN_WIDTH * DISPLAY_TILE_HEIGHT * 2) | The debug text screen's bytes: 32 by 20 entries of a halfword. |
#define | BASIC_SPRITE_PALETTES 14 | The basic sprite palettes, sprite palettes 0 to 13. |
#define | HEX_DIGITS 8 | The number buffer's hexadecimal: eight digits. |
#define | DECIMAL_DIGITS_MAX 10 | The number buffer's decimal: a sign place and up to ten digits. |
#define | DEBUG_TEXT_MAX_LENGTH 32 | The most characters syPrint writes of a string. |
Functions
| Name | Description | |
|---|---|---|
void | syStringFormatHex (Uint32 value) | Writes value as HEX_DIGITS hexadecimal digits to the number buffer. |
void | syStringFormatDecimal (Sint32 value) | Writes value to the number buffer as DECIMAL_DIGITS_MAX + 1 characters: spaces, a sign (a space or '-') and its decimal digits, right-aligned. |
void | syPrintBlanks (Uint32 count) | Writes count blank characters (WINDOW_TILE_BLANK) at the debug text cursor and moves it on, when debug text is on. |
void | syPrint (const Uint8 *text) | Prints the string text (at most DEBUG_TEXT_MAX_LENGTH characters) at the debug text cursor, wrapping from the end of the screen to its start, when debug text is on; the cursor moves past it. |
void | syPrintHex (Uint32 value, Sint32 digits) | Prints the last digits hexadecimal digits of value (1 to HEX_DIGITS; anything else prints all of them). |
void | syPrintDecimal (Sint32 value, Sint32 digits) | Prints the last digits characters of value in signed decimal (1 to DECIMAL_DIGITS_MAX; anything else prints DECIMAL_DIGITS_MAX). |
void | syPrintClear (void) | Blanks the debug text screen, homes the cursor and points BG0 at it. |
void | syWindowLoadGraphics (void) | Loads the window font and border tiles into BG character block 0, the window palette into WINDOW_PALETTE with its gradient colours, and the basic sprite palettes. |
void | syPaletteLoadBasicSpriteColors (void) | Loads the basic sprite palettes. |
Description
Number text, the debug text screen and the window graphics. Part of system.c.
Macros in detail
DEBUG_TEXT_SCREEN_BYTES
#define DEBUG_TEXT_SCREEN_BYTES (BG_SCREEN_WIDTH * DISPLAY_TILE_HEIGHT * 2)
The debug text screen's bytes: 32 by 20 entries of a halfword.
Referenced by syPrint() and syPrintClear().
Definition at line 9 of file system_debug_text.c.
BASIC_SPRITE_PALETTES
#define BASIC_SPRITE_PALETTES 14
The basic sprite palettes, sprite palettes 0 to 13.
Referenced by syPaletteLoadBasicSpriteColors() and syWindowLoadGraphics().
Definition at line 11 of file system_debug_text.c.
HEX_DIGITS
#define HEX_DIGITS 8
The number buffer's hexadecimal: eight digits.
Referenced by syPrintHex() and syStringFormatHex().
Definition at line 14 of file system_debug_text.c.
DECIMAL_DIGITS_MAX
#define DECIMAL_DIGITS_MAX 10
The number buffer's decimal: a sign place and up to ten digits.
Referenced by syPrintDecimal() and syStringFormatDecimal().
Definition at line 16 of file system_debug_text.c.
DEBUG_TEXT_MAX_LENGTH
#define DEBUG_TEXT_MAX_LENGTH 32
The most characters syPrint writes of a string.
Referenced by syPrint().
Definition at line 18 of file system_debug_text.c.
Functions in detail
syStringFormatHex
void syStringFormatHex(Uint32 value)
Writes value as HEX_DIGITS hexadecimal digits to the number buffer.
References NumberTextBuffer, Sint32 and StringHexDigits.
Referenced by syPrintHex().
Definition at line 21 of file system_debug_text.c.
syStringFormatDecimal
void syStringFormatDecimal(Sint32 value)
Writes value to the number buffer as DECIMAL_DIGITS_MAX + 1 characters:
spaces, a sign (a space or '-') and its decimal digits, right-aligned.
References NumberTextBuffer, Sint32 and syMathUnsignedMultiplyHigh().
Referenced by mnStringFormatNumberToHalfwords() and syPrintDecimal().
Definition at line 37 of file system_debug_text.c.
syPrintBlanks
void syPrintBlanks(Uint32 count)
Writes count blank characters (WINDOW_TILE_BLANK) at the debug text cursor
and moves it on, when debug text is on.
References DebugTextCursor and DebugTextEnabled.
Definition at line 73 of file system_debug_text.c.
syPrint
void syPrint(const Uint8 *text)
Prints the string text (at most DEBUG_TEXT_MAX_LENGTH characters) at the
debug text cursor, wrapping from the end of the screen to its start, when
debug text is on; the cursor moves past it.
References DebugTextCursor and DebugTextEnabled.
Referenced by syPrintDecimal() and syPrintHex().
Definition at line 89 of file system_debug_text.c.
syPrintHex
void syPrintHex(Uint32 value, Sint32 digits)
Prints the last digits hexadecimal digits of value (1 to HEX_DIGITS;
anything else prints all of them). Reached through the stub table.
References NumberTextHexEnd, Sint32, syPrint() and syStringFormatHex().
Definition at line 121 of file system_debug_text.c.
syPrintDecimal
void syPrintDecimal(Sint32 value, Sint32 digits)
Prints the last digits characters of value in signed decimal (1 to
DECIMAL_DIGITS_MAX; anything else prints DECIMAL_DIGITS_MAX). Reached through
the stub table.
References NumberTextDecimalEnd, Sint32, syPrint() and syStringFormatDecimal().
Definition at line 132 of file system_debug_text.c.
syPrintClear
void syPrintClear(void)
Blanks the debug text screen, homes the cursor and points BG0 at it.
References DebugTextCursor.
Referenced by btDebugBattleRunMenu(), fdPaletteEditorRun(), gmMainRoutineRun(), mnCreditsRun(), mnTitleIntroRun(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAirsRockWhirlwindClearsFog(), scAirsRockWhirlwindClearsWall(), scAirsRockWhirlwindOpensTheTop(), scInit(), scJupiterLighthouseFlashSky(), scShamanVillageBlowAwaySand(), scStaffCreditPlayLighthouseTransition(), scStaffCreditShowBeacon(), scWorldMapLoadTidalWave(), scWorldMapPlayLighthouseTransition() and syInit().
Definition at line 141 of file system_debug_text.c.
syWindowLoadGraphics
void syWindowLoadGraphics(void)
Loads the window font and border tiles into BG character block 0, the window
palette into WINDOW_PALETTE with its gradient colours, and the basic sprite
palettes.
References syDMAXCopy(), syResourceGetTableEntry(), SystemBasicColorPalette and WindowPalette.
Referenced by btDebugBattleRunMenu(), fdPaletteEditorRun(), fdPsynergyEndRing(), mnCreditsRun(), mnNameEntryEditMemberName(), mnTitleIntroRun(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAirsRockWhirlwindClearsFog(), scAirsRockWhirlwindClearsWall(), scAirsRockWhirlwindOpensTheTop(), scClearEnterPassword(), scInit(), scJupiterLighthouseFlashSky(), scShamanVillageBlowAwaySand(), scWorldMapLoadTidalWave() and syInit().
Definition at line 153 of file system_debug_text.c.
syPaletteLoadBasicSpriteColors
void syPaletteLoadBasicSpriteColors(void)
Loads the basic sprite palettes.
References syDMAXCopy() and SystemBasicColorPalette.
Referenced by btEffectRunAtalanta(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCruelRuin(), btEffectRunDaedalus(), btEffectRunEclipse(), btEffectRunFlora(), btEffectRunIris(), btEffectRunJudgment(), btEffectRunNeptune(), btIrisRestoreBattle() and fdActorSystemConfigure().
Definition at line 187 of file system_debug_text.c.