Merge branch 'master' into battle
This commit is contained in:
+43
-43
@@ -17,20 +17,20 @@ u16 Font6Func(struct TextPrinter *textPrinter)
|
||||
u16 char_;
|
||||
struct TextPrinterSubStruct *sub;
|
||||
|
||||
sub = &textPrinter->sub_union.sub;
|
||||
sub = &textPrinter->subUnion.sub;
|
||||
switch (textPrinter->state)
|
||||
{
|
||||
case 0:
|
||||
if (gMain.heldKeys & (A_BUTTON | B_BUTTON) && sub->font_type_upper)
|
||||
if (gMain.heldKeys & (A_BUTTON | B_BUTTON) && sub->hasPrintBeenSpedUp)
|
||||
{
|
||||
textPrinter->delayCounter = 0;
|
||||
}
|
||||
if (textPrinter->delayCounter && textPrinter->text_speed)
|
||||
if (textPrinter->delayCounter && textPrinter->textSpeed)
|
||||
{
|
||||
textPrinter->delayCounter --;
|
||||
if (gTextFlags.canABSpeedUpPrint && gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
{
|
||||
sub->font_type_upper = TRUE;
|
||||
sub->hasPrintBeenSpedUp = TRUE;
|
||||
textPrinter->delayCounter = 0;
|
||||
}
|
||||
return 3;
|
||||
@@ -41,62 +41,62 @@ u16 Font6Func(struct TextPrinter *textPrinter)
|
||||
}
|
||||
else
|
||||
{
|
||||
textPrinter->delayCounter = textPrinter->text_speed;
|
||||
textPrinter->delayCounter = textPrinter->textSpeed;
|
||||
}
|
||||
char_ = *textPrinter->subPrinter.currentChar++;
|
||||
char_ = *textPrinter->printerTemplate.currentChar++;
|
||||
switch (char_)
|
||||
{
|
||||
case EOS:
|
||||
return 1;
|
||||
case CHAR_NEWLINE:
|
||||
textPrinter->subPrinter.currentX = textPrinter->subPrinter.x;
|
||||
textPrinter->subPrinter.currentY += gFonts[textPrinter->subPrinter.fontId].maxLetterHeight + textPrinter->subPrinter.lineSpacing;
|
||||
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
|
||||
textPrinter->printerTemplate.currentY += gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing;
|
||||
return 2;
|
||||
case PLACEHOLDER_BEGIN:
|
||||
textPrinter->subPrinter.currentChar++;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case EXT_CTRL_CODE_BEGIN:
|
||||
char_ = *textPrinter->subPrinter.currentChar++;
|
||||
char_ = *textPrinter->printerTemplate.currentChar++;
|
||||
switch (char_)
|
||||
{
|
||||
case 1:
|
||||
textPrinter->subPrinter.fgColor = *textPrinter->subPrinter.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
|
||||
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 2:
|
||||
textPrinter->subPrinter.bgColor = *textPrinter->subPrinter.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
|
||||
textPrinter->printerTemplate.bgColor = *textPrinter->printerTemplate.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 3:
|
||||
textPrinter->subPrinter.shadowColor = *textPrinter->subPrinter.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
|
||||
textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 4:
|
||||
textPrinter->subPrinter.fgColor = *textPrinter->subPrinter.currentChar;
|
||||
textPrinter->subPrinter.bgColor = *++textPrinter->subPrinter.currentChar;
|
||||
textPrinter->subPrinter.shadowColor = *++textPrinter->subPrinter.currentChar;
|
||||
textPrinter->subPrinter.currentChar++;
|
||||
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.bgColor = *++textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.shadowColor = *++textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
|
||||
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 5:
|
||||
textPrinter->subPrinter.currentChar++;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 6:
|
||||
sub->font_type = *textPrinter->subPrinter.currentChar;
|
||||
textPrinter->subPrinter.currentChar++;
|
||||
sub->glyphId = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 7:
|
||||
return 2;
|
||||
case 8:
|
||||
textPrinter->delayCounter = *textPrinter->subPrinter.currentChar++;
|
||||
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar++;
|
||||
textPrinter->state = 6;
|
||||
return 2;
|
||||
case 9:
|
||||
textPrinter->state = 1;
|
||||
if (gTextFlags.autoScroll)
|
||||
{
|
||||
sub->frames_visible_counter = 0;
|
||||
sub->autoScrollDelay = 0;
|
||||
}
|
||||
return 3;
|
||||
case 10:
|
||||
@@ -104,19 +104,19 @@ u16 Font6Func(struct TextPrinter *textPrinter)
|
||||
return 3;
|
||||
case 11:
|
||||
case 16:
|
||||
textPrinter->subPrinter.currentChar += 2;
|
||||
textPrinter->printerTemplate.currentChar += 2;
|
||||
return 2;
|
||||
case 12:
|
||||
char_ = *++textPrinter->subPrinter.currentChar;
|
||||
char_ = *++textPrinter->printerTemplate.currentChar;
|
||||
break;
|
||||
case 13:
|
||||
textPrinter->subPrinter.currentX = textPrinter->subPrinter.x + *textPrinter->subPrinter.currentChar++;
|
||||
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 14:
|
||||
textPrinter->subPrinter.currentY = textPrinter->subPrinter.y + *textPrinter->subPrinter.currentChar++;
|
||||
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 15:
|
||||
FillWindowPixelBuffer(textPrinter->subPrinter.windowId, PIXEL_FILL(textPrinter->subPrinter.bgColor));
|
||||
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
|
||||
return 2;
|
||||
}
|
||||
break;
|
||||
@@ -129,15 +129,15 @@ u16 Font6Func(struct TextPrinter *textPrinter)
|
||||
TextPrinterInitDownArrowCounters(textPrinter);
|
||||
return 3;
|
||||
case 0xF9:
|
||||
char_ = *textPrinter->subPrinter.currentChar++| 0x100;
|
||||
char_ = *textPrinter->printerTemplate.currentChar++| 0x100;
|
||||
break;
|
||||
case 0xF8:
|
||||
textPrinter->subPrinter.currentChar++;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 0;
|
||||
}
|
||||
DecompressGlyphFont6(char_);
|
||||
CopyGlyphToWindow(textPrinter);
|
||||
textPrinter->subPrinter.currentX += gGlyphInfo[0x80] + textPrinter->subPrinter.letterSpacing;
|
||||
textPrinter->printerTemplate.currentX += gGlyphInfo[0x80] + textPrinter->printerTemplate.letterSpacing;
|
||||
return 0;
|
||||
case 1:
|
||||
if (TextPrinterWait(textPrinter))
|
||||
@@ -148,9 +148,9 @@ u16 Font6Func(struct TextPrinter *textPrinter)
|
||||
case 2:
|
||||
if (TextPrinterWaitWithDownArrow(textPrinter))
|
||||
{
|
||||
FillWindowPixelBuffer(textPrinter->subPrinter.windowId, PIXEL_FILL(textPrinter->subPrinter.bgColor));
|
||||
textPrinter->subPrinter.currentX = textPrinter->subPrinter.x;
|
||||
textPrinter->subPrinter.currentY = textPrinter->subPrinter.y;
|
||||
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
|
||||
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
|
||||
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y;
|
||||
textPrinter->state = 0;
|
||||
}
|
||||
return 3;
|
||||
@@ -158,8 +158,8 @@ u16 Font6Func(struct TextPrinter *textPrinter)
|
||||
if (TextPrinterWaitWithDownArrow(textPrinter))
|
||||
{
|
||||
TextPrinterClearDownArrow(textPrinter);
|
||||
textPrinter->scrollDistance = gFonts[textPrinter->subPrinter.fontId].maxLetterHeight + textPrinter->subPrinter.lineSpacing;
|
||||
textPrinter->subPrinter.currentX = textPrinter->subPrinter.x;
|
||||
textPrinter->scrollDistance = gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing;
|
||||
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
|
||||
textPrinter->state = 4;
|
||||
}
|
||||
return 3;
|
||||
@@ -168,15 +168,15 @@ u16 Font6Func(struct TextPrinter *textPrinter)
|
||||
{
|
||||
if (textPrinter->scrollDistance < gUnknown_846FB08[gSaveBlock2Ptr->optionsTextSpeed])
|
||||
{
|
||||
ScrollWindow(textPrinter->subPrinter.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->subPrinter.bgColor));
|
||||
ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
|
||||
textPrinter->scrollDistance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScrollWindow(textPrinter->subPrinter.windowId, 0, gUnknown_846FB08[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->subPrinter.bgColor));
|
||||
ScrollWindow(textPrinter->printerTemplate.windowId, 0, gUnknown_846FB08[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor));
|
||||
textPrinter->scrollDistance -= gUnknown_846FB08[gSaveBlock2Ptr->optionsTextSpeed];
|
||||
}
|
||||
CopyWindowToVram(textPrinter->subPrinter.windowId, 2);
|
||||
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -216,7 +216,7 @@ static void DecompressGlyphFont6(u16 glyph)
|
||||
gGlyphInfo[0x81] = 0x10;
|
||||
}
|
||||
|
||||
u32 GetGlyphWidthFont6(u16 font_type, bool32 isJapanese)
|
||||
s32 GetGlyphWidthFont6(u16 font_type, bool32 isJapanese)
|
||||
{
|
||||
return 0x10;
|
||||
}
|
||||
|
||||
+2167
File diff suppressed because it is too large
Load Diff
+69
-254
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "text.h"
|
||||
#include "blit.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "task.h"
|
||||
#include "wild_encounter.h"
|
||||
@@ -502,261 +503,75 @@ void sub_812E6DC(u8 windowId, const u8 * src, u16 x, u16 y)
|
||||
}
|
||||
}
|
||||
|
||||
// Yeah, no, I'm not bothering with this
|
||||
NAKED
|
||||
static void sub_812E768(void * a0, void * a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7)
|
||||
static void sub_812E768(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height)
|
||||
{
|
||||
asm_unified("\tpush {r4-r7,lr}\n"
|
||||
"\tmov r7, r10\n"
|
||||
"\tmov r6, r9\n"
|
||||
"\tmov r5, r8\n"
|
||||
"\tpush {r5-r7}\n"
|
||||
"\tsub sp, 0x28\n"
|
||||
"\tstr r0, [sp]\n"
|
||||
"\tstr r1, [sp, 0x4]\n"
|
||||
"\tldr r0, [sp, 0x48]\n"
|
||||
"\tldr r4, [sp, 0x4C]\n"
|
||||
"\tldr r1, [sp, 0x50]\n"
|
||||
"\tldr r5, [sp, 0x54]\n"
|
||||
"\tlsls r2, 16\n"
|
||||
"\tlsrs r2, 16\n"
|
||||
"\tstr r2, [sp, 0x8]\n"
|
||||
"\tlsls r3, 16\n"
|
||||
"\tlsrs r3, 16\n"
|
||||
"\tlsls r0, 16\n"
|
||||
"\tlsrs r0, 16\n"
|
||||
"\tstr r0, [sp, 0xC]\n"
|
||||
"\tlsls r4, 16\n"
|
||||
"\tlsrs r4, 16\n"
|
||||
"\tlsls r1, 16\n"
|
||||
"\tlsrs r1, 16\n"
|
||||
"\tlsls r5, 16\n"
|
||||
"\tlsrs r5, 16\n"
|
||||
"\tldr r2, [sp, 0x4]\n"
|
||||
"\tldrh r0, [r2, 0x4]\n"
|
||||
"\tldr r2, [sp, 0xC]\n"
|
||||
"\tsubs r0, r2\n"
|
||||
"\tldr r2, [sp, 0x8]\n"
|
||||
"\tadds r2, r1, r2\n"
|
||||
"\tstr r2, [sp, 0x10]\n"
|
||||
"\tcmp r0, r1\n"
|
||||
"\tbge _0812E7B4\n"
|
||||
"\tldr r1, [sp, 0x8]\n"
|
||||
"\tadds r0, r1\n"
|
||||
"\tstr r0, [sp, 0x10]\n"
|
||||
"_0812E7B4:\n"
|
||||
"\tldr r2, [sp, 0x4]\n"
|
||||
"\tldrh r1, [r2, 0x6]\n"
|
||||
"\tsubs r0, r1, r4\n"
|
||||
"\tcmp r0, r5\n"
|
||||
"\tbge _0812E7C6\n"
|
||||
"\tadds r0, r3, r1\n"
|
||||
"\tsubs r0, r4\n"
|
||||
"\tstr r0, [sp, 0x14]\n"
|
||||
"\tb _0812E7CA\n"
|
||||
"_0812E7C6:\n"
|
||||
"\tadds r5, r3, r5\n"
|
||||
"\tstr r5, [sp, 0x14]\n"
|
||||
"_0812E7CA:\n"
|
||||
"\tldr r0, [sp]\n"
|
||||
"\tldrh r1, [r0, 0x4]\n"
|
||||
"\tmovs r2, 0x7\n"
|
||||
"\tadds r0, r1, 0\n"
|
||||
"\tands r0, r2\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tasrs r1, 3\n"
|
||||
"\tstr r1, [sp, 0x18]\n"
|
||||
"\tldr r0, [sp, 0x4]\n"
|
||||
"\tldrh r1, [r0, 0x4]\n"
|
||||
"\tadds r0, r1, 0\n"
|
||||
"\tands r0, r2\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tasrs r1, 3\n"
|
||||
"\tstr r1, [sp, 0x1C]\n"
|
||||
"\tmov r12, r3\n"
|
||||
"\tmov r8, r4\n"
|
||||
"\tldr r1, [sp, 0x14]\n"
|
||||
"\tcmp r12, r1\n"
|
||||
"\tblt _0812E7F4\n"
|
||||
"\tb _0812E932\n"
|
||||
"_0812E7F4:\n"
|
||||
"\tldr r5, [sp, 0x8]\n"
|
||||
"\tldr r6, [sp, 0xC]\n"
|
||||
"\tmov r2, r12\n"
|
||||
"\tadds r2, 0x1\n"
|
||||
"\tstr r2, [sp, 0x20]\n"
|
||||
"\tmov r0, r8\n"
|
||||
"\tadds r0, 0x1\n"
|
||||
"\tstr r0, [sp, 0x24]\n"
|
||||
"\tldr r1, [sp, 0x10]\n"
|
||||
"\tcmp r5, r1\n"
|
||||
"\tblt _0812E80C\n"
|
||||
"\tb _0812E922\n"
|
||||
"_0812E80C:\n"
|
||||
"\tmovs r7, 0x1\n"
|
||||
"\tmovs r2, 0xF0\n"
|
||||
"\tmov r10, r2\n"
|
||||
"\tmovs r0, 0xF\n"
|
||||
"\tmov r9, r0\n"
|
||||
"_0812E816:\n"
|
||||
"\tasrs r0, r5, 1\n"
|
||||
"\tmovs r1, 0x3\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tldr r2, [sp]\n"
|
||||
"\tldr r1, [r2]\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tasrs r0, r5, 3\n"
|
||||
"\tlsls r0, 5\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tmov r2, r12\n"
|
||||
"\tasrs r0, r2, 3\n"
|
||||
"\tldr r2, [sp, 0x18]\n"
|
||||
"\tmuls r0, r2\n"
|
||||
"\tlsls r0, 5\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tmov r2, r12\n"
|
||||
"\tlsls r0, r2, 29\n"
|
||||
"\tlsrs r0, 27\n"
|
||||
"\tadds r3, r1, r0\n"
|
||||
"\tasrs r0, r6, 1\n"
|
||||
"\tmovs r1, 0x3\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tldr r2, [sp, 0x4]\n"
|
||||
"\tldr r1, [r2]\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tasrs r0, r6, 3\n"
|
||||
"\tlsls r0, 5\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tmov r2, r8\n"
|
||||
"\tasrs r0, r2, 3\n"
|
||||
"\tldr r2, [sp, 0x1C]\n"
|
||||
"\tmuls r0, r2\n"
|
||||
"\tlsls r0, 5\n"
|
||||
"\tadds r1, r0\n"
|
||||
"\tmov r2, r8\n"
|
||||
"\tlsls r0, r2, 29\n"
|
||||
"\tlsrs r0, 27\n"
|
||||
"\tadds r4, r1, r0\n"
|
||||
"\tadds r0, r4, 0\n"
|
||||
"\tands r0, r7\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _0812E8C2\n"
|
||||
"\tsubs r4, 0x1\n"
|
||||
"\tadds r0, r6, 0\n"
|
||||
"\tands r0, r7\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _0812E89A\n"
|
||||
"\tldrh r0, [r4]\n"
|
||||
"\tldr r2, _0812E88C @ =0x00000fff\n"
|
||||
"\tands r2, r0\n"
|
||||
"\tadds r0, r5, 0\n"
|
||||
"\tands r0, r7\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _0812E890\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r10\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tlsls r0, 8\n"
|
||||
"\tb _0812E912\n"
|
||||
"\t.align 2, 0\n"
|
||||
"_0812E88C: .4byte 0x00000fff\n"
|
||||
"_0812E890:\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r9\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tlsls r0, 12\n"
|
||||
"\tb _0812E912\n"
|
||||
"_0812E89A:\n"
|
||||
"\tldrh r0, [r4]\n"
|
||||
"\tldr r2, _0812E8B4 @ =0x0000f0ff\n"
|
||||
"\tands r2, r0\n"
|
||||
"\tadds r0, r5, 0\n"
|
||||
"\tands r0, r7\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _0812E8B8\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r10\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tlsls r0, 4\n"
|
||||
"\tb _0812E912\n"
|
||||
"\t.align 2, 0\n"
|
||||
"_0812E8B4: .4byte 0x0000f0ff\n"
|
||||
"_0812E8B8:\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r9\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tlsls r0, 8\n"
|
||||
"\tb _0812E912\n"
|
||||
"_0812E8C2:\n"
|
||||
"\tadds r0, r6, 0\n"
|
||||
"\tands r0, r7\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _0812E8EE\n"
|
||||
"\tldrh r0, [r4]\n"
|
||||
"\tldr r2, _0812E8E0 @ =0x0000ff0f\n"
|
||||
"\tands r2, r0\n"
|
||||
"\tadds r0, r5, 0\n"
|
||||
"\tands r0, r7\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _0812E8E4\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r10\n"
|
||||
"\tb _0812E910\n"
|
||||
"\t.align 2, 0\n"
|
||||
"_0812E8E0: .4byte 0x0000ff0f\n"
|
||||
"_0812E8E4:\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r9\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tlsls r0, 4\n"
|
||||
"\tb _0812E912\n"
|
||||
"_0812E8EE:\n"
|
||||
"\tldrh r0, [r4]\n"
|
||||
"\tldr r2, _0812E908 @ =0x0000fff0\n"
|
||||
"\tands r2, r0\n"
|
||||
"\tadds r0, r5, 0\n"
|
||||
"\tands r0, r7\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _0812E90C\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r10\n"
|
||||
"\tands r0, r1\n"
|
||||
"\tlsrs r0, 4\n"
|
||||
"\tb _0812E912\n"
|
||||
"\t.align 2, 0\n"
|
||||
"_0812E908: .4byte 0x0000fff0\n"
|
||||
"_0812E90C:\n"
|
||||
"\tldrb r1, [r3]\n"
|
||||
"\tmov r0, r9\n"
|
||||
"_0812E910:\n"
|
||||
"\tands r0, r1\n"
|
||||
"_0812E912:\n"
|
||||
"\torrs r2, r0\n"
|
||||
"\tstrh r2, [r4]\n"
|
||||
"\tadds r5, 0x1\n"
|
||||
"\tadds r6, 0x1\n"
|
||||
"\tldr r0, [sp, 0x10]\n"
|
||||
"\tcmp r5, r0\n"
|
||||
"\tbge _0812E922\n"
|
||||
"\tb _0812E816\n"
|
||||
"_0812E922:\n"
|
||||
"\tldr r1, [sp, 0x20]\n"
|
||||
"\tmov r12, r1\n"
|
||||
"\tldr r2, [sp, 0x24]\n"
|
||||
"\tmov r8, r2\n"
|
||||
"\tldr r0, [sp, 0x14]\n"
|
||||
"\tcmp r12, r0\n"
|
||||
"\tbge _0812E932\n"
|
||||
"\tb _0812E7F4\n"
|
||||
"_0812E932:\n"
|
||||
"\tadd sp, 0x28\n"
|
||||
"\tpop {r3-r5}\n"
|
||||
"\tmov r8, r3\n"
|
||||
"\tmov r9, r4\n"
|
||||
"\tmov r10, r5\n"
|
||||
"\tpop {r4-r7}\n"
|
||||
"\tpop {r0}\n"
|
||||
"\tbx r0");
|
||||
s32 loopSrcY, loopDstY, loopSrcX, loopDstX, xEnd, yEnd, multiplierSrcY, multiplierDstY;
|
||||
u16 toOrr;
|
||||
const u8 *pixelsSrc;
|
||||
u16 *pixelsDst;
|
||||
|
||||
if (dst->width - dstX < width)
|
||||
xEnd = dst->width - dstX + srcX;
|
||||
else
|
||||
xEnd = width + srcX;
|
||||
|
||||
if (dst->height - dstY < height)
|
||||
yEnd = srcY + dst->height - dstY;
|
||||
else
|
||||
yEnd = srcY + height;
|
||||
multiplierSrcY = (src->width + (src->width & 7)) >> 3;
|
||||
multiplierDstY = (dst->width + (dst->width & 7)) >> 3;
|
||||
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
|
||||
{
|
||||
for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++)
|
||||
{
|
||||
#ifndef NONMATCHING
|
||||
asm("":::"r4");
|
||||
#endif
|
||||
pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1B);
|
||||
pixelsDst = (u16 *)(dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + ((( loopDstY >> 3) * multiplierDstY) << 5) + ((u32)( loopDstY << 0x1d) >> 0x1B));
|
||||
|
||||
if ((uintptr_t)pixelsDst & 0x1)
|
||||
{
|
||||
pixelsDst = (void *)pixelsDst - 1;
|
||||
if (loopDstX & 0x1)
|
||||
{
|
||||
toOrr = *pixelsDst & 0x0fff;
|
||||
if (loopSrcX & 0x1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 8);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 12);
|
||||
}
|
||||
else
|
||||
{
|
||||
toOrr = *pixelsDst & 0xf0ff;
|
||||
if (loopSrcX & 0x1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 4);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 8);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (loopDstX & 1)
|
||||
{
|
||||
toOrr = *pixelsDst & 0xff0f;
|
||||
if (loopSrcX & 1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 0);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
toOrr = *pixelsDst & 0xfff0;
|
||||
if (loopSrcX & 1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) >> 4);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) >> 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define tEvA data[0]
|
||||
|
||||
+2
-2
@@ -871,7 +871,7 @@ void sub_8110F90(u8 unused)
|
||||
gSaveBlock1Ptr->location.mapNum = 19;
|
||||
gSaveBlock1Ptr->location.warpId = -1;
|
||||
gUnknown_203ADF8 = 0;
|
||||
gUnknown_2031DD8 = 1;
|
||||
gDisableMapMusicChangeOnMapLoad = 1;
|
||||
sub_8082740(1);
|
||||
sub_8111368();
|
||||
}
|
||||
@@ -1567,7 +1567,7 @@ void sub_81120AC(u8 taskId)
|
||||
switch (data[0])
|
||||
{
|
||||
case 0:
|
||||
gUnknown_2031DD8 = 0;
|
||||
gDisableMapMusicChangeOnMapLoad = 0;
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
sub_811229C();
|
||||
FillWindowPixelRect(gUnknown_203ADFE[0], 0xF, 0, 0, gUnknown_845661C[0].width * 8, gUnknown_845661C[0].height * 8);
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ struct Fanfare
|
||||
};
|
||||
|
||||
// TODO: what are these
|
||||
extern u8 gUnknown_2031DD8;
|
||||
extern u8 gDisableMapMusicChangeOnMapLoad;
|
||||
extern u8 gUnknown_203ADFA;
|
||||
extern u8 gUnknown_203F174;
|
||||
|
||||
@@ -571,7 +571,7 @@ void PlayBGM(u16 songNum)
|
||||
|
||||
void PlaySE(u16 songNum)
|
||||
{
|
||||
if(gUnknown_2031DD8 == 0 && gUnknown_203ADFA != 2)
|
||||
if(gDisableMapMusicChangeOnMapLoad == 0 && gUnknown_203ADFA != 2)
|
||||
m4aSongNumStart(songNum);
|
||||
}
|
||||
|
||||
|
||||
+351
-833
File diff suppressed because it is too large
Load Diff
+30
-30
@@ -45,27 +45,27 @@ void DeactivateAllTextPrinters (void)
|
||||
{
|
||||
int printer;
|
||||
for (printer = 0; printer < NUM_TEXT_PRINTERS; ++printer)
|
||||
sTextPrinters[printer].sub_union.sub.active = 0;
|
||||
sTextPrinters[printer].active = 0;
|
||||
}
|
||||
|
||||
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
|
||||
{
|
||||
struct TextPrinterTemplate subPrinter;
|
||||
struct TextPrinterTemplate printerTemplate;
|
||||
|
||||
subPrinter.currentChar = str;
|
||||
subPrinter.windowId = windowId;
|
||||
subPrinter.fontId = fontId;
|
||||
subPrinter.x = x;
|
||||
subPrinter.y = y;
|
||||
subPrinter.currentX = x;
|
||||
subPrinter.currentY = y;
|
||||
subPrinter.letterSpacing = gFonts[fontId].letterSpacing;
|
||||
subPrinter.lineSpacing = gFonts[fontId].lineSpacing;
|
||||
subPrinter.unk = gFonts[fontId].unk;
|
||||
subPrinter.fgColor = gFonts[fontId].fgColor;
|
||||
subPrinter.bgColor = gFonts[fontId].bgColor;
|
||||
subPrinter.shadowColor = gFonts[fontId].shadowColor;
|
||||
return AddTextPrinter(&subPrinter, speed, callback);
|
||||
printerTemplate.currentChar = str;
|
||||
printerTemplate.windowId = windowId;
|
||||
printerTemplate.fontId = fontId;
|
||||
printerTemplate.x = x;
|
||||
printerTemplate.y = y;
|
||||
printerTemplate.currentX = x;
|
||||
printerTemplate.currentY = y;
|
||||
printerTemplate.letterSpacing = gFonts[fontId].letterSpacing;
|
||||
printerTemplate.lineSpacing = gFonts[fontId].lineSpacing;
|
||||
printerTemplate.unk = gFonts[fontId].unk;
|
||||
printerTemplate.fgColor = gFonts[fontId].fgColor;
|
||||
printerTemplate.bgColor = gFonts[fontId].bgColor;
|
||||
printerTemplate.shadowColor = gFonts[fontId].shadowColor;
|
||||
return AddTextPrinter(&printerTemplate, speed, callback);
|
||||
}
|
||||
|
||||
bool16 AddTextPrinter(struct TextPrinterTemplate *textSubPrinter, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
|
||||
@@ -76,18 +76,18 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *textSubPrinter, u8 speed, void
|
||||
if (!gFonts)
|
||||
return FALSE;
|
||||
|
||||
sTempTextPrinter.sub_union.sub.active = 1;
|
||||
sTempTextPrinter.active = 1;
|
||||
sTempTextPrinter.state = 0;
|
||||
sTempTextPrinter.text_speed = speed;
|
||||
sTempTextPrinter.textSpeed = speed;
|
||||
sTempTextPrinter.delayCounter = 0;
|
||||
sTempTextPrinter.scrollDistance = 0;
|
||||
|
||||
for (i = 0; i < 7; ++i)
|
||||
{
|
||||
sTempTextPrinter.sub_union.sub_fields[i] = 0;
|
||||
sTempTextPrinter.subUnion.fields[i] = 0;
|
||||
}
|
||||
|
||||
sTempTextPrinter.subPrinter = *textSubPrinter;
|
||||
sTempTextPrinter.printerTemplate = *textSubPrinter;
|
||||
sTempTextPrinter.callback = callback;
|
||||
sTempTextPrinter.minLetterSpacing = 0;
|
||||
sTempTextPrinter.japanese = 0;
|
||||
@@ -95,12 +95,12 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *textSubPrinter, u8 speed, void
|
||||
GenerateFontHalfRowLookupTable(textSubPrinter->fgColor, textSubPrinter->bgColor, textSubPrinter->shadowColor);
|
||||
if (speed != TEXT_SPEED_FF && speed != 0x0)
|
||||
{
|
||||
--sTempTextPrinter.text_speed;
|
||||
--sTempTextPrinter.textSpeed;
|
||||
sTextPrinters[textSubPrinter->windowId] = sTempTextPrinter;
|
||||
}
|
||||
else
|
||||
{
|
||||
sTempTextPrinter.text_speed = 0;
|
||||
sTempTextPrinter.textSpeed = 0;
|
||||
for (j = 0; j < 0x400; ++j)
|
||||
{
|
||||
if ((u32)RenderFont(&sTempTextPrinter) == 1)
|
||||
@@ -108,8 +108,8 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *textSubPrinter, u8 speed, void
|
||||
}
|
||||
|
||||
if (speed != TEXT_SPEED_FF)
|
||||
CopyWindowToVram(sTempTextPrinter.subPrinter.windowId, 2);
|
||||
sTextPrinters[textSubPrinter->windowId].sub_union.sub.active = 0;
|
||||
CopyWindowToVram(sTempTextPrinter.printerTemplate.windowId, 2);
|
||||
sTextPrinters[textSubPrinter->windowId].active = 0;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -121,18 +121,18 @@ void RunTextPrinters(void)
|
||||
|
||||
for (i = 0; i < 0x20; ++i)
|
||||
{
|
||||
if (sTextPrinters[i].sub_union.sub.active != 0)
|
||||
if (sTextPrinters[i].active != 0)
|
||||
{
|
||||
temp = RenderFont(&sTextPrinters[i]);
|
||||
switch (temp) {
|
||||
case 0:
|
||||
CopyWindowToVram(sTextPrinters[i].subPrinter.windowId, 2);
|
||||
CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, 2);
|
||||
case 3:
|
||||
if (sTextPrinters[i].callback != 0)
|
||||
sTextPrinters[i].callback(&sTextPrinters[i].subPrinter, temp);
|
||||
sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, temp);
|
||||
break;
|
||||
case 1:
|
||||
sTextPrinters[i].sub_union.sub.active = 0;
|
||||
sTextPrinters[i].active = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -141,7 +141,7 @@ void RunTextPrinters(void)
|
||||
|
||||
bool16 IsTextPrinterActive(u8 id)
|
||||
{
|
||||
return sTextPrinters[id].sub_union.sub.active;
|
||||
return sTextPrinters[id].active;
|
||||
}
|
||||
|
||||
u32 RenderFont(struct TextPrinter *textPrinter)
|
||||
@@ -149,7 +149,7 @@ u32 RenderFont(struct TextPrinter *textPrinter)
|
||||
u32 ret;
|
||||
while (TRUE)
|
||||
{
|
||||
ret = gFonts[textPrinter->subPrinter.fontId].fontFunction(textPrinter);
|
||||
ret = gFonts[textPrinter->printerTemplate.fontId].fontFunction(textPrinter);
|
||||
if (ret != 2)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ u16 FreeAndDestroyMonPicSprite(u16 spriteId)
|
||||
return FreeAndDestroyPicSpriteInternal(spriteId);
|
||||
}
|
||||
|
||||
u16 sub_810C228(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId)
|
||||
u16 LoadMonPicForCredits(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId)
|
||||
{
|
||||
return sub_810C0C0(species, otId, personality, isFrontPic, 0, 0, paletteSlot, windowId, FALSE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user