From 9a7b8411948d69859ca661046349400189306948 Mon Sep 17 00:00:00 2001 From: David Benepe Date: Sat, 29 May 2021 21:18:37 -0500 Subject: [PATCH] Moved .rodata in unknown_0255E0 & unknown_031D30 from asm to C. --- asm/unknown_031D30.s | 22 ++++++ data/unknown_0255E0.rodata.s | 149 ----------------------------------- data/unknown_031D30.rodata.s | 36 --------- data/unknown_032760.rodata.s | 10 +++ src/unknown_0255E0.c | 42 ++++++++++ 5 files changed, 74 insertions(+), 185 deletions(-) delete mode 100644 data/unknown_0255E0.rodata.s delete mode 100644 data/unknown_031D30.rodata.s diff --git a/asm/unknown_031D30.s b/asm/unknown_031D30.s index 4f13b63e..33bfd6b9 100644 --- a/asm/unknown_031D30.s +++ b/asm/unknown_031D30.s @@ -8,6 +8,28 @@ .set noreorder # dont insert nops after branches .set gp=64 # 64-bit instructions are used +.section .text + .include "asm/unknown_031D30/func_80031130.s" .include "asm/unknown_031D30/func_800314DC.s" .include "asm/unknown_031D30/func_80031600.s" + +.section .rodata + +glabel D_800E5F60 +.float -0.1 + +glabel D_800E5F64 +.float -0.1 + +glabel D_800E5F68 +.float 0.707 + +glabel D_800E5F6C +.float 0.45 + +glabel D_800E5F70 +.float -0.1 + + + diff --git a/data/unknown_0255E0.rodata.s b/data/unknown_0255E0.rodata.s deleted file mode 100644 index 8113c88d..00000000 --- a/data/unknown_0255E0.rodata.s +++ /dev/null @@ -1,149 +0,0 @@ -.include "macros.inc" - -.macro .aligned_text ascii - .asciz "\ascii" - .balign 4 -.endm - -.section .rodata - -glabel D_800E5DF0 -.aligned_text "TT CAM" - -.aligned_text "Solid Clipping x0=x1 Error!!!\n" -.aligned_text "TrackGetHeight() - Overflow!!!\n" - -glabel D_800E5E38 -.aligned_text "ERROR!! TrackMem overflow .. %d\n" - -.word 0x00000000 - -glabel D_800E5E60 -.word 0x406F4000 - -glabel D_800E5E64 -.word 0x00000000 - -glabel D_800E5E68 -.word 0xC072C000 - -glabel D_800E5E6C -.word 0x00000000 - -glabel D_800E5E70 -.word 0x4072C000 - -glabel D_800E5E74 -.word 0x00000000 - -glabel D_800E5E78 -.word 0x4072C000 - -glabel D_800E5E7C -.word 0x00000000 - -glabel D_800E5E80 -.word 0xC072C000 - -glabel D_800E5E84 -.word 0x00000000 - -glabel D_800E5E88 -.word 0xC072C000 - -glabel D_800E5E8C -.word 0x00000000 - -glabel D_800E5E90 -.word 0xBFB99999 - -glabel D_800E5E94 -.word 0x9999999A - -glabel D_800E5E98 -.word 0xBFB99999 - -glabel D_800E5E9C -.word 0x9999999A - -glabel D_800E5EA0 -.word 0x408F4000 - -glabel D_800E5EA4 -.word 0x00000000 - -glabel D_800E5EA8 -.word 0x408F4000 - -glabel D_800E5EAC -.word 0x00000000 - -glabel D_800E5EB0 -.word 0x3FE99999 - -glabel D_800E5EB4 -.word 0x9999999A - -glabel D_800E5EB8 -.word 0x406FE000 - -glabel D_800E5EBC -.word 0x00000000 - -glabel D_800E5EC0 -.word 0x8002AB40 -.word 0x8002AB40 -.word 0x8002AB54 -.word 0x8002AB40 -.word 0x8002AB40 -.word 0x8002AB54 -.word 0x8002AB40 -.word 0x8002AB54 -.word 0x8002AB2C -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB58 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB40 -.word 0x8002AB54 -.word 0x8002AB40 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB58 -.word 0x8002AB54 -.word 0x8002AB54 -.word 0x8002AB58 -.word 0x8002AB40 - -glabel D_800E5F40 -.word 0x3FC99999 - -glabel D_800E5F44 -.word 0x9999999A - -glabel D_800E5F48 -.word 0x3FB33333 - -glabel D_800E5F4C -.word 0x3F36C8B4 - -glabel D_800E5F50 -.word 0x3BA3D70A - -glabel D_800E5F54 -.word 0x3FB50481 - -glabel D_800E5F58 -.word 0x3BA3D70A - -glabel D_800E5F5C -.word 0x3F7D70A4 diff --git a/data/unknown_031D30.rodata.s b/data/unknown_031D30.rodata.s deleted file mode 100644 index 16850414..00000000 --- a/data/unknown_031D30.rodata.s +++ /dev/null @@ -1,36 +0,0 @@ -.include "macros.inc" - -.macro .aligned_text ascii - .asciz "\ascii" - .balign 4 -.endm - -.section .rodata - -glabel D_800E5F60 -.word 0xBDCCCCCD - -glabel D_800E5F64 -.word 0xBDCCCCCD - -glabel D_800E5F68 -.word 0x3F34FDF4 - -glabel D_800E5F6C -.word 0x3EE66666 - -glabel D_800E5F70 -.word 0xBDCCCCCD -.word 0x00000000 -.word 0x00000000 -.word 0x00000000 - -glabel D_800E5F80 -.word 0x80033A70 -.word 0x80033AA4 -.word 0x80033AE4 -.word 0x80033B48 -.word 0x80033BB4 -.word 0x00000000 -.word 0x00000000 -.word 0x00000000 diff --git a/data/unknown_032760.rodata.s b/data/unknown_032760.rodata.s index 807f8d77..fad48228 100644 --- a/data/unknown_032760.rodata.s +++ b/data/unknown_032760.rodata.s @@ -7,6 +7,16 @@ .section .rodata +glabel D_800E5F80 +.word 0x80033A70 +.word 0x80033AA4 +.word 0x80033AE4 +.word 0x80033B48 +.word 0x80033BB4 +.word 0x00000000 +.word 0x00000000 +.word 0x00000000 + glabel D_800E5FA0 .aligned_text "Illegal door no!!!\n" diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index 20efb5c5..4695fa7d 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -124,6 +124,48 @@ s8 D_800DC92C[24] = { /*******************************/ +/************ .rodata ************/ + +const char D_800E5DF0[] = "TT CAM"; +const char D_800E5DF8[] = "Solid Clipping x0=x1 Error!!!\n"; +const char D_800E5E10[] = "TrackGetHeight() - Overflow!!!\n"; +const char D_800E5E38[] = "ERROR!! TrackMem overflow .. %d\n"; + +const DoubleLiteral D_800E5E60 = { 250.0 }; +const DoubleLiteral D_800E5E68 = { -300.0 }; +const DoubleLiteral D_800E5E70 = { 300.0 }; +const DoubleLiteral D_800E5E78 = { 300.0 }; +const DoubleLiteral D_800E5E80 = { -300.0 }; +const DoubleLiteral D_800E5E88 = { -300.0 }; +const DoubleLiteral D_800E5E90 = { -0.1 }; +const DoubleLiteral D_800E5E98 = { -0.1 }; +const DoubleLiteral D_800E5EA0 = { 1000.0 }; +const DoubleLiteral D_800E5EA8 = { 1000.0 }; +const DoubleLiteral D_800E5EB0 = { 0.8 }; +const DoubleLiteral D_800E5EB8 = { 255.0 }; + +// Jump table in func_8002A900 +const u32 D_800E5EC0[] = { + 0x8002AB40, 0x8002AB40, 0x8002AB54, 0x8002AB40, + 0x8002AB40, 0x8002AB54, 0x8002AB40, 0x8002AB54, + 0x8002AB2C, 0x8002AB54, 0x8002AB54, 0x8002AB54, + 0x8002AB58, 0x8002AB54, 0x8002AB54, 0x8002AB54, + 0x8002AB54, 0x8002AB54, 0x8002AB54, 0x8002AB54, + 0x8002AB40, 0x8002AB54, 0x8002AB40, 0x8002AB54, + 0x8002AB54, 0x8002AB54, 0x8002AB54, 0x8002AB58, + 0x8002AB54, 0x8002AB54, 0x8002AB58, 0x8002AB40 +}; + +const DoubleLiteral D_800E5F40 = { 0.2 }; +const FloatLiteral D_800E5F48 = { 1.4f }; +const FloatLiteral D_800E5F4C = { 0.714f }; +const FloatLiteral D_800E5F50 = { 0.005f }; +const FloatLiteral D_800E5F54 = { 1.4142f }; +const FloatLiteral D_800E5F58 = { 0.005f }; +const FloatLiteral D_800E5F5C = { 0.99f }; + +/*********************************/ + /************ .bss ************/ extern s32 D_8011D37C;