Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reverse-engineering] Assign names to all graph_putsa_fx() effects
And get rid of the constraining FX() macro, with its spacing parameter that we haven't even seen used so far. Part of P0124, funded by [Anonymous] and Blue Bolt.
- Loading branch information
Showing
26 changed files
with
318 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,57 @@ | ||
// Puts the given [str] onto the graphics RAM at the given position, applying | ||
// the given effect. | ||
#define FX(color, weight, spacing) \ | ||
((color) | (weight & 3) << 4 | (spacing & 7) << 6) | ||
void graph_putsa_fx( | ||
screen_x_t left, vram_y_t top, int fx, const unsigned char *str | ||
); | ||
// Font weights | ||
// ------------ | ||
|
||
// As stored in font ROM | ||
#define WEIGHT_NORMAL 0 | ||
|
||
// Naively adds one pixel of boldness, to the left | ||
#define WEIGHT_HEAVY 1 | ||
|
||
// Adds one pixel of boldness to the left, but preserves holes inbetween | ||
// strokes. | ||
#define WEIGHT_BOLD 2 | ||
|
||
// Adding another pixel of boldness, to the left, on top of WEIGHT_BOLD. | ||
// (Very thicc!) | ||
#define WEIGHT_BLACK 3 | ||
|
||
#define WEIGHT_COUNT 4 | ||
// ------------ | ||
|
||
#if (GAME == 1) | ||
// TH01-exclusive effects | ||
// ---------------------- | ||
// Puts a black background behind the text. Useful if the text is rendered | ||
// onto the back page and should then be 2✕ scaled onto the front page. | ||
#define FX_CLEAR_BG 0x200 | ||
|
||
#define FX_UNDERLINE 0x400 | ||
#define FX_REVERSE 0x800 | ||
// ---------------------- | ||
#endif | ||
|
||
#if (GAME <= 3) | ||
#define FX_WEIGHT_NORMAL (WEIGHT_NORMAL << 4) | ||
#define FX_WEIGHT_HEAVY (WEIGHT_HEAVY << 4) | ||
#define FX_WEIGHT_BOLD (WEIGHT_BOLD << 4) | ||
#define FX_WEIGHT_BLACK (WEIGHT_BLACK << 4) | ||
|
||
#define FX_SPACING(spacing) \ | ||
(spacing & 7) << 6) | ||
|
||
// Puts the given [str] onto the graphics RAM at the given position, | ||
// with the given graphics color and effect. | ||
void graph_putsa_fx( | ||
screen_x_t left, | ||
vram_y_t top, | ||
int16_t col_and_fx, | ||
const unsigned char *str | ||
); | ||
#endif | ||
|
||
#if (GAME == 1) | ||
// Variadic version of graph_putsa_fx(). | ||
void graph_printf_fx( | ||
screen_x_t left, vram_y_t top, int16_t col_and_fx, const char *fmt, ... | ||
); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
WEIGHT_NORMAL = 0 | ||
WEIGHT_HEAVY = 1 | ||
WEIGHT_BOLD = 2 | ||
WEIGHT_BLACK = 3 | ||
WEIGHT_COUNT = 4 | ||
|
||
if (GAME eq 1) | ||
FX_CLEAR_BG = 200h | ||
FX_UNDERLINE = 400h | ||
FX_REVERSE = 800h | ||
endif | ||
|
||
if (GAME le 3) | ||
FX_WEIGHT_NORMAL = (WEIGHT_NORMAL shl 4) | ||
FX_WEIGHT_HEAVY = (WEIGHT_HEAVY shl 4) | ||
FX_WEIGHT_BOLD = (WEIGHT_BOLD shl 4) | ||
FX_WEIGHT_BLACK = (WEIGHT_BLACK shl 4) | ||
endif |
Oops, something went wrong.