Identified `rodata` sections

Reversed more code
This commit is contained in:
Ogre 2023-09-01 13:09:45 +02:00
parent 83f47e75fc
commit 0352f1bfd7
7 changed files with 115 additions and 23 deletions

View File

@ -101,7 +101,7 @@ segments:
- [0x19050, c]
- [0x19DD0, c]
- [0x19E10, asm]
- [0x19E30, asm, "dma_load_loop"]
- [0x19E30, c]
- [0x19EB0, asm]
- [0x19FC0, c, "black"]
- [0x1A050, c]
@ -122,7 +122,7 @@ segments:
- [0x1B320, asm]
- [0x1B360, asm]
- [0x1B3A0, asm]
- [0x1B3E0, asm]
- [0x1B3E0, c]
- [0x1B510, asm]
- [0x1B530, asm]
- [0x1B650, asm]
@ -137,7 +137,9 @@ segments:
- [0x1C2B0, asm]
- [0x1C670, asm, "libultra/io/piacs"]
- [0x1C760, asm, "libultra/io/pidma"]
- [0x1C810, asm]
- [0x1C810, asm, "libultra/io/aigetlen"]
- [0x1C820, asm, "libultra/io/aigetstat"]
- [0x1C830, asm, "libultra/io/aisetfreq"]
- [0x1C950, asm]
- [0x1C9F0, asm, "libultra/audio/drvrNew"]
- [0x1D220, asm, "libultra/audio/load"]
@ -339,7 +341,16 @@ segments:
subsegments:
- [0x3F1B0, c]
- [0x3FE70, c]
- [0x40640, asm]
- [0x40640, rodata]
- [0x40690, rodata]
- [0x406E0, rodata]
- [0x40730, rodata]
- [0x40780, rodata]
- [0x407D0, rodata]
- [0x40820, rodata]
- [0x40870, rodata]
- [0x40E10, rodata]
- { start: 0x40E80, type: bss, vram: 0x800EB8F0 }
@ -367,7 +378,35 @@ segments:
- [0x5AFF0, asm]
- [0x5C060, asm]
- [0x5C1D0, asm]
- [0x5C210, asm]
- [0x5C210, rodata]
- [0x5C510, rodata]
- [0x5CD70, rodata]
- [0x5CEF0, rodata]
- [0x5CF00, rodata]
- [0x5CF20, rodata]
- [0x5CF30, rodata]
- [0x650A0, rodata]
- [0x650B0, rodata]
- [0x65220, rodata]
- [0x65230, rodata]
- [0x65260, rodata]
- [0x65280, rodata]
- [0x652A0, rodata]
- [0x65970, rodata]
- [0x659E0, rodata]
- [0x65B00, rodata]
- [0x65B80, rodata]
- [0x65C10, rodata]
- [0x65C50, rodata]
- [0x65CC0, rodata]
- [0x65D60, rodata]
- [0x65DD0, rodata]
- [0x66310, rodata]
- [0x663C0, rodata]
- [0x66570, rodata]
- [0x66B60, rodata]
- [0x66B80, rodata]
- { start: 0x66E10, type: bss, vram: 0x80190F10 }

View File

@ -70,7 +70,14 @@ void __thread_800893C0(void) {
INCLUDE_ASM(const s32, "19050", func_8008949C);
INCLUDE_ASM(const s32, "19050", func_80089528);
// INCLUDE_ASM(const s32, "19050", func_80089528);
void func_80089528(s8 arg0) {
extern s8 D_800E918D;
D_800E918D = arg0;
}
INCLUDE_ASM(const s32, "19050", func_80089534);

18
src/19E30.c Normal file
View File

@ -0,0 +1,18 @@
#include "common.h"
extern void func_80089054(s32*, OSMesgQueue*, s32);
extern void func_80089124(s32*);
void __dma_load_loop(s32 arg0) {
s32 sp10[4];
OSMesgQueue mq;
OSMesg buf;
osCreateMesgQueue(&mq, &buf, 1);
func_80089054(&sp10, &mq, 1);
for(; arg0 != 0; arg0--)
osRecvMesg(&mq, NULL, OS_MESG_BLOCK);
func_80089124(&sp10);
}

View File

@ -2,6 +2,7 @@
void romCopy(const void* src, const void* dst, const s32 len);
s32 func_80089CF8(s16 arg0, s32 arg1);
void __controller_thread_80089D9C(void*);
OSPiHandle* CART_HANDLE;
OSMesgQueue MQ_800BE030;
@ -15,24 +16,36 @@ void func_80089C50(void) {
}
INCLUDE_ASM(const s32, "1A050", __init_controllers);
// INCLUDE_ASM(const s32, "1A050", __init_controllers);
// u8 __init_controllers(void) {
// ? sp18;
// u8 sp28;
extern OSMesg D_800BBE60[8];
extern OSMesgQueue MQ_CONTROLLER;
extern OSThread THREAD_CONTROLLER;
/* 1A060 80089C60 */
u8 __init_controllers(void) {
u8 pattern;
OSContStatus data;
s32 pad[2];
osCreateMesgQueue(&MQ_CONTROLLER, D_800BBE60, 8);
osSetEventMesg(OS_EVENT_SI, &MQ_CONTROLLER, NULL);
osContInit(&MQ_CONTROLLER, &pattern, &data);
osCreateThread(&THREAD_CONTROLLER, 5, __controller_thread_80089D9C, NULL, &MQ_800BE030, 0x73);
osStartThread(&THREAD_CONTROLLER);
return pattern;
}
// osCreateMesgQueue(&MQ_CONTROLLER, &D_800BBE60, 8);
// osSetEventMesg(5, &MQ_CONTROLLER, 0);
// osContInit(&MQ_CONTROLLER, &sp28, &sp18);
// osCreateThread(&THREAD_CONTROLLER, 5, __controller_thread_80089D9C, NULL, &MQ_800BE030, 0x73);
// osStartThread(&THREAD_CONTROLLER);
// return sp28;
// }
// INCLUDE_ASM(const s32, "1A050", func_80089CF8);
extern OSMesgQueue MQ_800E7988;
s32 func_80089CF8(s16 arg0, s32 arg1) {
extern OSMesgQueue MQ_800E7988;
typedef struct {
/* 0x0 */ s16 unk0;
/* 0x4 */ OSMesgQueue* msgQueue;
@ -67,9 +80,6 @@ void __start_controller_thread(void) {
INCLUDE_ASM(const s32, "1A050", __controller_thread_80089D9C);
// INCLUDE_ASM(const s32, "1A050", initialise);
void initialise(void) {
extern s32 func_8008BD30();
extern s32 D_800E7A20;

14
src/1B3E0.c Normal file
View File

@ -0,0 +1,14 @@
#include "common.h"
void __start_thread_800BE1C0(void);
void __thread_8008AFE0(void*);
INCLUDE_ASM(const s32, "1B3E0", __thread_8008AFE0);
void __start_thread_800BE1C0(void) {
extern u8 SP_THREAD_800BE1C0[1];
extern OSThread THREAD_800BE1C0;
osCreateThread(&THREAD_800BE1C0, 4, __thread_8008AFE0, NULL, SP_THREAD_800BE1C0, 0x32);
osStartThread(&THREAD_800BE1C0);
}

View File

@ -1,7 +1,5 @@
#include "common.h"
#include <PR/os.h>
void boot(void);
void idle(void* arg);

View File

@ -10,6 +10,11 @@ D_80197168 = 0x80197168; // size:0x10
D_800E7D90 = 0x800E7D90; // size:0x58
D_800E7DE8 = 0x800E7DE8; // size:0x58
D_800AEFE0 = 0x800AEFE0; // size:0x8
osAiSetFrequency = 0x8008C430;
osAiGetLength = 0x8008C410;
osAiGetStatus = 0x8008C420;
__osException = 0x80098D70;
__osExceptionPreamble = 0x80098D60;
@ -153,6 +158,7 @@ __scExec = 0x800943A4;
__scAppendList = 0x8009434C;
__scTaskComplete = 0x800942C0;
__scTaskReady = 0x8009426C;
__scYield = 0x80094474;
__scHandleRDP = 0x800941DC;
osViGetCurrentFramebuffer = 0x800951E0;