diff options
-rw-r--r-- | arm9/arm9.lsf | 2 | ||||
-rw-r--r-- | arm9/asm/unk_02054590.s | 264 | ||||
-rw-r--r-- | arm9/src/text_02054590.c | 110 | ||||
-rw-r--r-- | include/text_02054590.h | 17 |
4 files changed, 128 insertions, 265 deletions
diff --git a/arm9/arm9.lsf b/arm9/arm9.lsf index 138a74e6..b762561e 100644 --- a/arm9/arm9.lsf +++ b/arm9/arm9.lsf @@ -206,7 +206,7 @@ Static arm9 Object unk_02052EE8.o Object unk_0205363C.o Object unk_02053750.o - Object unk_02054590.o + Object text_02054590.o Object unk_0205478C.o Object unk_02054C14.o Object unk_02055068.o diff --git a/arm9/asm/unk_02054590.s b/arm9/asm/unk_02054590.s deleted file mode 100644 index 6f52c967..00000000 --- a/arm9/asm/unk_02054590.s +++ /dev/null @@ -1,264 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - thumb_func_start FUN_02054590 -FUN_02054590: ; 0x02054590 - push {r4, lr} - add r4, r0, #0x0 - cmp r1, #0x1 - bne _0205459C - bl FUN_0201BD5C -_0205459C: - mov r1, #0x1a - add r0, r4, #0x0 - lsl r1, r1, #0x4 - mov r2, #0x4 - bl FUN_02002ED0 - mov r1, #0x6 - add r0, r4, #0x0 - lsl r1, r1, #0x6 - mov r2, #0x4 - bl FUN_02002EEC - pop {r4, pc} - .balign 4 - - thumb_func_start FUN_020545B8 -FUN_020545B8: ; 0x020545B8 - push {lr} - sub sp, #0x14 - cmp r2, #0x3 - bne _020545E0 - mov r2, #0x13 - str r2, [sp, #0x0] - mov r2, #0x1b - str r2, [sp, #0x4] - mov r2, #0x4 - str r2, [sp, #0x8] - mov r2, #0xc - str r2, [sp, #0xc] - ldr r2, _02054604 ; =0x0000032D - mov r3, #0x2 - str r2, [sp, #0x10] - mov r2, #0x3 - bl FUN_02019064 - add sp, #0x14 - pop {pc} -_020545E0: - mov r2, #0x13 - str r2, [sp, #0x0] - mov r2, #0x1b - str r2, [sp, #0x4] - mov r2, #0x4 - str r2, [sp, #0x8] - mov r2, #0xc - str r2, [sp, #0xc] - mov r2, #0x65 - lsl r2, r2, #0x2 - str r2, [sp, #0x10] - mov r2, #0x7 - mov r3, #0x2 - bl FUN_02019064 - add sp, #0x14 - pop {pc} - nop -_02054604: .word 0x0000032D - - thumb_func_start FUN_02054608 -FUN_02054608: ; 0x02054608 - push {r4-r6, lr} - sub sp, #0x8 - add r4, r1, #0x0 - add r5, r0, #0x0 - bl FUN_0201AB08 - add r6, r0, #0x0 - add r0, r4, #0x0 - bl Options_GetFrame - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - str r0, [sp, #0x0] - mov r0, #0x4 - str r0, [sp, #0x4] - ldr r0, [r5, #0x0] - ldr r2, _02054648 ; =0x000003E2 - add r1, r6, #0x0 - mov r3, #0xa - bl FUN_0200CD68 - add r0, r5, #0x0 - bl FUN_0205464C - ldr r2, _02054648 ; =0x000003E2 - add r0, r5, #0x0 - mov r1, #0x0 - mov r3, #0xa - bl FUN_0200D0BC - add sp, #0x8 - pop {r4-r6, pc} - .balign 4 -_02054648: .word 0x000003E2 - - thumb_func_start FUN_0205464C -FUN_0205464C: ; 0x0205464C - ldr r3, _02054654 ; =FUN_02019620 - mov r1, #0xf - bx r3 - nop -_02054654: .word FUN_02019620 - - thumb_func_start FUN_02054658 -FUN_02054658: ; 0x02054658 - push {r3-r6, lr} - sub sp, #0xc - add r5, r0, #0x0 - add r0, r3, #0x0 - add r4, r1, #0x0 - add r6, r2, #0x0 - bl FUN_02002B60 - mov r0, #0x0 - bl FUN_02002B7C - mov r0, #0x0 - bl FUN_02002BB8 - add r0, r6, #0x0 - bl Options_GetTextFrameDelay - mov r3, #0x0 - str r3, [sp, #0x0] - str r0, [sp, #0x4] - add r0, r5, #0x0 - mov r1, #0x1 - add r2, r4, #0x0 - str r3, [sp, #0x8] - bl AddTextPrinterParameterized - add sp, #0xc - pop {r3-r6, pc} - - thumb_func_start DrawFieldMessage -DrawFieldMessage: ; 0x02054690 - push {r4-r7, lr} - sub sp, #0xc - add r5, r0, #0x0 - add r0, sp, #0x10 - ldrb r0, [r0, #0x10] - add r6, r1, #0x0 - add r7, r2, #0x0 - add r4, r3, #0x0 - bl FUN_02002B60 - ldr r0, [sp, #0x24] - bl FUN_02002B7C - mov r0, #0x0 - bl FUN_02002BB8 - mov r3, #0x0 - str r3, [sp, #0x0] - str r4, [sp, #0x4] - add r0, r5, #0x0 - add r1, r7, #0x0 - add r2, r6, #0x0 - str r3, [sp, #0x8] - bl AddTextPrinterParameterized - add sp, #0xc - pop {r4-r7, pc} - .balign 4 - - thumb_func_start FUN_020546C8 -FUN_020546C8: ; 0x020546C8 - push {r3, lr} - bl FUN_0201BD70 - cmp r0, #0x0 - bne _020546D6 - mov r0, #0x1 - b _020546D8 -_020546D6: - mov r0, #0x0 -_020546D8: - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - pop {r3, pc} - .balign 4 - - thumb_func_start FUN_020546E0 -FUN_020546E0: ; 0x020546E0 - push {r4-r5, lr} - sub sp, #0x14 - cmp r2, #0x1 - bhi _020546EE - mov r4, #0x9 - mov r5, #0x14 - b _020546F2 -_020546EE: - mov r4, #0x2 - mov r5, #0x1b -_020546F2: - cmp r3, #0x3 - bne _0205471A - mov r2, #0x13 - str r2, [sp, #0x0] - lsl r2, r5, #0x18 - lsr r2, r2, #0x18 - str r2, [sp, #0x4] - mov r2, #0x4 - str r2, [sp, #0x8] - mov r2, #0x9 - str r2, [sp, #0xc] - ldr r2, _02054740 ; =0x0000032D - lsl r3, r4, #0x18 - str r2, [sp, #0x10] - mov r2, #0x3 - lsr r3, r3, #0x18 - bl FUN_02019064 - add sp, #0x14 - pop {r4-r5, pc} -_0205471A: - mov r2, #0x13 - str r2, [sp, #0x0] - lsl r2, r5, #0x18 - lsr r2, r2, #0x18 - str r2, [sp, #0x4] - mov r2, #0x4 - str r2, [sp, #0x8] - mov r2, #0x9 - str r2, [sp, #0xc] - mov r2, #0x65 - lsl r2, r2, #0x2 - lsl r3, r4, #0x18 - str r2, [sp, #0x10] - mov r2, #0x7 - lsr r3, r3, #0x18 - bl FUN_02019064 - add sp, #0x14 - pop {r4-r5, pc} - .balign 4 -_02054740: .word 0x0000032D - - thumb_func_start FUN_02054744 -FUN_02054744: ; 0x02054744 - push {r3-r6, lr} - sub sp, #0xc - add r4, r1, #0x0 - add r5, r0, #0x0 - add r6, r2, #0x0 - bl FUN_0201AB08 - add r1, r0, #0x0 - lsl r0, r4, #0x18 - lsr r0, r0, #0x18 - str r0, [sp, #0x0] - str r6, [sp, #0x4] - mov r0, #0x4 - str r0, [sp, #0x8] - ldr r0, [r5, #0x0] - ldr r2, _02054788 ; =0x00000399 - mov r3, #0x9 - bl FUN_0200D300 - add r0, r5, #0x0 - mov r1, #0xf - bl FUN_02019620 - lsl r0, r4, #0x18 - lsr r0, r0, #0x18 - str r0, [sp, #0x0] - ldr r2, _02054788 ; =0x00000399 - add r0, r5, #0x0 - mov r1, #0x0 - mov r3, #0x9 - bl FUN_0200D6F8 - add sp, #0xc - pop {r3-r6, pc} - .balign 4 -_02054788: .word 0x00000399 diff --git a/arm9/src/text_02054590.c b/arm9/src/text_02054590.c new file mode 100644 index 00000000..f0c63a2b --- /dev/null +++ b/arm9/src/text_02054590.c @@ -0,0 +1,110 @@ +#include "text_02054590.h" + +extern void FUN_0201BD5C(void); +extern void FUN_02002ED0(u32 param0, u32 param1, u32 param2); +extern void FUN_02002EEC(u32 param0, u32 param1, u32 param2); + +extern void FUN_02019064(u32 param0, u32 param1, u32 param2, u8 param3, u32 param4, u8 param5, u32 param6, u32 param7, u32 param8); + +extern void FUN_0200CD68(u32 param0, u32 param1, u32 param2, u32 param3, u8 param4, u32 param5); +extern u32 FUN_0201AB08(u32 *param0); +extern void FUN_0200D0BC(u32 *param0, u32 param1, u32 param2, u32 param3); + +extern void FUN_02019620(u32 *param0, u32 param1); + +extern void FUN_02002B60(u8 param0); +extern void FUN_02002B7C(u32 param0); +extern void FUN_02002BB8(u32 param0); +extern void AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u32 speed, void (*callback)(void *, u16)); + +extern u32 FUN_0201BD70(void); + +extern void FUN_0200D300(u32 param0, u32 param1, u32 param2, u32 param3, u8 param4, u32 param5, u32 param6); +extern void FUN_0200D6F8(u32 *param0, u32 param1, u32 param2, u32 param3, u8 param4); + + +THUMB_FUNC void FUN_02054590(u32 param0, u32 param1) +{ + if (param1 == 1) + { + FUN_0201BD5C(); + } + FUN_02002ED0(param0, 416, 4); + FUN_02002EEC(param0, 384, 4); +} + +THUMB_FUNC void FUN_020545B8(u32 param0, u32 param1, u32 param2) +{ + if (param2 == 3) + { + FUN_02019064(param0, param1, 3, 2, 19, 27, 4, 12, 813); + } + else + { + FUN_02019064(param0, param1, 7, 2, 19, 27, 4, 12, 404); + } +} + +THUMB_FUNC void FUN_02054608(u32 *param0, struct Options *options) +{ + FUN_0200CD68(*param0, FUN_0201AB08(param0), 994, 10, (u8)Options_GetFrame(options), 4); + FUN_0205464C(param0); + FUN_0200D0BC(param0, 0, 994, 10); +} + +THUMB_FUNC void FUN_0205464C(u32 *param0) +{ + FUN_02019620(param0, 15); +} + +THUMB_FUNC void FUN_02054658(u8 windowId, const u8 *str, struct Options *options, u8 param3) +{ + FUN_02002B60(param3); + FUN_02002B7C(0); + FUN_02002BB8(0); + AddTextPrinterParameterized(windowId, 1, str, 0, 0, (u32)Options_GetTextFrameDelay(options), NULL); +} + +THUMB_FUNC void DrawFieldMessage(u8 windowId, const u8 *str, u8 fontId, u32 speed, u8 a4, u32 a5) +{ + FUN_02002B60(a4); + FUN_02002B7C(a5); + FUN_02002BB8(0); + AddTextPrinterParameterized(windowId, fontId, str, 0, 0, speed, NULL); +} + +THUMB_FUNC u8 FUN_020546C8(void) //bool8? +{ + return !FUN_0201BD70(); +} + +THUMB_FUNC void FUN_020546E0(u32 param0, u32 param1, u32 param2, u32 param3) +{ + u32 r4 = 0; + u32 r5 = 0; + if (param2 <= 1) + { + r4 = 9; + r5 = 20; + } + else + { + r4 = 2; + r5 = 27; + } + if (param3 == 3) + { + FUN_02019064(param0, param1, 3, (u8)r4, 19, (u8)r5, 4, 9, 813); + } + else + { + FUN_02019064(param0, param1, 7, (u8)r4, 19, (u8)r5, 4, 9, 404); + } +} + +THUMB_FUNC void FUN_02054744(u32 *param0, u32 param1, u32 param2) +{ + FUN_0200D300(*param0, FUN_0201AB08(param0), 0x399, 9, (u8)param1, param2, 4); + FUN_02019620(param0, 15); + FUN_0200D6F8(param0, 0, 0x399, 9, (u8)param1); +} diff --git a/include/text_02054590.h b/include/text_02054590.h new file mode 100644 index 00000000..37b286f3 --- /dev/null +++ b/include/text_02054590.h @@ -0,0 +1,17 @@ +#ifndef POKEDIAMOND_UNK_02054590_H +#define POKEDIAMOND_UNK_02054590_H + +#include "global.h" +#include "options.h" + +void FUN_02054590(u32 param0, u32 param1); +void FUN_020545B8(u32 param0, u32 param1, u32 param2); +void FUN_02054608(u32 *param0, struct Options *options); +void FUN_0205464C(u32 *param0); +void FUN_02054658(u8 windowId, const u8 *str, struct Options *options, u8 param3); +void DrawFieldMessage(u8 windowId, const u8 *str, u8 fontId, u32 speed, u8 a4, u32 a5); +u8 FUN_020546C8(void); +void FUN_020546E0(u32 param0, u32 param1, u32 param2, u32 param3); +void FUN_02054744(u32 *param0, u32 param1, u32 param2); + +#endif //POKEDIAMOND_UNK_02054590_H |