diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-01-01 13:25:46 +0200 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-01-01 13:25:46 +0200 |
| commit | 09de51bef2ea46b2e6068e07157d464fa54be6b3 (patch) | |
| tree | 1cd48e48ec3fc401f53b1b1a73ee6dd42c4632e3 /src/message.c | |
| parent | 4ca44a90a93e37b8ba45f1d02906011b2b8922f1 (diff) | |
Decompile DispMessageFrame
Diffstat (limited to 'src/message.c')
| -rw-r--r-- | src/message.c | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/src/message.c b/src/message.c index 8f2ff53e..2d68f6f1 100644 --- a/src/message.c +++ b/src/message.c @@ -697,8 +697,50 @@ static void CreateWindow(void) { } // Also used by figurine menu -ASM_FUNC("asm/non_matching/textbox/DispMessageFrame.inc", - void DispMessageFrame(u16* buffer, u32 width_, u32 height_, u32 flags_)) +void DispMessageFrame(u16* buffer, s32 width, s32 height, u32 flags) { + u16* ptr = buffer; + u16* ptr2 = &buffer[(height << 5) + 0x20]; + u32 flags1; + u32 i; + *ptr++ = flags; + *ptr2++ = flags | 0x800; + if (width > 0) { + *ptr++ = flags + 1; + *ptr2++ = (flags + 1) | 0x800; + width -= 2; + while(width-->0){ + *ptr++ = flags + 2; + *ptr2++ = (flags + 2) | 0x800; + } + + *ptr++ = (flags + 1) | (0x80 << 3); + *ptr2++ = (flags + 1) | (0xc0 << 4); + } + + *ptr = flags | 0x400; + *ptr2 = flags | 0xc00; + buffer += 0x20; + ptr += 0x20; + + if (height > 0) { + *buffer = flags + 3; + *ptr = (flags + 3) | 0x400; + buffer += 0x20; + ptr += 0x20; + + height -= 2; + while (height-- > 0) { + *buffer = flags + 4; + *ptr = (flags + 4) | 0x400; + buffer += 0x20; + ptr += 0x20; + } + + + *buffer = (flags + 3) | 0x800; + *ptr++ = (flags + 3) | 0xc00; + } +} /* Each character is two tiles tall. |
