nonmatching sub_8112F18
This commit is contained in:
+146
-1
@@ -2040,7 +2040,7 @@ void sub_8112E3C(u8 a0, struct UnkStruct_300201C * a1, u16 a2)
|
||||
}
|
||||
}
|
||||
|
||||
const u16 gUnknown_84566A8[] = INCBIN_U16("data/graphics/unknown_84566a8.bin");
|
||||
const u16 gUnknown_84566A8[][16] = INCBIN_U16("data/graphics/unknown_84566a8.bin");
|
||||
|
||||
const struct WindowTemplate gUnknown_8456928 = {
|
||||
0x00, 0, 15, 30, 5, 15, 0x008F
|
||||
@@ -2060,3 +2060,148 @@ u8 sub_8112EB4(void)
|
||||
}
|
||||
return gUnknown_203B020;
|
||||
}
|
||||
|
||||
void sub_8112EDC(u8 a0)
|
||||
{
|
||||
if (gUnknown_203B020 != 0xFF)
|
||||
{
|
||||
FillWindowPixelBuffer(gUnknown_203B020, 0x00);
|
||||
ClearWindowTilemap(gUnknown_203B020);
|
||||
|
||||
if (a0)
|
||||
CopyWindowToVram(gUnknown_203B020, a0);
|
||||
|
||||
RemoveWindow(gUnknown_203B020);
|
||||
gUnknown_203B020 = 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void sub_8112F18(u8 a0)
|
||||
{
|
||||
u8 width = GetWindowAttribute(a0, WINDOW_WIDTH);
|
||||
u8 height = GetWindowAttribute(a0, WINDOW_HEIGHT);
|
||||
u8 * buffer = Alloc(32 * width * height);
|
||||
u8 i, j;
|
||||
u8 k;
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
for (j = 0; j < width; j++)
|
||||
{
|
||||
if (i == 0)
|
||||
k = 0;
|
||||
else if (i == height - 1)
|
||||
k = 14;
|
||||
else
|
||||
k = 5;
|
||||
CpuCopy32(
|
||||
gUnknown_84566A8[k], // operand swap on "add" instruction
|
||||
buffer + 32 * (i * width + j),
|
||||
32
|
||||
);
|
||||
}
|
||||
}
|
||||
CopyToWindowPixelBuffer(a0, buffer, width * height * 32, 0);
|
||||
Free(buffer);
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_8112F18(u8 a0)
|
||||
{
|
||||
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, 0x8\n"
|
||||
"\tlsls r0, 24\n"
|
||||
"\tlsrs r0, 24\n"
|
||||
"\tmov r10, r0\n"
|
||||
"\tmovs r1, 0x3\n"
|
||||
"\tbl GetWindowAttribute\n"
|
||||
"\tlsls r0, 24\n"
|
||||
"\tlsrs r6, r0, 24\n"
|
||||
"\tmov r0, r10\n"
|
||||
"\tmovs r1, 0x4\n"
|
||||
"\tbl GetWindowAttribute\n"
|
||||
"\tlsls r0, 24\n"
|
||||
"\tlsrs r7, r0, 24\n"
|
||||
"\tlsls r0, r7, 5\n"
|
||||
"\tmuls r0, r6\n"
|
||||
"\tbl Alloc\n"
|
||||
"\tmov r8, r0\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _08112FB8\n"
|
||||
"\tmovs r5, 0\n"
|
||||
"\tadds r0, r6, 0\n"
|
||||
"\tmuls r0, r7\n"
|
||||
"\tstr r0, [sp]\n"
|
||||
"\tcmp r5, r7\n"
|
||||
"\tbcs _08112FA2\n"
|
||||
"_08112F5A:\n"
|
||||
"\tmovs r4, 0\n"
|
||||
"\tadds r1, r5, 0x1\n"
|
||||
"\tmov r9, r1\n"
|
||||
"\tcmp r4, r6\n"
|
||||
"\tbcs _08112F98\n"
|
||||
"\tsubs r3, r7, 0x1\n"
|
||||
"_08112F66:\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tcmp r5, 0\n"
|
||||
"\tbeq _08112F74\n"
|
||||
"\tmovs r0, 0x5\n"
|
||||
"\tcmp r5, r3\n"
|
||||
"\tbne _08112F74\n"
|
||||
"\tmovs r0, 0xE\n"
|
||||
"_08112F74:\n"
|
||||
"\tlsls r0, 5\n"
|
||||
"\tldr r1, _08112FC8 @ =gUnknown_84566A8\n"
|
||||
"\tadds r0, r1, r0\n"
|
||||
"\tadds r1, r5, 0\n"
|
||||
"\tmuls r1, r6\n"
|
||||
"\tadds r1, r4\n"
|
||||
"\tlsls r1, 5\n"
|
||||
"\tadd r1, r8\n"
|
||||
"\tldr r2, _08112FCC @ =0x04000008\n"
|
||||
"\tstr r3, [sp, 0x4]\n"
|
||||
"\tbl CpuSet\n"
|
||||
"\tadds r0, r4, 0x1\n"
|
||||
"\tlsls r0, 24\n"
|
||||
"\tlsrs r4, r0, 24\n"
|
||||
"\tldr r3, [sp, 0x4]\n"
|
||||
"\tcmp r4, r6\n"
|
||||
"\tbcc _08112F66\n"
|
||||
"_08112F98:\n"
|
||||
"\tmov r1, r9\n"
|
||||
"\tlsls r0, r1, 24\n"
|
||||
"\tlsrs r5, r0, 24\n"
|
||||
"\tcmp r5, r7\n"
|
||||
"\tbcc _08112F5A\n"
|
||||
"_08112FA2:\n"
|
||||
"\tldr r0, [sp]\n"
|
||||
"\tlsls r2, r0, 21\n"
|
||||
"\tlsrs r2, 16\n"
|
||||
"\tmov r0, r10\n"
|
||||
"\tmov r1, r8\n"
|
||||
"\tmovs r3, 0\n"
|
||||
"\tbl CopyToWindowPixelBuffer\n"
|
||||
"\tmov r0, r8\n"
|
||||
"\tbl Free\n"
|
||||
"_08112FB8:\n"
|
||||
"\tadd sp, 0x8\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\n"
|
||||
"\t.align 2, 0\n"
|
||||
"_08112FC8: .4byte gUnknown_84566A8\n"
|
||||
"_08112FCC: .4byte 0x04000008");
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user