summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sprite.c236
-rw-r--r--src/text.c109
2 files changed, 290 insertions, 55 deletions
diff --git a/src/sprite.c b/src/sprite.c
index 3b73363ac..245dc2660 100644
--- a/src/sprite.c
+++ b/src/sprite.c
@@ -1,5 +1,6 @@
#include "global.h"
#include "sprite.h"
+#include "main.h"
#define OAM_MATRIX_COUNT 32
@@ -10,6 +11,56 @@ struct SpriteCopyRequest
u16 size;
};
+// this file's functions
+void UpdateOamCoords(void);
+void BuildSpritePriorities(void);
+void SortSprites(void);
+void CopyMatricesToOamBuffer(void);
+void AddSpritesToOamBuffer(void);
+u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
+void ClearSpriteCopyRequests(void);
+void ResetOamMatrices(void);
+void ResetSprite(struct Sprite *sprite);
+s16 AllocSpriteTiles(u16 tileCount);
+void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct SpriteFrameImage *images);
+void ResetAllSprites(void);
+void BeginAnim(struct Sprite *sprite);
+void ContinueAnim(struct Sprite *sprite);
+void AnimCmd_frame(struct Sprite *sprite);
+void AnimCmd_end(struct Sprite *sprite);
+void AnimCmd_jump(struct Sprite *sprite);
+void AnimCmd_loop(struct Sprite *sprite);
+void BeginAnimLoop(struct Sprite *sprite);
+void ContinueAnimLoop(struct Sprite *sprite);
+void JumpToTopOfAnimLoop(struct Sprite *sprite);
+void BeginAffineAnim(struct Sprite *sprite);
+void ContinueAffineAnim(struct Sprite *sprite);
+void AffineAnimDelay(u8 matrixNum, struct Sprite *sprite);
+void AffineAnimCmd_loop(u8 matrixNum, struct Sprite *sprite);
+void BeginAffineAnimLoop(u8 matrixNum, struct Sprite *sprite);
+void ContinueAffineAnimLoop(u8 matrixNum, struct Sprite *sprite);
+void JumpToTopOfAffineAnimLoop(u8 matrixNum, struct Sprite *sprite);
+void AffineAnimCmd_jump(u8 matrixNum, struct Sprite *sprite);
+void AffineAnimCmd_end(u8 matrixNum, struct Sprite *sprite);
+void AffineAnimCmd_frame(u8 matrixNum, struct Sprite *sprite);
+void CopyOamMatrix(u8 destMatrixIndex, struct OamMatrix *srcMatrix);
+u8 GetSpriteMatrixNum(struct Sprite *sprite);
+void SetSpriteOamFlipBits(struct Sprite *sprite, u8 hFlip, u8 vFlip);
+void AffineAnimStateRestartAnim(u8 matrixNum);
+void AffineAnimStateStartAnim(u8 matrixNum, u8 animNum);
+void AffineAnimStateReset(u8 matrixNum);
+void ApplyAffineAnimFrameAbsolute(u8 matrixNum, struct AffineAnimFrameCmd *frameCmd);
+void DecrementAnimDelayCounter(struct Sprite *sprite);
+bool8 DecrementAffineAnimDelayCounter(struct Sprite *sprite, u8 matrixNum);
+void ApplyAffineAnimFrameRelativeAndUpdateMatrix(u8 matrixNum, struct AffineAnimFrameCmd *frameCmd);
+s16 ConvertScaleParam(s16 scale);
+void GetAffineAnimFrame(u8 matrixNum, struct Sprite *sprite, struct AffineAnimFrameCmd *frameCmd);
+void ApplyAffineAnimFrame(u8 matrixNum, struct AffineAnimFrameCmd *frameCmd);
+void ResetAffineAnimData(void);
+u8 IndexOfSpriteTileTag(u16 tag);
+void AllocSpriteTileRange(u16 tag, u16 start, u16 count);
+void DoLoadSpritePalette(const u16 *src, u16 paletteOffset);
+
EWRAM_DATA struct Sprite gSprites[MAX_SPRITES + 1] = {0};
EWRAM_DATA u16 gSpritePriorities[MAX_SPRITES] = {0};
EWRAM_DATA u8 gSpriteOrder[MAX_SPRITES] = {0};
@@ -23,3 +74,188 @@ EWRAM_DATA s16 gSpriteCoordOffsetX = 0;
EWRAM_DATA s16 gSpriteCoordOffsetY = 0;
EWRAM_DATA struct OamMatrix gOamMatrices[OAM_MATRIX_COUNT] = {0};
EWRAM_DATA bool8 gAffineAnimsDisabled = 0;
+
+void ResetSpriteData(void)
+{
+ ResetOamRange(0, 128);
+ ResetAllSprites();
+ ClearSpriteCopyRequests();
+ ResetAffineAnimData();
+ FreeSpriteTileRanges();
+ gOamLimit = 64;
+ gReservedSpriteTileCount = 0;
+ AllocSpriteTiles(0);
+ gSpriteCoordOffsetX = 0;
+ gSpriteCoordOffsetY = 0;
+}
+
+void AnimateSprites(void)
+{
+ u8 i;
+ for (i = 0; i < MAX_SPRITES; i++)
+ {
+ struct Sprite *sprite = &gSprites[i];
+
+ if (sprite->inUse)
+ {
+ sprite->callback(sprite);
+
+ if (sprite->inUse)
+ AnimateSprite(sprite);
+ }
+ }
+}
+
+void BuildOamBuffer(void)
+{
+ u8 temp;
+ UpdateOamCoords();
+ BuildSpritePriorities();
+ SortSprites();
+ temp = gMain.oamLoadDisabled;
+ gMain.oamLoadDisabled = TRUE;
+ AddSpritesToOamBuffer();
+ CopyMatricesToOamBuffer();
+ gMain.oamLoadDisabled = temp;
+ gShouldProcessSpriteCopyRequests = TRUE;
+}
+
+void UpdateOamCoords(void)
+{
+ u8 i;
+ for (i = 0; i < MAX_SPRITES; i++)
+ {
+ struct Sprite *sprite = &gSprites[i];
+ if (sprite->inUse && !sprite->invisible)
+ {
+ if (sprite->coordOffsetEnabled)
+ {
+ sprite->oam.x = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX + gSpriteCoordOffsetX;
+ sprite->oam.y = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY;
+ }
+ else
+ {
+ sprite->oam.x = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX;
+ sprite->oam.y = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY;
+ }
+ }
+ }
+}
+
+void BuildSpritePriorities(void)
+{
+ u16 i;
+ for (i = 0; i < MAX_SPRITES; i++)
+ {
+ struct Sprite *sprite = &gSprites[i];
+ u16 priority = sprite->subpriority | (sprite->oam.priority << 8);
+ gSpritePriorities[i] = priority;
+ }
+}
+
+void SortSprites(void)
+{
+ u8 i;
+ for (i = 1; i < MAX_SPRITES; i++)
+ {
+ u8 j = i;
+ struct Sprite *sprite1 = &gSprites[gSpriteOrder[i - 1]];
+ struct Sprite *sprite2 = &gSprites[gSpriteOrder[i]];
+ u16 sprite1Priority = gSpritePriorities[gSpriteOrder[i - 1]];
+ u16 sprite2Priority = gSpritePriorities[gSpriteOrder[i]];
+ s16 sprite1Y = sprite1->oam.y;
+ s16 sprite2Y = sprite2->oam.y;
+
+ if (sprite1Y >= DISPLAY_HEIGHT)
+ sprite1Y = sprite1Y - 256;
+
+ if (sprite2Y >= DISPLAY_HEIGHT)
+ sprite2Y = sprite2Y - 256;
+
+ if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE
+ && sprite1->oam.size == 3)
+ {
+ u32 shape = sprite1->oam.shape;
+ if (shape == ST_OAM_SQUARE || shape == 2)
+ {
+ if (sprite1Y > 128)
+ sprite1Y = sprite1Y - 256;
+ }
+ }
+
+ if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE
+ && sprite2->oam.size == 3)
+ {
+ u32 shape = sprite2->oam.shape;
+ if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE)
+ {
+ if (sprite2Y > 128)
+ sprite2Y = sprite2Y - 256;
+ }
+ }
+
+ while (j > 0
+ && ((sprite1Priority > sprite2Priority)
+ || (sprite1Priority == sprite2Priority && sprite1Y < sprite2Y)))
+ {
+ u8 temp = gSpriteOrder[j];
+ gSpriteOrder[j] = gSpriteOrder[j - 1];
+ gSpriteOrder[j - 1] = temp;
+
+ // UB: If j equals 1, then j-- makes j equal 0.
+ // Then, gSpriteOrder[-1] gets accessed below.
+ // Although this doesn't result in a bug in the ROM,
+ // the behavior is undefined.
+ j--;
+
+ sprite1 = &gSprites[gSpriteOrder[j - 1]];
+ sprite2 = &gSprites[gSpriteOrder[j]];
+ sprite1Priority = gSpritePriorities[gSpriteOrder[j - 1]];
+ sprite2Priority = gSpritePriorities[gSpriteOrder[j]];
+ sprite1Y = sprite1->oam.y;
+ sprite2Y = sprite2->oam.y;
+
+ if (sprite1Y >= DISPLAY_HEIGHT)
+ sprite1Y = sprite1Y - 256;
+
+ if (sprite2Y >= DISPLAY_HEIGHT)
+ sprite2Y = sprite2Y - 256;
+
+ if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE
+ && sprite1->oam.size == 3)
+ {
+ u32 shape = sprite1->oam.shape;
+ if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE)
+ {
+ if (sprite1Y > 128)
+ sprite1Y = sprite1Y - 256;
+ }
+ }
+
+ if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE
+ && sprite2->oam.size == 3)
+ {
+ u32 shape = sprite2->oam.shape;
+ if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE)
+ {
+ if (sprite2Y > 128)
+ sprite2Y = sprite2Y - 256;
+ }
+ }
+ }
+ }
+}
+
+void CopyMatricesToOamBuffer(void)
+{
+ u8 i;
+ for (i = 0; i < OAM_MATRIX_COUNT; i++)
+ {
+ u32 base = 4 * i;
+ gMain.oamBuffer[base + 0].affineParam = gOamMatrices[i].a;
+ gMain.oamBuffer[base + 1].affineParam = gOamMatrices[i].b;
+ gMain.oamBuffer[base + 2].affineParam = gOamMatrices[i].c;
+ gMain.oamBuffer[base + 3].affineParam = gOamMatrices[i].d;
+ }
+}
+
diff --git a/src/text.c b/src/text.c
index 6981b9370..a984e9a54 100644
--- a/src/text.c
+++ b/src/text.c
@@ -15,9 +15,8 @@ extern u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese);
extern void audio_play(u16 songNum);
extern u8* sub_81AFC74(u8 a1);
-extern struct Window gWindows[20];
-EWRAM_DATA struct TextPrinter gTempTextPrinter = {};
-EWRAM_DATA struct TextPrinter gTextPrinters[NUM_TEXT_PRINTERS] = {};
+EWRAM_DATA struct TextPrinter gTempTextPrinter = {0};
+EWRAM_DATA struct TextPrinter gTextPrinters[NUM_TEXT_PRINTERS] = {0};
static u16 gFontHalfRowLookupTable[0x51];
static u16 gLastTextBgColor;
@@ -177,18 +176,18 @@ bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*ca
if (!gFonts)
return FALSE;
-
+
gTempTextPrinter.sub_union.sub.active = 1;
gTempTextPrinter.state = 0;
gTempTextPrinter.text_speed = speed;
gTempTextPrinter.delayCounter = 0;
gTempTextPrinter.scrollDistance = 0;
-
+
for (i = 0; i < 7; ++i)
{
gTempTextPrinter.sub_union.sub_fields[i] = 0;
}
-
+
gTempTextPrinter.subPrinter = *textSubPrinter;
gTempTextPrinter.callback = callback;
gTempTextPrinter.minLetterSpacing = 0;
@@ -208,7 +207,7 @@ bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*ca
if ((u32)RenderFont(&gTempTextPrinter) == 1)
break;
}
-
+
if (speed != 0xFF)
CopyWindowToVram(gTempTextPrinter.subPrinter.windowId, 2);
gTextPrinters[textSubPrinter->windowId].sub_union.sub.active = 0;
@@ -266,11 +265,11 @@ u32 RenderFont(struct TextPrinter *textPrinter)
void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor)
{
u16* current = gFontHalfRowLookupTable;
-
+
gLastTextBgColor = bgColor;
gLastTextFgColor = fgColor;
gLastTextShadowColor = shadowColor;
-
+
*(current++) = (bgColor << 12) | (bgColor << 8) | (bgColor << 4) | bgColor;
*(current++) = (fgColor << 12) | (bgColor << 8) | (bgColor << 4) | bgColor;
*(current++) = (shadowColor << 12) | (bgColor << 8) | (bgColor << 4) | bgColor;
@@ -857,7 +856,7 @@ void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor)
void DecompressGlyphTile(const u16 *src, u16 *dest)
{
u32 temp;
-
+
temp = src[0];
*(dest++) = (gFontHalfRowLookupTable[gFontHalfRowOffsets[temp & 0xFF]] << 16) | gFontHalfRowLookupTable[gFontHalfRowOffsets[temp >> 8]];
temp = src[1];
@@ -1773,10 +1772,10 @@ void ClearTextSpan(struct TextPrinter *textPrinter, u32 width)
pixels_data.pixels = window->tileData;
pixels_data.width = window->window.width << 3;
pixels_data.height = window->window.height << 3;
-
+
gUnk = gUnknown_03002F90;
glyphHeight = &gUnk[0x81];
-
+
FillBitmapRect4Bit(
&pixels_data,
textPrinter->subPrinter.currentX,
@@ -1790,7 +1789,7 @@ void ClearTextSpan(struct TextPrinter *textPrinter, u32 width)
u16 Font0Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 0;
@@ -1802,7 +1801,7 @@ u16 Font0Func(struct TextPrinter *textPrinter)
u16 Font1Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 1;
@@ -1814,7 +1813,7 @@ u16 Font1Func(struct TextPrinter *textPrinter)
u16 Font2Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 2;
@@ -1826,7 +1825,7 @@ u16 Font2Func(struct TextPrinter *textPrinter)
u16 Font3Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 3;
@@ -1838,7 +1837,7 @@ u16 Font3Func(struct TextPrinter *textPrinter)
u16 Font4Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 4;
@@ -1850,7 +1849,7 @@ u16 Font4Func(struct TextPrinter *textPrinter)
u16 Font5Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 5;
@@ -1862,7 +1861,7 @@ u16 Font5Func(struct TextPrinter *textPrinter)
u16 Font7Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 7;
@@ -1874,7 +1873,7 @@ u16 Font7Func(struct TextPrinter *textPrinter)
u16 Font8Func(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->field_1_top == 0)
{
textPrinter->sub_union.sub.font_type = 8;
@@ -1886,7 +1885,7 @@ u16 Font8Func(struct TextPrinter *textPrinter)
void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (gTextFlags.flag_2 == 1)
subStruct->frames_visible_counter = 0;
else
@@ -1916,7 +1915,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
textPrinter->subPrinter.currentY,
0x8,
0x10);
-
+
switch (gTextFlags.flag_1)
{
case 0:
@@ -1927,7 +1926,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
arrowTiles = gDarkDownArrowTiles;
break;
}
-
+
BlitBitmapRectToWindow(
textPrinter->subPrinter.windowId,
arrowTiles,
@@ -1940,7 +1939,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
0x8,
0x10);
CopyWindowToVram(textPrinter->subPrinter.windowId, 0x2);
-
+
subStruct->field_1 = 0x8;
subStruct->field_1_upmid = (*(u32*)subStruct << 17 >> 30) + 1;
}
@@ -1962,7 +1961,7 @@ void TextPrinterClearDownArrow(struct TextPrinter *textPrinter)
bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
-
+
if (subStruct->frames_visible_counter == 49)
{
return TRUE;
@@ -2014,7 +2013,7 @@ bool8 TextPrinterWait(struct TextPrinter *textPrinter)
void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex)
{
const u8 *arrowTiles;
-
+
if (*counter != 0)
{
--*counter;
@@ -2034,7 +2033,7 @@ void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *c
arrowTiles = gDarkDownArrowTiles;
break;
}
-
+
BlitBitmapRectToWindow(
windowId,
arrowTiles,
@@ -2800,7 +2799,7 @@ u32 GetStringWidthFixedWidthFont(u8 *str, u8 fontId, u8 letterSpacing)
line = 0;
strLocal = str;
strPos = 0;
-
+
do
{
temp = strLocal[strPos++];
@@ -2861,26 +2860,26 @@ u32 GetStringWidthFixedWidthFont(u8 *str, u8 fontId, u8 letterSpacing)
break;
}
} while (temp != 0xFF);
-
+
for (width = 0, strPos = 0; strPos < 8; ++strPos)
{
if (width < lineWidths[strPos])
width = lineWidths[strPos];
}
-
+
return (u8)(GetFontAttribute(fontId, 0) + letterSpacing) * width;
}
u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32)
{
u32 i;
-
+
for (i = 0; i < 9; ++i)
{
if (glyphId == gGlyphWidthFuncs[i].font_id)
return gGlyphWidthFuncs[i].func;
}
-
+
return 0;
}
@@ -2898,20 +2897,20 @@ s32 GetStringWidth(u8 fontId, u8 *str, s16 letterSpacing)
isJapanese = 0;
minGlyphWidth = 0;
-
+
func = GetFontWidthFunc(fontId);
if (func == NULL)
return 0;
-
+
if (letterSpacing == -1)
localLetterSpacing = GetFontAttribute(fontId, 2);
else
localLetterSpacing = letterSpacing;
-
+
width = 0;
lineWidth = 0;
bufferPointer = 0;
-
+
while (*str != 0xFF)
{
switch (*str)
@@ -3016,7 +3015,7 @@ s32 GetStringWidth(u8 fontId, u8 *str, s16 letterSpacing)
glyphWidth = func(*++str | 0x100, isJapanese);
else
glyphWidth = GetKeypadIconWidth(*++str);
-
+
if (minGlyphWidth > 0)
{
if (glyphWidth < minGlyphWidth)
@@ -3051,7 +3050,7 @@ s32 GetStringWidth(u8 fontId, u8 *str, s16 letterSpacing)
}
++str;
}
-
+
if (lineWidth > width)
return lineWidth;
return width;
@@ -3069,15 +3068,15 @@ u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str)
u8 bgColor;
SaveTextColors(&colorBackup[0], &colorBackup[1], &colorBackup[2]);
-
+
fgColor = 1;
bgColor = 0;
shadowColor = 3;
-
+
GenerateFontHalfRowLookupTable(1, 0, 3);
strLocal = str;
strPos = 0;
-
+
do
{
temp = strLocal[strPos++];
@@ -3154,7 +3153,7 @@ u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str)
DecompressGlyphFont1(temp, 1);
break;
}
-
+
CpuCopy32(gUnknown_03002F90, pixels, 0x20);
CpuCopy32(gUnknown_03002F90 + 0x40, pixels + 0x20, 0x20);
pixels += 0x40;
@@ -3162,7 +3161,7 @@ u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str)
}
}
while (temp != 0xFF);
-
+
RestoreTextColors(&colorBackup[0], &colorBackup[1], &colorBackup[2]);
return 1;
}
@@ -3257,7 +3256,7 @@ void DecompressGlyphFont0(u16 glyphId, bool32 isJapanese)
{
glyphs = gFont0LatinGlyphs + (0x20 * glyphId);
gUnknown_03002F90[0x80] = gFont0LatinGlyphWidths[glyphId];
-
+
if (gUnknown_03002F90[0x80] <= 8)
{
DecompressGlyphTile(glyphs, (u16 *)gUnknown_03002F90);
@@ -3270,7 +3269,7 @@ void DecompressGlyphFont0(u16 glyphId, bool32 isJapanese)
DecompressGlyphTile(glyphs + 0x10, (u16 *)(gUnknown_03002F90 + 0x40));
DecompressGlyphTile(glyphs + 0x18, (u16 *)(gUnknown_03002F90 + 0x60));
}
-
+
gUnknown_03002F90[0x81] = 13;
}
}
@@ -3286,7 +3285,7 @@ u32 GetGlyphWidthFont0(u16 glyphId, bool32 isJapanese)
void DecompressGlyphFont7(u16 glyphId, bool32 isJapanese)
{
const u16* glyphs;
-
+
if (isJapanese == TRUE)
{
int eff;
@@ -3300,7 +3299,7 @@ void DecompressGlyphFont7(u16 glyphId, bool32 isJapanese)
{
glyphs = gFont7LatinGlyphs + (0x20 * glyphId);
gUnknown_03002F90[0x80] = gFont7LatinGlyphWidths[glyphId];
-
+
if (gUnknown_03002F90[0x80] <= 8)
{
DecompressGlyphTile(glyphs, (u16 *)gUnknown_03002F90);
@@ -3313,7 +3312,7 @@ void DecompressGlyphFont7(u16 glyphId, bool32 isJapanese)
DecompressGlyphTile(glyphs + 0x10, (u16 *)(gUnknown_03002F90 + 0x40));
DecompressGlyphTile(glyphs + 0x18, (u16 *)(gUnknown_03002F90 + 0x60));
}
-
+
gUnknown_03002F90[0x81] = 15;
}
}
@@ -3342,7 +3341,7 @@ void DecompressGlyphFont8(u16 glyphId, bool32 isJapanese)
{
glyphs = gFont8LatinGlyphs + (0x20 * glyphId);
gUnknown_03002F90[0x80] = gFont8LatinGlyphWidths[glyphId];
-
+
if (gUnknown_03002F90[0x80] <= 8)
{
DecompressGlyphTile(glyphs, (u16 *)gUnknown_03002F90);
@@ -3355,7 +3354,7 @@ void DecompressGlyphFont8(u16 glyphId, bool32 isJapanese)
DecompressGlyphTile(glyphs + 0x10, (u16 *)(gUnknown_03002F90 + 0x40));
DecompressGlyphTile(glyphs + 0x18, (u16 *)(gUnknown_03002F90 + 0x60));
}
-
+
gUnknown_03002F90[0x81] = 12;
}
}
@@ -3386,7 +3385,7 @@ void DecompressGlyphFont2(u16 glyphId, bool32 isJapanese)
{
glyphs = gFont2LatinGlyphs + (0x20 * glyphId);
gUnknown_03002F90[0x80] = gFont2LatinGlyphWidths[glyphId];
-
+
if (gUnknown_03002F90[0x80] <= 8)
{
DecompressGlyphTile(glyphs, (u16 *)gUnknown_03002F90);
@@ -3399,7 +3398,7 @@ void DecompressGlyphFont2(u16 glyphId, bool32 isJapanese)
DecompressGlyphTile(glyphs + 0x10, (u16 *)(gUnknown_03002F90 + 0x40));
DecompressGlyphTile(glyphs + 0x18, (u16 *)(gUnknown_03002F90 + 0x60));
}
-
+
gUnknown_03002F90[0x81] = 14;
}
}
@@ -3415,7 +3414,7 @@ u32 GetGlyphWidthFont2(u16 glyphId, bool32 isJapanese)
void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese)
{
const u16* glyphs;
-
+
if (isJapanese == TRUE)
{
int eff;
@@ -3429,7 +3428,7 @@ void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese)
{
glyphs = gFont1LatinGlyphs + (0x20 * glyphId);
gUnknown_03002F90[0x80] = gFont1LatinGlyphWidths[glyphId];
-
+
if (gUnknown_03002F90[0x80] <= 8)
{
DecompressGlyphTile(glyphs, (u16 *)gUnknown_03002F90);
@@ -3442,7 +3441,7 @@ void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese)
DecompressGlyphTile(glyphs + 0x10, (u16 *)(gUnknown_03002F90 + 0x40));
DecompressGlyphTile(glyphs + 0x18, (u16 *)(gUnknown_03002F90 + 0x60));
}
-
+
gUnknown_03002F90[0x81] = 15;
}
}