1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

Fix more raw pointers (rsp and part of .data) (#170)

Known files left with pointers in .data after this (possibly the only ones since I checked roughly everything):
- flg_set.c
- z_camera.c
- db_camera.c
- code_800D7CD0.c (ucode_disas.c)
- audio (not sure which ones, see the structure sheet)
This commit is contained in:
Roman971 2020-05-27 15:06:37 +02:00 committed by GitHub
parent 77a9f9c9f8
commit 235b0b8e0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 96 additions and 43 deletions

View file

@ -158,18 +158,18 @@ glabel func_80096B6C
/* B0DF08 80096D68 10A00053 */ beqz $a1, .L80096EB8
/* B0DF0C 80096D6C 3C0EE100 */ lui $t6, 0xe100
/* B0DF10 80096D70 8E0302C0 */ lw $v1, 0x2c0($s0)
/* B0DF14 80096D74 3C0F0015 */ lui $t7, %hi(D_001579A0)
/* B0DF18 80096D78 25EF79A0 */ addiu $t7, %lo(D_001579A0)
/* B0DF14 80096D74 3C0F0015 */ lui $t7, %hi(D_801579A0-0x80000000)
/* B0DF18 80096D78 25EF79A0 */ addiu $t7, %lo(D_801579A0-0x80000000)
/* B0DF1C 80096D7C 246D0008 */ addiu $t5, $v1, 8
/* B0DF20 80096D80 AE0D02C0 */ sw $t5, 0x2c0($s0)
/* B0DF24 80096D84 AC6F0004 */ sw $t7, 4($v1)
/* B0DF28 80096D88 AC6E0000 */ sw $t6, ($v1)
/* B0DF2C 80096D8C 8E0302C0 */ lw $v1, 0x2c0($s0)
/* B0DF30 80096D90 3C19DD00 */ lui $t9, (0xDD0007FF >> 16) # lui $t9, 0xdd00
/* B0DF34 80096D94 3C0A0011 */ lui $t2, %hi(D_00113070)
/* B0DF34 80096D94 3C0A0011 */ lui $t2, %hi(D_80113070-0x80000000)
/* B0DF38 80096D98 24780008 */ addiu $t8, $v1, 8
/* B0DF3C 80096D9C AE1802C0 */ sw $t8, 0x2c0($s0)
/* B0DF40 80096DA0 254A3070 */ addiu $t2, %lo(D_00113070)
/* B0DF40 80096DA0 254A3070 */ addiu $t2, %lo(D_80113070-0x80000000)
/* B0DF44 80096DA4 373907FF */ ori $t9, (0xDD0007FF & 0xFFFF) # ori $t9, $t9, 0x7ff
/* B0DF48 80096DA8 AC790000 */ sw $t9, ($v1)
/* B0DF4C 80096DAC AC6A0004 */ sw $t2, 4($v1)

View file

@ -28,7 +28,10 @@ glabel D_80155F50
.incbin "baserom.z64", 0xBCD0F0, 0x1630
glabel D_80157580
.incbin "baserom.z64", 0xBCE720, 0x7B0
.incbin "baserom.z64", 0xBCE720, 0x420
glabel D_801579A0
.incbin "baserom.z64", 0xBCEB40, 0x390
glabel D_80157D30
.incbin "baserom.z64", 0xBCEED0, 0x60

View file

@ -7,6 +7,8 @@
.section .text
.balign 16
glabel D_801120C0
.incbin "baserom.z64", 0xB89260, 0xFB0

View file

@ -1,16 +0,0 @@
.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 purpose registers
.section .data
.balign 16
glabel D_8012DBA0
.incbin "baserom.z64", 0xBA4D40, 0x4
glabel D_8012DBA4
.incbin "baserom.z64", 0xBA4D44, 0xC

View file

@ -10,4 +10,6 @@
.balign 16
glabel D_80120030
.incbin "baserom.z64", 0xB971D0, 0x10
.word func_8007A0B4
.word func_8007A40C
.word func_8007A0B4

View file

@ -34,10 +34,19 @@ glabel D_80125C9B
.incbin "baserom.z64", 0xB9CE3B, 0x1
glabel D_80125C9C
.incbin "baserom.z64", 0xB9CE3C, 0xCC
.incbin "baserom.z64", 0xB9CE3C, 0x4C
glabel D_80125CE8
.incbin "baserom.z64", 0xB9CE88, 0x40
glabel D_80125D28
.incbin "baserom.z64", 0xB9CEC8, 0x40
glabel D_80125D68
.incbin "baserom.z64", 0xB9CF08, 0x80
.incbin "baserom.z64", 0xB9CF08, 0x20
glabel D_80125D88
.incbin "baserom.z64", 0xB9CF28, 0x60
glabel D_80125DE8
.incbin "baserom.z64", 0xB9CF88, 0x20
@ -46,13 +55,52 @@ glabel D_80125E08
.incbin "baserom.z64", 0xB9CFA8, 0x10
glabel D_80125E18
.incbin "baserom.z64", 0xB9CFB8, 0x40
.incbin "baserom.z64", 0xB9CFB8, 0x10
glabel D_80125E28
.incbin "baserom.z64", 0xB9CFC8, 0x10
glabel D_80125E38
.incbin "baserom.z64", 0xB9CFD8, 0x10
glabel D_80125E48
.incbin "baserom.z64", 0xB9CFE8, 0x10
glabel D_80125E58
.incbin "baserom.z64", 0xB9CFF8, 0xA0
.incbin "baserom.z64", 0xB9CFF8, 0x10
glabel D_80125E68
.incbin "baserom.z64", 0xB9D008, 0x10
glabel D_80125E78
.incbin "baserom.z64", 0xB9D018, 0x10
glabel D_80125E88
.incbin "baserom.z64", 0xB9D028, 0x10
glabel D_80125E98
.incbin "baserom.z64", 0xB9D038, 0x10
glabel D_80125EA8
.incbin "baserom.z64", 0xB9D048, 0x10
glabel D_80125EB8
.incbin "baserom.z64", 0xB9D058, 0x10
glabel D_80125EC8
.incbin "baserom.z64", 0xB9D068, 0x10
glabel D_80125ED8
.incbin "baserom.z64", 0xB9D078, 0x10
glabel D_80125EE8
.incbin "baserom.z64", 0xB9D088, 0x10
glabel D_80125EF8
.incbin "baserom.z64", 0xB9D098, 0x20
.incbin "baserom.z64", 0xB9D098, 0x10
glabel D_80125F08
.incbin "baserom.z64", 0xB9D0A8, 0x10
glabel D_80125F18
.incbin "baserom.z64", 0xB9D0B8, 0x8
@ -70,7 +118,28 @@ glabel D_80125F38
.incbin "baserom.z64", 0xB9D0D8, 0x8
glabel D_80125F40
.incbin "baserom.z64", 0xB9D0E0, 0x58
.word D_80125E08
.word D_80125E18
.word D_80125E38
.word D_80125E28
.word D_80125DE8
.word D_80125EE8
.word D_80125EF8
.word D_80125F08
.word D_80125E48
.word D_80125E58
.word D_80125CE8
.word D_80125E68
.word D_80125EA8
.word D_80125EB8
.word D_80125EC8
.word D_80125ED8
.word D_80125E78
.word D_80125E88
.word D_80125D28
.word D_80125D88
.word D_80125E98
.word 0x00000000
glabel D_80125F98
.incbin "baserom.z64", 0xB9D138, 0x10

View file

@ -4,9 +4,6 @@
#include <z64.h>
#include <segment_symbols.h>
extern u8 D_00113070[];
extern u8 D_001579A0[];
extern u8 D_02000000[];
extern u8 D_02000400[];
extern u8 D_02000500[];
@ -281,7 +278,6 @@ extern u16 D_8011FB40;
//extern ? D_8011FE94;
//extern ? D_8011FEC4;
//extern ? D_8011FED0;
//extern ? D_80120030;
extern s32 gZeldaArenaLogSeverity;
extern s16 D_80120130;
//extern ? D_80120134;
@ -622,8 +618,6 @@ extern u8 D_8012DBB0;
extern u32 D_8012DBC0;
extern volatile u32 gIrqMgrResetStatus;
extern volatile OSTime gIrqMgrRetraceTime;
extern u32 D_8012DBA0;
extern u32 D_8012DBA4;
extern s32 gDebugArenaLogSeverity;
//extern ? D_8012DCA0;
//extern ? D_8012DCF8;
@ -3283,6 +3277,7 @@ extern char D_80146238[];
//extern ? D_80155C70;
extern u8 D_80155F50[];
extern u8 D_80157580[];
extern u8 D_801579A0[];
extern u8 D_80157D30[];
//extern ? D_8015BB90;
//extern ? D_8015BC30;

1
spec
View file

@ -417,7 +417,6 @@ beginseg
include "build/src/code/sys_math_atan.o"
include "build/src/code/sys_matrix.o"
include "build/src/code/sys_ucode.o"
include "build/data/sys_ucode.data.o"
include "build/src/code/code_800D2E30.o"
include "build/data/code_800D2E30.data.o"
include "build/src/code/code_800D31A0.o"

View file

@ -8,7 +8,7 @@ StackEntry sIdleThreadInfo;
u8 sBootThreadStack[0x400];
void cleararena(void) {
bzero(_dmadataSegmentStart, (u8*)osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart));
bzero(_dmadataSegmentStart, osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart));
}
void bootproc(void) {

View file

@ -1,5 +1,8 @@
#include <global.h>
u32 D_8012DBA0 = (u32)&D_80155F50;
u32 D_8012DBA4 = (u32)&D_80157580;
u32 SysUcode_GetUCodeBoot() {
return &D_80009320;
}

View file

@ -362,7 +362,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
if (sp98) {
// gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)?
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800);
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
if (1) {
Vec3f sp60;
@ -469,7 +469,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
if (sp94) {
// gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)?
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800);
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
if (1) {
Vec3f sp5C;

View file

@ -1,7 +1,3 @@
// rsp microcode symbols
D_00113070 = 0x00113070;
D_001579A0 = 0x001579A0;
// libultra OS symbols
D_80000000 = 0x80000000;
D_80000002 = 0x80000002;