From 1bb3e006cd703b225b2a2c62cc9b0f075b669850 Mon Sep 17 00:00:00 2001 From: Roman971 <32455037+Roman971@users.noreply.github.com> Date: Tue, 26 May 2020 16:32:18 +0200 Subject: [PATCH] Move last 3 functions in z_message_PAL.c to a separate file (#158) There is padding in 1.0 here, and rodata is also 16 bytes aligned at this point. --- .../func_80110450.s | 0 .../func_80110460.s | 0 .../func_801104C8.s | 0 data/code_80110450.rodata.s | 36 +++++++++++++++++++ data/z_message_PAL.rodata.s | 27 -------------- spec | 2 ++ src/code/code_80110450.c | 8 +++++ src/code/z_message_PAL.c | 6 ---- 8 files changed, 46 insertions(+), 33 deletions(-) rename asm/non_matchings/code/{z_message_PAL => code_80110450}/func_80110450.s (100%) rename asm/non_matchings/code/{z_message_PAL => code_80110450}/func_80110460.s (100%) rename asm/non_matchings/code/{z_message_PAL => code_80110450}/func_801104C8.s (100%) create mode 100644 data/code_80110450.rodata.s create mode 100644 src/code/code_80110450.c diff --git a/asm/non_matchings/code/z_message_PAL/func_80110450.s b/asm/non_matchings/code/code_80110450/func_80110450.s similarity index 100% rename from asm/non_matchings/code/z_message_PAL/func_80110450.s rename to asm/non_matchings/code/code_80110450/func_80110450.s diff --git a/asm/non_matchings/code/z_message_PAL/func_80110460.s b/asm/non_matchings/code/code_80110450/func_80110460.s similarity index 100% rename from asm/non_matchings/code/z_message_PAL/func_80110460.s rename to asm/non_matchings/code/code_80110450/func_80110460.s diff --git a/asm/non_matchings/code/z_message_PAL/func_801104C8.s b/asm/non_matchings/code/code_80110450/func_801104C8.s similarity index 100% rename from asm/non_matchings/code/z_message_PAL/func_801104C8.s rename to asm/non_matchings/code/code_80110450/func_801104C8.s diff --git a/data/code_80110450.rodata.s b/data/code_80110450.rodata.s new file mode 100644 index 0000000000..dfaeb6757a --- /dev/null +++ b/data/code_80110450.rodata.s @@ -0,0 +1,36 @@ +.include "macro.inc" + +# assembler directives +.set noat # allow manual use of $at +.set noreorder # don't insert nops after branches +.set gp=64 # allow use of 64-bit general purposee registers + +.section .rodata + +.align 4 + +glabel jtbl_80154CF0 + .word L80110520 + .word L80110960 + .word L80110748 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L80110960 + .word L8011079C + .word L801107D8 + .word L801108A4 + .word L801108E8 + .word L8011092C diff --git a/data/z_message_PAL.rodata.s b/data/z_message_PAL.rodata.s index 306775e35d..7a88858552 100644 --- a/data/z_message_PAL.rodata.s +++ b/data/z_message_PAL.rodata.s @@ -788,30 +788,3 @@ glabel jtbl_80154CC4 .word L8010FDB0 .word L8010FE10 .word L8010FE58 - .balign 16 - -glabel jtbl_80154CF0 - .word L80110520 - .word L80110960 - .word L80110748 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L80110960 - .word L8011079C - .word L801107D8 - .word L801108A4 - .word L801108E8 - .word L8011092C diff --git a/spec b/spec index a78a173cbb..b197388522 100644 --- a/spec +++ b/spec @@ -550,6 +550,8 @@ beginseg include "build/src/code/z_message_PAL.o" include "build/data/z_message_PAL.rodata.o" include "build/data/z_message_PAL.bss.o" + include "build/src/code/code_80110450.o" + include "build/data/code_80110450.rodata.o" include "build/src/code/z_construct.o" include "build/data/rsp.text.o" include "build/data/rsp.rodata.o" diff --git a/src/code/code_80110450.c b/src/code/code_80110450.c new file mode 100644 index 0000000000..d312881ba9 --- /dev/null +++ b/src/code/code_80110450.c @@ -0,0 +1,8 @@ +#include +#include + +#pragma GLOBAL_ASM("asm/non_matchings/code/code_80110450/func_80110450.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/code_80110450/func_80110460.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/code_80110450/func_801104C8.s") diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index a8efa8c3c8..b8e4434355 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -64,9 +64,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_8010F6F0.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_8011040C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_80110450.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_80110460.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_801104C8.s")