diff --git a/include/gfxprint.h b/include/gfxprint.h index 647ebf8561..da63c9e762 100644 --- a/include/gfxprint.h +++ b/include/gfxprint.h @@ -34,7 +34,9 @@ typedef struct GfxPrint { #define GFXP_FLAG_RAINBOW (1 << 1) #define GFXP_FLAG_SHADOW (1 << 2) #define GFXP_FLAG_UPDATE (1 << 3) +#if PLATFORM_GC #define GFXP_FLAG_ENLARGE (1 << 6) +#endif #define GFXP_FLAG_OPEN (1 << 7) #endif diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index d6171aaccb..ac4bb7ced0 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -126,8 +126,10 @@ u8 sGfxPrintFontData[(16 * 256) / 2] = { 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; +#if PLATFORM_GC // Can be used to set GFXP_FLAG_ENLARGE by default static u8 sDefaultSpecialFlags; +#endif void GfxPrint_Setup(GfxPrint* this) { s32 width = 16; @@ -210,6 +212,10 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { if (this->flags & GFXP_FLAG_SHADOW) { gDPSetColor(this->dList++, G_SETPRIMCOLOR, 0); +#if PLATFORM_N64 + gSPTextureRectangle(this->dList++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32, + tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10); +#else if (this->flags & GFXP_FLAG_ENLARGE) { gSPTextureRectangle(this->dList++, (this->posX + 4) << 1, (this->posY + 4) << 1, (this->posX + 4 + 32) << 1, (this->posY + 4 + 32) << 1, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 9, @@ -218,10 +224,15 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { gSPTextureRectangle(this->dList++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10); } +#endif gDPSetColor(this->dList++, G_SETPRIMCOLOR, this->color.rgba); } +#if PLATFORM_N64 + gSPTextureRectangle(this->dList++, this->posX, this->posY, this->posX + 32, this->posY + 32, tile, + (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10); +#else if (this->flags & GFXP_FLAG_ENLARGE) { gSPTextureRectangle(this->dList++, this->posX << 1, this->posY << 1, (this->posX + 32) << 1, (this->posY + 32) << 1, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 9, 1 << 9); @@ -229,26 +240,32 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { gSPTextureRectangle(this->dList++, this->posX, this->posY, this->posX + 32, this->posY + 32, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10); } +#endif this->posX += GFX_CHAR_X_SPACING << 2; } void GfxPrint_PrintChar(GfxPrint* this, u8 c) { +#if PLATFORM_N64 +#define CHAR_PARAM c +#else +#define CHAR_PARAM charParam u8 charParam = c; +#endif if (c == ' ') { this->posX += GFX_CHAR_X_SPACING << 2; } else if (c > ' ' && c < 0x7F) { - GfxPrint_PrintCharImpl(this, charParam); + GfxPrint_PrintCharImpl(this, c); } else if (c >= 0xA0 && c < 0xE0) { if (this->flags & GFXP_FLAG_HIRAGANA) { if (c < 0xC0) { - charParam = c - 0x20; + CHAR_PARAM = c - 0x20; } else { - charParam = c + 0x20; + CHAR_PARAM = c + 0x20; } } - GfxPrint_PrintCharImpl(this, charParam); + GfxPrint_PrintCharImpl(this, CHAR_PARAM); } else { switch (c) { case '\0': @@ -325,11 +342,13 @@ void GfxPrint_Init(GfxPrint* this) { this->flags |= GFXP_FLAG_SHADOW; this->flags |= GFXP_FLAG_UPDATE; +#if PLATFORM_GC if (sDefaultSpecialFlags & GFXP_FLAG_ENLARGE) { this->flags |= GFXP_FLAG_ENLARGE; } else { this->flags &= ~GFXP_FLAG_ENLARGE; } +#endif } void GfxPrint_Destroy(GfxPrint* this) { @@ -341,7 +360,9 @@ void GfxPrint_Open(GfxPrint* this, Gfx* dList) { this->dList = dList; GfxPrint_Setup(this); } else { - PRINTF("gfxprint_open:2重オープンです\n"); +#if PLATFORM_N64 || OOT_DEBUG + osSyncPrintf("gfxprint_open:2重オープンです\n"); +#endif } } @@ -349,7 +370,9 @@ Gfx* GfxPrint_Close(GfxPrint* this) { Gfx* ret; this->flags &= ~GFXP_FLAG_OPEN; +#if PLATFORM_GC gDPPipeSync(this->dList++); +#endif ret = this->dList; this->dList = NULL;