diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-05-21 19:43:41 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-05-21 19:43:41 -0400 |
commit | 70b098f92d46c134388e02bd8c436649fe31e999 (patch) | |
tree | b5da9769e665b58922cf0653a54cc205420a26a0 | |
parent | cdd1aae79156e0f7eaf1d2fd0056ef2af62a7f0e (diff) |
Fix parameterization
37 files changed, 165 insertions, 141 deletions
diff --git a/arm9/asm/unk_02001B80.s b/arm9/asm/unk_02001B80.s index f76e1b80..696f470c 100644 --- a/arm9/asm/unk_02001B80.s +++ b/arm9/asm/unk_02001B80.s @@ -781,7 +781,7 @@ CreateYesNoMenu: ; 0x020020EC add r0, r5, #0x0 mov r1, #0x1 str r6, [sp, #0x14] - bl FUN_02018FF4 + bl AllocWindows add r1, r0, #0x0 str r1, [sp, #0x18] mov r0, #0x0 diff --git a/arm9/asm/unk_02016B94.s b/arm9/asm/unk_02016B94.s index 73330a71..a6817b28 100644 --- a/arm9/asm/unk_02016B94.s +++ b/arm9/asm/unk_02016B94.s @@ -5022,8 +5022,8 @@ _02018FEA: nop _02018FF0: .word 0x00007FC0 - thumb_func_start FUN_02018FF4 -FUN_02018FF4: ; 0x02018FF4 + thumb_func_start AllocWindows +AllocWindows: ; 0x02018FF4 push {r4-r6, lr} add r5, r1, #0x0 lsl r1, r5, #0x4 @@ -5035,7 +5035,7 @@ FUN_02018FF4: ; 0x02018FF4 _02019006: lsl r0, r4, #0x4 add r0, r6, r0 - bl FUN_0201901C + bl InitWindow add r0, r4, #0x1 lsl r0, r0, #0x10 lsr r4, r0, #0x10 @@ -5045,8 +5045,8 @@ _02019018: add r0, r6, #0x0 pop {r4-r6, pc} - thumb_func_start FUN_0201901C -FUN_0201901C: ; 0x0201901C + thumb_func_start InitWindow +InitWindow: ; 0x0201901C mov r3, #0x0 str r3, [r0, #0x0] mov r1, #0xff diff --git a/arm9/asm/unk_020484A8.s b/arm9/asm/unk_020484A8.s index 4750c7ea..929f1efa 100644 --- a/arm9/asm/unk_020484A8.s +++ b/arm9/asm/unk_020484A8.s @@ -343,7 +343,7 @@ FUN_02048764: ; 0x02048764 str r0, [r1, #0x30] add r1, #0x1c add r0, r1, #0x0 - bl FUN_0201901C + bl InitWindow ldr r0, _020487D4 ; =UNK_020F46B0 bl GX_SetBanks ldr r2, _020487D8 ; =0x04000304 diff --git a/arm9/asm/unk_02050E48.s b/arm9/asm/unk_02050E48.s index d7eb4bc4..fbe0aed9 100644 --- a/arm9/asm/unk_02050E48.s +++ b/arm9/asm/unk_02050E48.s @@ -1255,7 +1255,7 @@ _02051836: bl FUN_02019178 add r0, r5, #0x0 add r0, #0x14 - bl FUN_0201901C + bl InitWindow _02051846: add r0, r5, #0x0 add r0, #0x54 @@ -1267,7 +1267,7 @@ _02051846: bl FUN_02019178 add r0, r5, #0x0 add r0, #0x54 - bl FUN_0201901C + bl InitWindow _02051862: add r0, r5, #0x0 add r0, #0x64 @@ -1279,7 +1279,7 @@ _02051862: bl FUN_02019178 add r5, #0x64 add r0, r5, #0x0 - bl FUN_0201901C + bl InitWindow _0205187E: pop {r3-r5, pc} @@ -1325,13 +1325,13 @@ _0205188E: str r0, [r4, #0x10] add r0, r4, #0x0 add r0, #0x14 - bl FUN_0201901C + bl InitWindow add r0, r4, #0x0 add r0, #0x54 - bl FUN_0201901C + bl InitWindow add r0, r4, #0x0 add r0, #0x64 - bl FUN_0201901C + bl InitWindow mov r0, #0xb bl ListMenuCursorNew str r0, [r4, #0x78] diff --git a/arm9/asm/unk_0206C700.s b/arm9/asm/unk_0206C700.s index 2c5a9ba6..3124976e 100644 --- a/arm9/asm/unk_0206C700.s +++ b/arm9/asm/unk_0206C700.s @@ -117,7 +117,7 @@ FUN_0206C700: ; 0x0206C700 str r0, [r4, #0x0] add r0, r5, #0x0 mov r1, #0x1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r4, #0x4] ldr r0, [sp, #0x18] str r0, [r4, #0x2c] diff --git a/arm9/asm/unk_0207D5BC.s b/arm9/asm/unk_0207D5BC.s index 0aa84bfc..5a814a79 100644 --- a/arm9/asm/unk_0207D5BC.s +++ b/arm9/asm/unk_0207D5BC.s @@ -190,7 +190,7 @@ _0207D692: mov r0, #0x13 lsl r1, r1, #0x18 lsr r1, r1, #0x18 - bl FUN_02018FF4 + bl AllocWindows mov r1, #0x91 lsl r1, r1, #0x2 str r0, [r4, r1] diff --git a/arm9/asm/unk_02086414.s b/arm9/asm/unk_02086414.s index 3cbdf2a8..94945259 100644 --- a/arm9/asm/unk_02086414.s +++ b/arm9/asm/unk_02086414.s @@ -517,7 +517,7 @@ FUN_02086784: ; 0x02086784 add r0, r5, #0x0 add r4, r2, #0x0 add r6, r3, #0x0 - bl FUN_0201901C + bl InitWindow ldr r0, [sp, #0x28] lsl r2, r4, #0x18 lsl r0, r0, #0x18 @@ -627,7 +627,7 @@ FUN_02086878: ; 0x02086878 add r6, r1, #0x0 str r2, [sp, #0x14] add r4, r3, #0x0 - bl FUN_0201901C + bl InitWindow ldr r0, [sp, #0x3c] ldr r3, [sp, #0x38] lsl r0, r0, #0x18 diff --git a/arm9/asm/unk_0208A338.s b/arm9/asm/unk_0208A338.s index 2005be3e..bafa4c91 100644 --- a/arm9/asm/unk_0208A338.s +++ b/arm9/asm/unk_0208A338.s @@ -48,13 +48,13 @@ FUN_0208A338: ; 0x0208A338 bl FUN_020853DC add r0, r4, #0x0 add r0, #0x18 - bl FUN_0201901C + bl InitWindow add r0, r4, #0x0 add r0, #0x28 - bl FUN_0201901C + bl InitWindow add r0, r4, #0x0 add r0, #0x38 - bl FUN_0201901C + bl InitWindow mov r0, #0x0 str r0, [r4, #0x54] ldr r1, _0208A3C4 ; =FUN_0208A458 @@ -102,7 +102,7 @@ FUN_0208A400: ; 0x0208A400 bl FUN_02019178 add r0, r4, #0x0 add r0, #0x18 - bl FUN_0201901C + bl InitWindow _0208A41E: add r0, r4, #0x0 add r0, #0x28 @@ -114,7 +114,7 @@ _0208A41E: bl FUN_02019178 add r0, r4, #0x0 add r0, #0x28 - bl FUN_0201901C + bl InitWindow _0208A43A: add r0, r4, #0x0 add r0, #0x38 @@ -126,7 +126,7 @@ _0208A43A: bl FUN_02019178 add r4, #0x38 add r0, r4, #0x0 - bl FUN_0201901C + bl InitWindow _0208A456: pop {r4, pc} diff --git a/arm9/global.inc b/arm9/global.inc index 5b931bb8..4bb2f382 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -1070,8 +1070,8 @@ .extern FUN_02018884 .extern FUN_02018A60 .extern FUN_02018F4C -.extern FUN_02018FF4 -.extern FUN_0201901C +.extern AllocWindows +.extern InitWindow .extern FUN_02019048 .extern FUN_02019064 .extern FUN_020190EC diff --git a/arm9/modules/05/asm/mod05_021E1AD8.s b/arm9/modules/05/asm/mod05_021E1AD8.s index 5a7f759b..c41f4c57 100644 --- a/arm9/modules/05/asm/mod05_021E1AD8.s +++ b/arm9/modules/05/asm/mod05_021E1AD8.s @@ -1718,7 +1718,7 @@ MOD05_021E27E8: ; 0x021E27E8 add r6, r2, #0 mov r0, #4 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r4, r0, #0 str r6, [sp] mov r0, #0xa @@ -1878,7 +1878,7 @@ MOD05_021E2950: ; 0x021E2950 add r6, r2, #0 mov r0, #4 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r4, r0, #0 str r6, [sp] mov r0, #0xa @@ -2007,7 +2007,7 @@ MOD05_021E2A70: ; 0x021E2A70 add r6, r2, #0 mov r0, #4 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r4, r0, #0 str r6, [sp] mov r0, #0xa diff --git a/arm9/modules/05/asm/module_05.s b/arm9/modules/05/asm/module_05.s index e130e208..13563cc2 100644 --- a/arm9/modules/05/asm/module_05.s +++ b/arm9/modules/05/asm/module_05.s @@ -2737,7 +2737,7 @@ _021E9C02: bl GX_EngineAToggleLayers mov r0, #4 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows mov r1, #0x83 lsl r1, r1, #2 str r0, [r4, r1] @@ -3709,7 +3709,7 @@ _021EA430: bl GX_EngineAToggleLayers mov r0, #4 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows mov r1, #2 lsl r1, r1, #8 str r0, [r4, r1] @@ -5380,7 +5380,7 @@ _021EB18E: str r0, [r4, #4] mov r0, #4 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r4] mov r3, #0 str r3, [sp] diff --git a/arm9/modules/06/asm/module_06.s b/arm9/modules/06/asm/module_06.s index d8efc02e..62cd7742 100644 --- a/arm9/modules/06/asm/module_06.s +++ b/arm9/modules/06/asm/module_06.s @@ -11454,15 +11454,15 @@ _0223EF28: str r0, [r2, #0x7c] ldr r0, [r1] add r0, #0x20 - bl FUN_0201901C + bl InitWindow ldr r0, _0223EFF4 ; =0x02252420 ldr r0, [r0] add r0, #0x30 - bl FUN_0201901C + bl InitWindow ldr r0, _0223EFF4 ; =0x02252420 ldr r0, [r0] add r0, #0x40 - bl FUN_0201901C + bl InitWindow mov r0, #4 bl ScrStrBufs_new ldr r1, _0223EFF4 ; =0x02252420 @@ -14473,7 +14473,7 @@ MOD06_02240864: ; 0x02240864 bne _0224089E add r0, r5, #0 add r0, #0x54 - bl FUN_0201901C + bl InitWindow ldr r0, [r5, #0x10] add r1, r5, #0 ldr r0, [r0, #8] @@ -41794,7 +41794,7 @@ MOD06_0224DC5C: ; 0x0224DC5C str r3, [r5, #8] add r0, r2, #0 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r5, #4] mov r0, #0x13 str r0, [sp] @@ -42039,7 +42039,7 @@ MOD06_0224DE60: ; 0x0224DE60 beq _0224DED2 add r0, r3, #0 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r6, #4] mov r0, #0xb str r0, [sp] @@ -42214,7 +42214,7 @@ _0224DFC0: add r2, #0x14 str r0, [r5, r2] ldr r0, [sp, #0x14] - bl FUN_02018FF4 + bl AllocWindows str r0, [r5, #4] mov r0, #1 str r0, [sp] diff --git a/arm9/modules/09/asm/module_09.s b/arm9/modules/09/asm/module_09.s index c6ad3fc0..63e3d1e0 100644 --- a/arm9/modules/09/asm/module_09.s +++ b/arm9/modules/09/asm/module_09.s @@ -3922,7 +3922,7 @@ _02213D74: ldr r0, [r4] ldrb r1, [r4, r1] ldr r0, [r0, #0xc] - bl FUN_02018FF4 + bl AllocWindows ldr r1, _02213DDC ; =0x00002070 mov r5, #0 str r0, [r4, r1] @@ -14355,7 +14355,7 @@ _022194C6: add r1, #0x30 ldrb r1, [r1] ldr r0, [r0, #0xc] - bl FUN_02018FF4 + bl AllocWindows str r0, [r5, #0x2c] add r0, r5, #0 add r0, #0x30 diff --git a/arm9/modules/11/asm/module_11_thumb1.s b/arm9/modules/11/asm/module_11_thumb1.s index 08cd42c8..1bc8e471 100644 --- a/arm9/modules/11/asm/module_11_thumb1.s +++ b/arm9/modules/11/asm/module_11_thumb1.s @@ -746,7 +746,7 @@ MOD11_0222DB50: ; 0x0222DB50 str r0, [r4, #4] mov r0, #5 mov r1, #3 - bl FUN_02018FF4 + bl AllocWindows mov r7, #0x73 str r0, [r4, #8] mov r6, #0 diff --git a/arm9/modules/11/asm/module_11_thumb2.s b/arm9/modules/11/asm/module_11_thumb2.s index 962280d6..3a852eef 100644 --- a/arm9/modules/11/asm/module_11_thumb2.s +++ b/arm9/modules/11/asm/module_11_thumb2.s @@ -45,7 +45,7 @@ MOD11_0222F29C: ; 0x0222F29C str r0, [r5, #4] mov r0, #5 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r5, #8] add r0, r5, #0 bl FUN_0206BFF0 @@ -28099,7 +28099,7 @@ _0223CF5C: add r0, r6, #0 bl String_dtor add r0, sp, #0x68 - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] @@ -88280,7 +88280,7 @@ _0225A49C: cmp r4, #0 bne _0225A4DA add r0, sp, #0x3c - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] @@ -88914,7 +88914,7 @@ MOD11_0225A968: ; 0x0225A968 bl FUN_02019178 _0225A994: add r0, r4, #0 - bl FUN_0201901C + bl InitWindow ldr r0, [r5] bl MOD11_0222FF68 mov r1, #0 diff --git a/arm9/modules/12/asm/module_12.s b/arm9/modules/12/asm/module_12.s index 247571cb..01de211a 100644 --- a/arm9/modules/12/asm/module_12.s +++ b/arm9/modules/12/asm/module_12.s @@ -7568,7 +7568,7 @@ MOD12_02231380: ; 0x02231380 add r6, r6, #1 _022313B0: add r0, sp, #0x34 - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] @@ -9540,7 +9540,7 @@ _022322FE: cmp r4, #0 bne _0223233C add r0, sp, #0x3c - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] @@ -10928,7 +10928,7 @@ MOD12_02232D7C: ; 0x02232D7C bl FUN_02019178 _02232DA8: add r0, r4, #0 - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] @@ -29905,7 +29905,7 @@ _0223BCF0: add r6, r6, #1 _0223BD1C: add r0, sp, #0x38 - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] diff --git a/arm9/modules/14/asm/module_14.s b/arm9/modules/14/asm/module_14.s index e51aee69..3af57590 100644 --- a/arm9/modules/14/asm/module_14.s +++ b/arm9/modules/14/asm/module_14.s @@ -13820,7 +13820,7 @@ MOD14_021DE1D0: ; 0x021DE1D0 beq _021DE262 mov r0, #0xa mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r4, r0, #0 beq _021DE250 ldr r0, _021DE270 ; =0x00005984 @@ -19634,7 +19634,7 @@ MOD14_021E0F40: ; 0x021E0F40 beq _021E0FA0 mov r0, #0xa mov r1, #4 - bl FUN_02018FF4 + bl AllocWindows str r0, [r5, #4] cmp r0, #0 beq _021E0F94 @@ -20751,7 +20751,7 @@ MOD14_021E1818: ; 0x021E1818 add r6, r0, #0 mov r0, #0xa mov r1, #2 - bl FUN_02018FF4 + bl AllocWindows str r0, [r6, #0x18] cmp r0, #0 beq _021E1848 @@ -21631,7 +21631,7 @@ MOD14_021E1EEC: ; 0x021E1EEC add r7, r0, #0 mov r0, #0xa mov r1, #3 - bl FUN_02018FF4 + bl AllocWindows str r0, [r7, #0x10] cmp r0, #0 beq _021E1F1A diff --git a/arm9/modules/15/asm/module_15.s b/arm9/modules/15/asm/module_15.s index beb5863b..3c379dc5 100644 --- a/arm9/modules/15/asm/module_15.s +++ b/arm9/modules/15/asm/module_15.s @@ -7680,7 +7680,7 @@ MOD15_021DAFF8: ; 0x021DAFF8 cmp r0, #0 beq _021DB0D4 add r0, sp, #0x10 - bl FUN_0201901C + bl InitWindow ldr r0, [r5, #0xc] add r1, sp, #0xc str r0, [sp, #0x10] diff --git a/arm9/modules/16/asm/module_16.s b/arm9/modules/16/asm/module_16.s index 0b9a1de7..45bf6e83 100644 --- a/arm9/modules/16/asm/module_16.s +++ b/arm9/modules/16/asm/module_16.s @@ -8433,9 +8433,9 @@ MOD16_021DB388: ; 0x021DB388 add r4, r1, #0 mov r1, #1 add r6, r2, #0 - bl FUN_02018FF4 + bl AllocWindows add r7, r0, #0 - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] @@ -51457,7 +51457,7 @@ MOD16_021EF318: ; 0x021EF318 add r5, r0, #0 add r0, r1, #0 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r4, r0, #0 mov r3, #0 str r3, [sp] diff --git a/arm9/modules/17/asm/module_17.s b/arm9/modules/17/asm/module_17.s index 03989527..b96d5a98 100644 --- a/arm9/modules/17/asm/module_17.s +++ b/arm9/modules/17/asm/module_17.s @@ -2123,7 +2123,7 @@ MOD17_021D83E4: ; 0x021D83E4 str r0, [r5, r1] mov r0, #0xd mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows ldr r2, _021D84EC ; =0x000006A8 mov r1, #0 str r0, [r5, r2] @@ -2663,7 +2663,7 @@ _021D88F8: str r0, [r4, r1] mov r0, #0xd mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows ldr r1, _021D8994 ; =0x000006A8 mov r2, #0 str r0, [r4, r1] @@ -11265,9 +11265,9 @@ _021DC898: add r7, r0, #0 mov r0, #0xe mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r4, r0, #0 - bl FUN_0201901C + bl InitWindow mov r0, #0 ldr r2, [sp, #0x28] ldr r3, [sp, #0x2c] @@ -11789,9 +11789,9 @@ MOD17_021DCC68: ; 0x021DCC68 mov r0, #0xe mov r1, #1 add r4, r2, #0 - bl FUN_02018FF4 + bl AllocWindows str r0, [r5] - bl FUN_0201901C + bl InitWindow lsl r0, r6, #0x18 lsr r0, r0, #0x18 str r0, [sp] @@ -14242,7 +14242,7 @@ MOD17_021DDF1C: ; 0x021DDF1C add r4, r0, #0 mov r0, #0xe mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows mov r1, #0x19 lsl r1, r1, #4 str r0, [r4, r1] diff --git a/arm9/modules/18/asm/module_18.s b/arm9/modules/18/asm/module_18.s index 1b4efb2a..dccb0b7d 100644 --- a/arm9/modules/18/asm/module_18.s +++ b/arm9/modules/18/asm/module_18.s @@ -25562,7 +25562,7 @@ MOD18_02245B1C: ; 0x02245B1C ldr r0, [sp, #0x30] mov r1, #1 str r4, [sp, #0x10] - bl FUN_02018FF4 + bl AllocWindows add r1, r0, #0 str r1, [sp, #0x14] mov r0, #0 @@ -41435,7 +41435,7 @@ _0224DB08: add r0, r4, #0 str r7, [r4, #0x18] add r0, #8 - bl FUN_0201901C + bl InitWindow ldr r1, [r4, #0x40] mov r0, #1 bic r1, r0 diff --git a/arm9/modules/24/asm/module_24.s b/arm9/modules/24/asm/module_24.s index a069571e..07a7285c 100644 --- a/arm9/modules/24/asm/module_24.s +++ b/arm9/modules/24/asm/module_24.s @@ -662,7 +662,7 @@ MOD24_02254D00: ; 0x02254D00 add r4, r0, #0 mov r0, #8 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r4, #0x70] add r1, r0, #0 beq _02254D3C diff --git a/arm9/modules/27/asm/module_27.s b/arm9/modules/27/asm/module_27.s index 0dac7728..7d7fa32a 100644 --- a/arm9/modules/27/asm/module_27.s +++ b/arm9/modules/27/asm/module_27.s @@ -389,7 +389,7 @@ MOD27_02254AF0: ; 0x02254AF0 add r7, r6, #0 _02254B36: add r0, r4, #0 - bl FUN_0201901C + bl InitWindow add r0, r5, #0 add r0, #0x9c str r7, [r0] @@ -608,7 +608,7 @@ MOD27_02254CC8: ; 0x02254CC8 add r4, #0x3c _02254CE8: add r0, r4, #0 - bl FUN_0201901C + bl InitWindow ldrh r0, [r5, #2] add r1, r4, #0 mov r2, #6 diff --git a/arm9/modules/62/asm/module_62.s b/arm9/modules/62/asm/module_62.s index 33113c9d..f1eb2a70 100644 --- a/arm9/modules/62/asm/module_62.s +++ b/arm9/modules/62/asm/module_62.s @@ -1152,7 +1152,7 @@ MOD62_0222DE00: ; 0x0222DE00 bl NewString_ReadMsgData str r0, [sp, #0x18] add r0, sp, #0x1c - bl FUN_0201901C + bl InitWindow mov r0, #0 str r0, [sp] str r0, [sp, #4] @@ -1936,7 +1936,7 @@ _0222E442: add r0, r4, r0 asr r7, r0, #1 ldr r0, [sp, #0x18] - bl FUN_0201901C + bl InitWindow lsl r0, r5, #0x18 lsr r0, r0, #0x18 str r0, [sp] @@ -3298,7 +3298,7 @@ MOD62_0222EEE0: ; 0x0222EEE0 add r0, r5, #0 add r4, r2, #0 add r6, r3, #0 - bl FUN_0201901C + bl InitWindow ldr r0, [sp, #0x28] lsl r2, r4, #0x18 lsl r0, r0, #0x18 @@ -3347,7 +3347,7 @@ MOD62_0222EF44: ; 0x0222EF44 add r0, r5, #0 add r4, r2, #0 add r6, r3, #0 - bl FUN_0201901C + bl InitWindow ldr r0, [sp, #0x28] lsl r2, r4, #0x18 lsl r0, r0, #0x18 diff --git a/arm9/modules/64/asm/module_64.s b/arm9/modules/64/asm/module_64.s index d8d29678..ce90e965 100644 --- a/arm9/modules/64/asm/module_64.s +++ b/arm9/modules/64/asm/module_64.s @@ -653,14 +653,14 @@ MOD64_021D7A54: ; 0x021D7A54 add r5, r0, #0 add r0, r4, #0 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r1, r5, #0 add r1, #0x98 str r0, [r1] add r0, r5, #0 add r0, #0x98 ldr r0, [r0] - bl FUN_0201901C + bl InitWindow mov r0, #0x13 str r0, [sp] mov r0, #0x17 @@ -3393,14 +3393,14 @@ MOD64_021D8EF4: ; 0x021D8EF4 _021D8F16: ldr r0, [sp, #0x18] mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows add r1, r5, #0 add r1, #0x9c str r0, [r1] add r0, r5, #0 add r0, #0x9c ldr r0, [r0] - bl FUN_0201901C + bl InitWindow cmp r4, #0 beq _021D8F3C cmp r4, #1 diff --git a/arm9/modules/73/asm/module_73.s b/arm9/modules/73/asm/module_73.s index cf221b3f..4a086c51 100644 --- a/arm9/modules/73/asm/module_73.s +++ b/arm9/modules/73/asm/module_73.s @@ -4947,11 +4947,11 @@ MOD73_021D9BE0: ; 0x021D9BE0 add r5, r0, #0 add r0, r4, #0 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r5, #8] add r0, r4, #0 mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r5, #0xc] mov r0, #0x13 str r0, [sp] @@ -5924,7 +5924,7 @@ MOD73_021DA2AC: ; 0x021DA2AC _021DA2FA: ldr r0, [sp, #0x14] mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r4, #8] ldrh r0, [r5, #2] mov r2, #2 diff --git a/arm9/modules/84/asm/module_84_thumb2.s b/arm9/modules/84/asm/module_84_thumb2.s index a843354a..087f0fe0 100644 --- a/arm9/modules/84/asm/module_84_thumb2.s +++ b/arm9/modules/84/asm/module_84_thumb2.s @@ -559,7 +559,7 @@ MOD84_021D84F8: ; 0x021D84F8 str r0, [r4, #0x30] mov r0, #0x4b mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r4, #0x24] mov r3, #0 lsl r2, r5, #0x18 @@ -584,7 +584,7 @@ MOD84_021D84F8: ; 0x021D84F8 bl CopyWindowToVram mov r0, #0x4b mov r1, #1 - bl FUN_02018FF4 + bl AllocWindows str r0, [r4, #0x28] mov r3, #0 lsl r2, r5, #0x18 diff --git a/arm9/src/error_message_reset.c b/arm9/src/error_message_reset.c index 6bff812a..426ba876 100644 --- a/arm9/src/error_message_reset.c +++ b/arm9/src/error_message_reset.c @@ -20,18 +20,17 @@ u32 sErrorMessagePrinterLock; extern void FUN_0200E3A0(PMLCDTarget, int); extern u32 *FUN_02016B94(u32 param0); extern void FUN_02016BBC(const struct GraphicsModes *modes); -extern void FUN_02016C18(u32 *param0, u32 param1, void *param2, u32 param3); +extern void FUN_02016C18(u32 *param0, struct Window * param1, const u32 *param2, u32 param3); extern void FUN_02018744(u32 *param0, u32 param1); extern void FUN_0200CB00(u32 *param0, u32 param1, u32 param2, u32 param3, u8 param4, u32 param5); extern void FUN_02002ED0(u32 param0, u32 param1, u32 param2); extern void FUN_02017F18(u32 param0, u32 param1, u32 param2, u32 param3); extern void FUN_02017FE4(u32 param0, u32 param1); -extern void FUN_02019150(u32 *param0, u32 *param1, const u32 *param2); -extern void FillWindowPixelRect(u32 *, u8, u16, u16, u16, u16); -extern void FUN_0200CCA4(u32 *param0, u32 param1, u32 param2, u32 param3); +extern void FUN_02019150(u32 *param0, struct Window *param1, const u32 *param2); +extern void FUN_0200CCA4(struct Window *param0, u32 param1, u32 param2, u32 param3); extern void FUN_0200E394(u32 param0); extern void FUN_0200A274(u32 param0, u32 param1, u32 param2); -extern void FUN_02019178(u32 *param0); +extern void FUN_02019178(struct Window *param0); THUMB_FUNC void VBlankHandler() { @@ -44,7 +43,7 @@ THUMB_FUNC void PrintErrorMessageAndReset() { u32 *ptr; - u32 buf[4]; + struct Window buf; if (sErrorMessagePrinterLock != 1) { @@ -97,13 +96,13 @@ THUMB_FUNC void PrintErrorMessageAndReset() struct String *str = String_ctor(6 << 6, 0); FUN_0201BD5C(); - FUN_02019150(ptr, buf, UNK_020FF49C); - FillWindowPixelRect(buf, 15, 0, 0, 0xd0, 0x90); - FUN_0200CCA4(buf, 0, 0x1f7, 2); + FUN_02019150(ptr, &buf, UNK_020FF49C); + FillWindowPixelRect(&buf, 15, 0, 0, 0xd0, 0x90); + FUN_0200CCA4(&buf, 0, 0x1f7, 2); ReadMsgDataIntoString(msg_data, 3, str); - AddTextPrinterParameterized((u32)buf, 0, (const u16 *)str, 0, 0, 0, NULL); // wtf + AddTextPrinterParameterized(&buf, 0, (const u16 *)str, 0, 0, 0, NULL); // wtf String_dtor(str); GX_BothDispOn(); @@ -133,7 +132,7 @@ THUMB_FUNC void PrintErrorMessageAndReset() FUN_0200E3A0(PM_LCD_TOP, 0x7FFF); FUN_0200E3A0(PM_LCD_BOTTOM, 0x7FFF); - FUN_02019178(buf); + FUN_02019178(&buf); DestroyMsgData(msg_data); FreeToHeap(ptr); diff --git a/arm9/src/list_menu.c b/arm9/src/list_menu.c index e3832145..cd9abde0 100644 --- a/arm9/src/list_menu.c +++ b/arm9/src/list_menu.c @@ -2,18 +2,8 @@ #include "heap.h" #include "main.h" #include "list_menu.h" +#include "text.h" -extern void * ListMenuCursorNew(u32 heap_id); -extern void * ListMenuUpdateCursorObj(struct ListMenuCursor *, struct Window *, u8 x, u8 y); -extern void ListMenuCursorSetColor(void *, u32); -extern void DestroyListMenuCursorObj(void *); -extern void FillWindowPixelBuffer(struct Window *, u32); -extern void CopyWindowToVram(struct Window *); -extern s32 GetFontAttribute(u8 fontId, s32 attr); -extern void FillWindowPixelRect(struct Window *, u32 fillValue, u16 x, u16 y, u16 width, u16 height); -extern void ScrollWindow(struct Window *, u8, u8, u8); -extern u16 GetWindowWidth(struct Window *); -extern u16 GetWindowHeight(struct Window *); void ListMenuPrintEntries(struct ListMenu * list, u16 startIndex, u16 yOffset, u16 count); void ListMenuDrawCursor(struct ListMenu * list); BOOL ListMenuChangeSelection(struct ListMenu * list, u8 updateCursorAndCallCallback, u8 count, u8 movingDown); diff --git a/arm9/src/text.c b/arm9/src/text.c index 926fa29f..bbaa3472 100644 --- a/arm9/src/text.c +++ b/arm9/src/text.c @@ -24,7 +24,6 @@ extern u32 FontFunc(u8 fontId, struct TextPrinter *printer); extern void *FUN_02006BB0(u32 param0, u32 param1, u32 param2, struct TextPrinter **param3, u32 param4); -extern u32 GetWindowWidth(struct Window * window); extern void FUN_02019658(struct Window * param0, u32 param1, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8, u32 param9); @@ -349,7 +348,7 @@ THUMB_FUNC void FUN_0201C1EC(struct TextPrinter *printer, u32 param1, u32 param2 printer->Unk2C = FUN_0201C1B0(); } u32 r6 = (u32)printer->Unk2C + param3 * (sizeof(struct TextPrinter) * 8); - u32 r2 = ((GetWindowWidth(window) - 3) << 0x13) >> 0x10; + u16 r2 = (GetWindowWidth(window) - 3) * 8; FUN_02019658(window, r6, 0, 0, 24, 32, r2, 0, 24, 32); } diff --git a/arm9/src/text_02054590.c b/arm9/src/text_02054590.c index 392af46d..e2765c6f 100644 --- a/arm9/src/text_02054590.c +++ b/arm9/src/text_02054590.c @@ -7,18 +7,16 @@ 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 FillWindowPixelBuffer(u32 *param0, u32 param1); +extern void FUN_0200CD68(void * param0, u32 param1, u32 param2, u32 param3, u8 param4, u32 param5); +extern u32 FUN_0201AB08(struct Window *param0); +extern void FUN_0200D0BC(struct Window *param0, u32 param1, u32 param2, u32 param3); extern void FUN_02002B60(u8 param0); extern void FUN_02002B7C(u32 param0); extern void FUN_02002BB8(u32 param0); -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); +extern void FUN_0200D300(void * param0, u32 param1, u32 param2, u32 param3, u8 param4, u32 param5, u32 param6); +extern void FUN_0200D6F8(struct Window *param0, u32 param1, u32 param2, u32 param3, u8 param4); THUMB_FUNC void FUN_02054590(u32 param0, u32 param1) @@ -43,32 +41,32 @@ THUMB_FUNC void FUN_020545B8(u32 param0, u32 param1, u32 param2) } } -THUMB_FUNC void FUN_02054608(u32 *param0, struct Options *options) +THUMB_FUNC void FUN_02054608(struct Window *param0, struct Options *options) { - FUN_0200CD68(*param0, FUN_0201AB08(param0), 994, 10, (u8)Options_GetFrame(options), 4); + FUN_0200CD68(param0->unk_00, 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) +THUMB_FUNC void FUN_0205464C(struct Window *param0) { FillWindowPixelBuffer(param0, 15); } -THUMB_FUNC u16 FUN_02054658(u8 windowId, const u16 *str, struct Options *options, u8 param3) +THUMB_FUNC u16 FUN_02054658(struct Window * window, const u16 *str, struct Options *options, u8 param3) { FUN_02002B60(param3); FUN_02002B7C(0); FUN_02002BB8(0); - return AddTextPrinterParameterized(windowId, 1, str, 0, 0, (u32)Options_GetTextFrameDelay(options), NULL); + return AddTextPrinterParameterized(window, 1, str, 0, 0, (u32)Options_GetTextFrameDelay(options), NULL); } -THUMB_FUNC u16 DrawFieldMessage(u8 windowId, const u16 *str, u8 fontId, u32 speed, u8 a4, u32 a5) +THUMB_FUNC u16 DrawFieldMessage(struct Window * window, const u16 *str, u8 fontId, u32 speed, u8 a4, u32 a5) { FUN_02002B60(a4); FUN_02002B7C(a5); FUN_02002BB8(0); - return AddTextPrinterParameterized(windowId, fontId, str, 0, 0, speed, NULL); + return AddTextPrinterParameterized(window, fontId, str, 0, 0, speed, NULL); } THUMB_FUNC u8 FUN_020546C8(u32 param0) //bool8? @@ -100,9 +98,9 @@ THUMB_FUNC void FUN_020546E0(u32 param0, u32 param1, u32 param2, u32 param3) } } -THUMB_FUNC void FUN_02054744(u32 *param0, u32 param1, u32 param2) +THUMB_FUNC void FUN_02054744(struct Window *param0, u32 param1, u32 param2) { - FUN_0200D300(*param0, FUN_0201AB08(param0), 0x399, 9, (u8)param1, param2, 4); + FUN_0200D300(param0->unk_00, FUN_0201AB08(param0), 0x399, 9, (u8)param1, param2, 4); FillWindowPixelBuffer(param0, 15); FUN_0200D6F8(param0, 0, 0x399, 9, (u8)param1); } diff --git a/include/font.h b/include/font.h new file mode 100644 index 00000000..e5e64e88 --- /dev/null +++ b/include/font.h @@ -0,0 +1,6 @@ +#ifndef POKEDIAMOND_FONT_H +#define POKEDIAMOND_FONT_H + +extern s32 GetFontAttribute(u8 fontId, s32 attr); + +#endif // POKEDIAMOND_FONT_H diff --git a/include/list_menu.h b/include/list_menu.h index 35fc44e6..4cc1d247 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_LIST_MENU_H #define POKEDIAMOND_LIST_MENU_H -#include "text.h" +#include "list_menu_cursor.h" #define LIST_HEADER -3 #define LIST_CANCEL -2 @@ -13,12 +13,6 @@ struct ListMenu; -// TODO: Move to its own header, and fill it out -struct ListMenuCursor -{ - // ??? -}; - struct ListMenuItem { const u16 * text; diff --git a/include/list_menu_cursor.h b/include/list_menu_cursor.h new file mode 100644 index 00000000..355c63ec --- /dev/null +++ b/include/list_menu_cursor.h @@ -0,0 +1,17 @@ +#ifndef POKEDIAMOND_LIST_MENU_CURSOR_H +#define POKEDIAMOND_LIST_MENU_CURSOR_H + +#include "window.h" + +// TODO: Move to its own header, and fill it out +struct ListMenuCursor +{ + // ??? +}; + +extern struct ListMenuCursor * ListMenuCursorNew(u32 heap_id); +extern void ListMenuUpdateCursorObj(struct ListMenuCursor *, struct Window *, u8 x, u8 y); +extern void ListMenuCursorSetColor(struct ListMenuCursor *, u32); +extern void DestroyListMenuCursorObj(struct ListMenuCursor *); + +#endif // POKEDIAMOND_LIST_MENU_CURSOR_H diff --git a/include/text.h b/include/text.h index 1218a0b3..78bfb9d4 100644 --- a/include/text.h +++ b/include/text.h @@ -2,13 +2,8 @@ #define POKEDIAMOND_TEXT_H #include "global.h" - -// TODO: Move to its own header, and fill it out -struct Window -{ - u8 * unk_00; - u8 unk_04; -}; +#include "window.h" +#include "font.h" struct TextPrinterTemplate { diff --git a/include/text_02054590.h b/include/text_02054590.h index 725bd9b4..b1ee055a 100644 --- a/include/text_02054590.h +++ b/include/text_02054590.h @@ -3,15 +3,16 @@ #include "global.h" #include "options.h" +#include "window.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); -u16 FUN_02054658(u8 windowId, const u16 *str, struct Options *options, u8 param3); -u16 DrawFieldMessage(u8 windowId, const u16 *str, u8 fontId, u32 speed, u8 a4, u32 a5); +void FUN_02054608(struct Window *param0, struct Options *options); +void FUN_0205464C(struct Window *param0); +u16 FUN_02054658(struct Window * window, const u16 *str, struct Options *options, u8 param3); +u16 DrawFieldMessage(struct Window * window, const u16 *str, u8 fontId, u32 speed, u8 a4, u32 a5); u8 FUN_020546C8(u32 param0); void FUN_020546E0(u32 param0, u32 param1, u32 param2, u32 param3); -void FUN_02054744(u32 *param0, u32 param1, u32 param2); +void FUN_02054744(struct Window *param0, u32 param1, u32 param2); #endif //POKEDIAMOND_UNK_02054590_H diff --git a/include/window.h b/include/window.h new file mode 100644 index 00000000..ebe3338a --- /dev/null +++ b/include/window.h @@ -0,0 +1,25 @@ +#ifndef POKEDIAMOND_WINDOW_H +#define POKEDIAMOND_WINDOW_H + +struct Window +{ + u8 * unk_00; + u8 unk_04; + u8 unk_05; + u8 unk_06; + u8 width; + u8 height; + u8 unk_9; + u16 unk_A_0:15; + u16 unk_A_15:1; + void * unk_C; +}; + +extern void FillWindowPixelBuffer(struct Window *, u32); +extern void CopyWindowToVram(struct Window *); +extern void FillWindowPixelRect(struct Window *, u32 fillValue, u16 x, u16 y, u16 width, u16 height); +extern void ScrollWindow(struct Window *, u8, u8, u8); +extern u16 GetWindowWidth(struct Window *); +extern u16 GetWindowHeight(struct Window *); + +#endif // POKEDIAMOND_WINDOW_H |