diff options
-rw-r--r-- | asm/help_system.s | 192 | ||||
-rw-r--r-- | src/help_system.c | 34 |
2 files changed, 34 insertions, 192 deletions
diff --git a/asm/help_system.s b/asm/help_system.s index f7f16ad30..6ea75c590 100644 --- a/asm/help_system.s +++ b/asm/help_system.s @@ -5,198 +5,6 @@ .text - thumb_func_start sub_813C454 -sub_813C454: @ 813C454 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0x1 - movs r1, 0xF - movs r2, 0x2 - bl GenerateFontHalfRowLookupTable - ldr r1, _0813C484 @ =gDecompressionBuffer + 0x3D00 - movs r2, 0x2 - str r2, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0x5 - adds r2, r4, 0 - movs r3, 0x6 - bl HelpSystemRenderText - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0813C484: .4byte gDecompressionBuffer + 0x3D00 - thumb_func_end sub_813C454 - - thumb_func_start sub_813C488 -sub_813C488: @ 813C488 - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - movs r4, 0x7C - subs r4, r0 - movs r0, 0x1 - movs r1, 0xF - movs r2, 0x2 - bl GenerateFontHalfRowLookupTable - ldr r1, _0813C4C8 @ =gDecompressionBuffer + 0x3400 - lsls r4, 24 - lsrs r4, 24 - movs r2, 0x2 - str r2, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl HelpSystemRenderText - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_0813C4C8: .4byte gDecompressionBuffer + 0x3400 - thumb_func_end sub_813C488 - - thumb_func_start sub_813C4CC -sub_813C4CC: @ 813C4CC - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0xF - movs r2, 0x2 - bl GenerateFontHalfRowLookupTable - ldr r1, _0813C508 @ =gDecompressionBuffer - str r4, [sp] - movs r0, 0x1A - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - adds r2, r6, 0 - adds r3, r5, 0 - bl HelpSystemRenderText - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_0813C508: .4byte gDecompressionBuffer - thumb_func_end sub_813C4CC - - thumb_func_start sub_813C50C -sub_813C50C: @ 813C50C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - mov r8, r0 - mov r9, r1 - add r1, sp, 0xC - ldr r2, _0813C578 @ =0x0000eeee - adds r0, r2, 0 - strh r0, [r1] - ldr r4, _0813C57C @ =gDecompressionBuffer - ldr r2, _0813C580 @ =0x01001a00 - adds r0, r1, 0 - adds r1, r4, 0 - bl CpuSet - movs r0, 0x1 - movs r1, 0xE - movs r2, 0x2 - bl GenerateFontHalfRowLookupTable - movs r6, 0 - str r6, [sp] - movs r5, 0x1A - str r5, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - adds r1, r4, 0 - mov r2, r8 - movs r3, 0 - bl HelpSystemRenderText - movs r0, 0x9C - lsls r0, 4 - adds r4, r0 - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0xD - str r0, [sp, 0x8] - movs r0, 0x2 - adds r1, r4, 0 - mov r2, r9 - movs r3, 0 - bl HelpSystemRenderText - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_0813C578: .4byte 0x0000eeee -_0813C57C: .4byte gDecompressionBuffer -_0813C580: .4byte 0x01001a00 - thumb_func_end sub_813C50C - - thumb_func_start sub_813C584 -sub_813C584: @ 813C584 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - add r1, sp, 0xC - ldr r2, _0813C5C8 @ =0x00001111 - adds r0, r2, 0 - strh r0, [r1] - ldr r4, _0813C5CC @ =gDecompressionBuffer + 0x23C0 - ldr r2, _0813C5D0 @ =0x01000820 - adds r0, r1, 0 - adds r1, r4, 0 - bl CpuSet - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x3 - bl GenerateFontHalfRowLookupTable - movs r0, 0x6 - str r0, [sp] - movs r0, 0x1A - str r0, [sp, 0x4] - movs r0, 0x5 - str r0, [sp, 0x8] - movs r0, 0x2 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x2 - bl HelpSystemRenderText - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_0813C5C8: .4byte 0x00001111 -_0813C5CC: .4byte gDecompressionBuffer + 0x23C0 -_0813C5D0: .4byte 0x01000820 - thumb_func_end sub_813C584 - thumb_func_start sub_813C5D4 sub_813C5D4: @ 813C5D4 push {lr} diff --git a/src/help_system.c b/src/help_system.c index afa99c358..7cabce50b 100644 --- a/src/help_system.c +++ b/src/help_system.c @@ -957,3 +957,37 @@ void sub_813C3AC(u8 font, u16 glyph, struct Bitmap *srcBlit, struct Bitmap *dest destBlit->height = height * 8; BlitBitmapRect4Bit(srcBlit, destBlit, 0, 0, x, y, gGlyphInfo[0x80], gGlyphInfo[0x81], 0); } + +void sub_813C454(const u8 * str) +{ + GenerateFontHalfRowLookupTable(1, 15, 2); + HelpSystemRenderText(5, gDecompressionBuffer + 0x3D00, str, 6, 2, 7, 2); +} + +void sub_813C488(const u8 * str) +{ + s32 left = 0x7C - GetStringWidth(0, str, 0); + GenerateFontHalfRowLookupTable(1, 15, 2); + HelpSystemRenderText(0, gDecompressionBuffer + 0x3400, str, left, 2, 16, 2); +} + +void sub_813C4CC(const u8 * str, u8 x, u8 y) +{ + GenerateFontHalfRowLookupTable(1, 15, 2); + HelpSystemRenderText(2, gDecompressionBuffer + 0x0000, str, x, y, 26, 16); +} + +void sub_813C50C(const u8 * str1, const u8 * str2) +{ + CpuFill16(0xEEEE, gDecompressionBuffer + 0x0000, 0x3400); + GenerateFontHalfRowLookupTable(1, 14, 2); + HelpSystemRenderText(2, gDecompressionBuffer + 0x0000, str1, 0, 0, 26, 16); + HelpSystemRenderText(2, gDecompressionBuffer + 0x09C0, str2, 0, 0, 26, 13); +} + +void sub_813C584(const u8 * str) +{ + CpuFill16(0x1111, gDecompressionBuffer + 0x23C0, 0x1040); + GenerateFontHalfRowLookupTable(2, 1, 3); + HelpSystemRenderText(2, gDecompressionBuffer + 0x23C0, str, 2, 6, 26, 5); +} |