summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-03-29 12:32:26 -0400
committerGitHub <noreply@github.com>2021-03-29 12:32:26 -0400
commit731a4420353869e3d7e3b4a6e375a2234ee9169f (patch)
tree7213ceab81cd2edf2ac06df963599c16671a4d3c /src
parent5cb8ec424764845b1cb38871586346a885601b0f (diff)
parent6cceb05cb75f368c924c19fd456c2e09e71426a0 (diff)
Merge pull request #1389 from huderlem/text_doc
Document some text-related things
Diffstat (limited to 'src')
-rw-r--r--src/mauville_old_man.c18
-rw-r--r--src/unk_text_util_2.c22
2 files changed, 20 insertions, 20 deletions
diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c
index cdcde9b06..228415628 100644
--- a/src/mauville_old_man.c
+++ b/src/mauville_old_man.c
@@ -425,21 +425,21 @@ static void StartBardSong(bool8 useTemporaryLyrics)
gTasks[taskId].tUseTemporaryLyrics = useTemporaryLyrics;
}
-static void sub_81206F0(void)
+static void EnableTextPrinters(void)
{
- gUnknown_03002F84 = FALSE;
+ gDisableTextPrinters = FALSE;
}
-static void BardSong_TextSubPrinter(struct TextPrinterTemplate * printer, u16 a1)
+static void BardSong_DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1)
{
- gUnknown_03002F84 = TRUE;
+ gDisableTextPrinters = TRUE;
}
static void sub_8120708(const u8 * src)
{
DrawDialogueFrame(0, 0);
- AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_TextSubPrinter);
- gUnknown_03002F84 = TRUE;
+ AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_DisableTextPrinters);
+ gDisableTextPrinters = TRUE;
CopyWindowToVram(0, 3);
}
@@ -620,7 +620,7 @@ static void Task_BardSong(u8 taskId)
else if (gStringVar4[task->tCharIndex] == CHAR_SPACE)
{
- sub_81206F0();
+ EnableTextPrinters();
task->tCharIndex++;
task->tState = 2;
task->data[2] = 0;
@@ -640,7 +640,7 @@ static void Task_BardSong(u8 taskId)
else if (gStringVar4[task->tCharIndex] == CHAR_SONG_WORD_SEPARATOR)
{
gStringVar4[task->tCharIndex] = CHAR_SPACE; // restore it back to a space
- sub_81206F0();
+ EnableTextPrinters();
task->tCharIndex++;
task->data[2] = 0;
}
@@ -649,7 +649,7 @@ static void Task_BardSong(u8 taskId)
switch (task->data[1])
{
case 0:
- sub_81206F0();
+ EnableTextPrinters();
task->data[1]++;
break;
case 1:
diff --git a/src/unk_text_util_2.c b/src/unk_text_util_2.c
index b92b34fbd..3459dde85 100644
--- a/src/unk_text_util_2.c
+++ b/src/unk_text_util_2.c
@@ -5,7 +5,7 @@
#include "sound.h"
ALIGNED(4)
-static const u8 sUnknown_08616124[] = {1, 2, 4};
+static const u8 sScrollDistances[] = {1, 2, 4};
static const u16 sFont6BrailleGlyphs[] = INCBIN_U16("graphics/fonts/font6.fwjpnfont");
static void DecompressGlyphFont6(u16);
@@ -135,7 +135,7 @@ u16 Font6Func(struct TextPrinter *textPrinter)
}
DecompressGlyphFont6(char_);
CopyGlyphToWindow(textPrinter);
- textPrinter->printerTemplate.currentX += gUnknown_03002F90.width + textPrinter->printerTemplate.letterSpacing;
+ textPrinter->printerTemplate.currentX += gCurGlyph.width + textPrinter->printerTemplate.letterSpacing;
return 0;
case 1:
if (TextPrinterWait(textPrinter))
@@ -164,15 +164,15 @@ u16 Font6Func(struct TextPrinter *textPrinter)
case 4:
if (textPrinter->scrollDistance)
{
- if (textPrinter->scrollDistance < sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed])
+ if (textPrinter->scrollDistance < sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed])
{
ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance = 0;
}
else
{
- ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor));
- textPrinter->scrollDistance -= sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed];
+ ScrollWindow(textPrinter->printerTemplate.windowId, 0, sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor));
+ textPrinter->scrollDistance -= sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed];
}
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2);
}
@@ -206,12 +206,12 @@ static void DecompressGlyphFont6(u16 glyph)
const u16 *glyphs;
glyphs = sFont6BrailleGlyphs + 0x100 * (glyph / 8) + 0x10 * (glyph % 8);
- DecompressGlyphTile(glyphs, (u16 *)gUnknown_03002F90.unk0);
- DecompressGlyphTile(glyphs + 0x8, (u16 *)(gUnknown_03002F90.unk20));
- DecompressGlyphTile(glyphs + 0x80, (u16 *)(gUnknown_03002F90.unk40));
- DecompressGlyphTile(glyphs + 0x88, (u16 *)(gUnknown_03002F90.unk60));
- gUnknown_03002F90.width = 0x10;
- gUnknown_03002F90.height = 0x10;
+ DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
+ DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
+ DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom);
+ DecompressGlyphTile(glyphs + 0x88, gCurGlyph.gfxBufferBottom + 8);
+ gCurGlyph.width = 0x10;
+ gCurGlyph.height = 0x10;
}
u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese)