mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 13:53:52 +01:00
match berry fix func
This commit is contained in:
parent
96ab6f8353
commit
b3a94a359f
@ -217,10 +217,9 @@ static void berry_fix_main(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
static void berry_fix_gpu_set(void)
|
||||
{
|
||||
s32 width;
|
||||
s32 width, left;
|
||||
|
||||
SetGpuReg(REG_OFFSET_BG0CNT, 0x0000);
|
||||
SetGpuReg(REG_OFFSET_BG1CNT, 0x0000);
|
||||
@ -249,230 +248,27 @@ static void berry_fix_gpu_set(void)
|
||||
FillWindowPixelBuffer(3, 0);
|
||||
FillWindowPixelBuffer(0, 0xAA);
|
||||
|
||||
// This block is a meme among memes
|
||||
width = (0x78 - GetStringWidth(0, sUnknown_08617E9B, 0)) / 2;
|
||||
box_print(2, 0, width, 3, sUnknown_0861815B, -1, sUnknown_08617E9B);
|
||||
width = (s32)(0x78 - GetStringWidth(0, sUnknown_08617E9B, 0)) / 2 + 0x78;
|
||||
box_print(2, 0, width, 3, sUnknown_0861815B, -1, sUnknown_08617E8D);
|
||||
width = (0x70 - GetStringWidth(0, sUnknown_08617E8D, 0)) / 2;
|
||||
box_print(3, 0, width, 0, sUnknown_0861815B, -1, sUnknown_08617E8D);
|
||||
width = (0xd0 - GetStringWidth(1, sUnknown_08617E78, 0)) / 2;
|
||||
box_print(0, 1, width, 2, sUnknown_08618158, -1, sUnknown_08617E78);
|
||||
width = GetStringWidth(0, sUnknown_08617E9B, 0);
|
||||
left = (0x78 - width) / 2;
|
||||
box_print(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E9B);
|
||||
|
||||
width = GetStringWidth(0, sUnknown_08617E8D, 0);
|
||||
left = (0x78 - width) / 2 + 0x78;
|
||||
box_print(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D);
|
||||
|
||||
width = GetStringWidth(0, sUnknown_08617E8D, 0);
|
||||
left = (0x70 - width) / 2;
|
||||
box_print(3, 0, left, 0, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D);
|
||||
|
||||
width = GetStringWidth(1, sUnknown_08617E78, 0);
|
||||
left = (0xD0 - width) / 2;
|
||||
box_print(0, 1, left, 2, sUnknown_08618158, TEXT_SPEED_FF, sUnknown_08617E78);
|
||||
|
||||
CopyWindowToVram(2, 2);
|
||||
CopyWindowToVram(3, 2);
|
||||
CopyWindowToVram(0, 2);
|
||||
}
|
||||
|
||||
#else
|
||||
__attribute__((naked)) static void berry_fix_gpu_set(void)
|
||||
{
|
||||
asm(".syntax unified\n"
|
||||
"\tpush {r4-r6,lr}\n"
|
||||
"\tmov r6, r8\n"
|
||||
"\tpush {r6}\n"
|
||||
"\tsub sp, 0x10\n"
|
||||
"\tmovs r0, 0x8\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0xA\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x10\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x12\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x14\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x16\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x50\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tstr r1, [sp, 0xC]\n"
|
||||
"\tldr r4, =0x040000d4\n"
|
||||
"\tadd r0, sp, 0xC\n"
|
||||
"\tstr r0, [r4]\n"
|
||||
"\tmovs r0, 0xC0\n"
|
||||
"\tlsls r0, 19\n"
|
||||
"\tstr r0, [r4, 0x4]\n"
|
||||
"\tldr r0, =0x85006000\n"
|
||||
"\tstr r0, [r4, 0x8]\n"
|
||||
"\tldr r0, [r4, 0x8]\n"
|
||||
"\tstr r1, [sp, 0xC]\n"
|
||||
"\tadd r0, sp, 0xC\n"
|
||||
"\tstr r0, [r4]\n"
|
||||
"\tmovs r0, 0xE0\n"
|
||||
"\tlsls r0, 19\n"
|
||||
"\tstr r0, [r4, 0x4]\n"
|
||||
"\tldr r2, =0x85000100\n"
|
||||
"\tstr r2, [r4, 0x8]\n"
|
||||
"\tldr r0, [r4, 0x8]\n"
|
||||
"\tstr r1, [sp, 0xC]\n"
|
||||
"\tadd r0, sp, 0xC\n"
|
||||
"\tstr r0, [r4]\n"
|
||||
"\tmovs r0, 0xA0\n"
|
||||
"\tlsls r0, 19\n"
|
||||
"\tstr r0, [r4, 0x4]\n"
|
||||
"\tstr r2, [r4, 0x8]\n"
|
||||
"\tldr r0, [r4, 0x8]\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tbl ResetBgsAndClearDma3BusyFlags\n"
|
||||
"\tldr r1, =gUnknown_08618108\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tmovs r2, 0x2\n"
|
||||
"\tbl InitBgsFromTemplates\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl ChangeBgX\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl ChangeBgY\n"
|
||||
"\tmovs r0, 0x1\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl ChangeBgX\n"
|
||||
"\tmovs r0, 0x1\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl ChangeBgY\n"
|
||||
"\tldr r0, =gUnknown_08618110\n"
|
||||
"\tbl InitWindows\n"
|
||||
"\tbl DeactivateAllTextPrinters\n"
|
||||
"\tldr r0, =sUnknown_08618138\n"
|
||||
"\tstr r0, [r4]\n"
|
||||
"\tldr r0, =0x050001e0\n"
|
||||
"\tstr r0, [r4, 0x4]\n"
|
||||
"\tldr r0, =0x84000008\n"
|
||||
"\tstr r0, [r4, 0x8]\n"
|
||||
"\tldr r0, [r4, 0x8]\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tmovs r1, 0x40\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x2\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl FillWindowPixelBuffer\n"
|
||||
"\tmovs r0, 0x3\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl FillWindowPixelBuffer\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tmovs r1, 0xAA\n"
|
||||
"\tbl FillWindowPixelBuffer\n"
|
||||
"\tldr r5, =sUnknown_08617E9B\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tadds r1, r5, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl GetStringWidth\n"
|
||||
"\tadds r1, r0, 0\n"
|
||||
"\tmovs r4, 0x78\n"
|
||||
"\tsubs r0, r4, r1\n"
|
||||
"\tlsrs r1, r0, 31\n"
|
||||
"\tadds r0, r1\n"
|
||||
"\tasrs r0, 1\n"
|
||||
"\tlsls r2, r0, 24\n"
|
||||
"\tlsrs r2, 24\n"
|
||||
"\tldr r6, =sUnknown_0861815B\n"
|
||||
"\tstr r6, [sp]\n"
|
||||
"\tmovs r0, 0x1\n"
|
||||
"\tnegs r0, r0\n"
|
||||
"\tmov r8, r0\n"
|
||||
"\tstr r0, [sp, 0x4]\n"
|
||||
"\tstr r5, [sp, 0x8]\n"
|
||||
"\tmovs r0, 0x2\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r3, 0x3\n"
|
||||
"\tbl box_print\n"
|
||||
"\tldr r5, =sUnknown_08617E8D\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tadds r1, r5, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl GetStringWidth\n"
|
||||
"\tadds r1, r0, 0\n"
|
||||
"\tsubs r4, r1\n"
|
||||
"\tlsrs r0, r4, 31\n"
|
||||
"\tadds r4, r0\n"
|
||||
"\tasrs r4, 1\n"
|
||||
"\tadds r0, r4, 0\n"
|
||||
"\tadds r0, 0x78\n"
|
||||
"\tlsls r2, r0, 24\n"
|
||||
"\tlsrs r2, 24\n"
|
||||
"\tstr r6, [sp]\n"
|
||||
"\tmov r0, r8\n"
|
||||
"\tstr r0, [sp, 0x4]\n"
|
||||
"\tstr r5, [sp, 0x8]\n"
|
||||
"\tmovs r0, 0x2\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r3, 0x3\n"
|
||||
"\tbl box_print\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tadds r1, r5, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl GetStringWidth\n"
|
||||
"\tadds r1, r0, 0\n"
|
||||
"\tmovs r0, 0x70\n"
|
||||
"\tsubs r0, r1\n"
|
||||
"\tlsrs r1, r0, 31\n"
|
||||
"\tadds r0, r1\n"
|
||||
"\tasrs r0, 1\n"
|
||||
"\tlsls r2, r0, 24\n"
|
||||
"\tlsrs r2, 24\n"
|
||||
"\tstr r6, [sp]\n"
|
||||
"\tmov r0, r8\n"
|
||||
"\tstr r0, [sp, 0x4]\n"
|
||||
"\tstr r5, [sp, 0x8]\n"
|
||||
"\tmovs r0, 0x3\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r3, 0\n"
|
||||
"\tbl box_print\n"
|
||||
"\tldr r4, =sUnknown_08617E78\n"
|
||||
"\tmovs r0, 0x1\n"
|
||||
"\tadds r1, r4, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl GetStringWidth\n"
|
||||
"\tadds r1, r0, 0\n"
|
||||
"\tmovs r0, 0xD0\n"
|
||||
"\tsubs r0, r1\n"
|
||||
"\tlsrs r1, r0, 31\n"
|
||||
"\tadds r0, r1\n"
|
||||
"\tasrs r0, 1\n"
|
||||
"\tlsls r2, r0, 24\n"
|
||||
"\tlsrs r2, 24\n"
|
||||
"\tldr r0, =sUnknown_08618158\n"
|
||||
"\tstr r0, [sp]\n"
|
||||
"\tmov r0, r8\n"
|
||||
"\tstr r0, [sp, 0x4]\n"
|
||||
"\tstr r4, [sp, 0x8]\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tmovs r1, 0x1\n"
|
||||
"\tmovs r3, 0x2\n"
|
||||
"\tbl box_print\n"
|
||||
"\tmovs r0, 0x2\n"
|
||||
"\tmovs r1, 0x2\n"
|
||||
"\tbl CopyWindowToVram\n"
|
||||
"\tmovs r0, 0x3\n"
|
||||
"\tmovs r1, 0x2\n"
|
||||
"\tbl CopyWindowToVram\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tmovs r1, 0x2\n"
|
||||
"\tbl CopyWindowToVram\n"
|
||||
"\tadd sp, 0x10\n"
|
||||
"\tpop {r3}\n"
|
||||
"\tmov r8, r3\n"
|
||||
"\tpop {r4-r6}\n"
|
||||
"\tpop {r0}\n"
|
||||
"\tbx r0\n"
|
||||
"\t.pool\n"
|
||||
".syntax divided");
|
||||
}
|
||||
#endif
|
||||
|
||||
static int berry_fix_text_update(int checkval)
|
||||
{
|
||||
if (berry_fix_mb_manager->unk1 == checkval)
|
||||
@ -522,7 +318,7 @@ static void berry_fix_text_print(int scene)
|
||||
ShowBg(1);
|
||||
}
|
||||
|
||||
static void berry_fix_bg_hide()
|
||||
static void berry_fix_bg_hide(void)
|
||||
{
|
||||
HideBg(0);
|
||||
HideBg(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user