summaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/text.c b/src/text.c
index 6a83d5d15..f7c68f549 100644
--- a/src/text.c
+++ b/src/text.c
@@ -4,18 +4,15 @@
#include "m4a.h"
#include "palette.h"
#include "sound.h"
+#include "constants/songs.h"
#include "string_util.h"
#include "window.h"
#include "text.h"
+#include "blit.h"
-extern void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue);
-extern void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
-extern void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight);
extern u8 GetKeypadIconWidth(u8 keypadIconId);
-extern void CopyWindowToVram(u8 windowId, u8 mode);
extern u16 Font6Func(struct TextPrinter *textPrinter);
extern u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese);
-extern void PlaySE(u16 songNum);
extern u8* UnkTextUtil_GetPtrI(u8 a1);
extern int sub_8197964();
@@ -27,7 +24,6 @@ static u16 gLastTextBgColor;
static u16 gLastTextFgColor;
static u16 gLastTextShadowColor;
-extern struct Main gMain;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
const struct FontInfo *gFonts;
@@ -379,7 +375,7 @@ void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor)
*(current++) = (shadowColor << 12) | (shadowColor << 8) | (shadowColor << 4) | shadowColor;
}
#else
-__attribute__((naked))
+NAKED
void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor)
{
asm("push {r4-r7,lr}\n\
@@ -875,7 +871,7 @@ void DecompressGlyphTile(const u16 *src, u16 *dest)
*(dest) = (gFontHalfRowLookupTable[gFontHalfRowOffsets[src[1] & 0xFF]] << 16) | gFontHalfRowLookupTable[gFontHalfRowOffsets[src[1] >> 8]];
}
#else
-__attribute__((naked))
+NAKED
void DecompressGlyphTile(const u16 *src, u16 *dest)
{
asm("push {r4-r7,lr}\n\
@@ -1056,7 +1052,7 @@ u8 GetLastTextColor(u8 colorType)
}
}
-__attribute__((naked))
+NAKED
void CopyGlyphToWindow(struct TextPrinter *x)
{
asm("push {r4-r7,lr}\n\
@@ -1986,7 +1982,7 @@ bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter)
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
result = TRUE;
- PlaySE(5);
+ PlaySE(SE_SELECT);
}
}
return result;
@@ -2004,7 +2000,7 @@ bool16 TextPrinterWait(struct TextPrinter *textPrinter)
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
result = TRUE;
- PlaySE(5);
+ PlaySE(SE_SELECT);
}
}
return result;
@@ -2285,7 +2281,6 @@ u16 RenderText(struct TextPrinter *textPrinter)
else
textPrinter->subPrinter.currentX += gUnknown_03002F90[0x80];
}
-
return 0;
case 1: // _08005C78
if (TextPrinterWait(textPrinter))
@@ -2346,7 +2341,7 @@ u16 RenderText(struct TextPrinter *textPrinter)
return 1;
}
#else
-__attribute__((naked))
+NAKED
u16 RenderText(struct TextPrinter *textPrinter)
{
asm("push {r4-r6,lr}\n\