mirror of https://github.com/zeldaret/mm.git
Decomp idle.c
This commit is contained in:
parent
60a7168cea
commit
e74e227113
2
Makefile
2
Makefile
|
|
@ -25,7 +25,7 @@ build/src/boot_O2_g3_trapuv/%: OPTIMIZATION := -O2 -g3
|
|||
build/src/code/%: CFLAGS := $(CFLAGS) -Wab,-r4300_mul
|
||||
build/src/actors/%: CFLAGS := $(CFLAGS) -Wab,-r4300_mul
|
||||
build/src/boot_O2_g3_trapuv/%: CFLAGS := $(CFLAGS) -trapuv
|
||||
test.txt: OPTIMIZATION := -O2
|
||||
test.txt: OPTIMIZATION := -O2 -g3
|
||||
test.txt: CC := $(QEMU_IRIX) -L $(IRIX_71_ROOT) $(IRIX_71_ROOT)/usr/bin/cc
|
||||
test.txt: CFLAGS := $(CFLAGS) -Wab,-r4300_mul
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ void Idle_InitCodeAndMemory(void); // func_80080250
|
|||
void Idle_MainThreadEntry(void* arg); // func_80080300
|
||||
void func_8008038C(void); // func_8008038C
|
||||
void Idle_ThreadEntry(void* arg); // func_80080514
|
||||
void func_800805E0(void); // func_800805E0
|
||||
void func_800805E0(s32 param_1); // func_800805E0
|
||||
void func_80080748(void); // func_80080748
|
||||
s32 Dmamgr_DoDmaTransfer(u32 src, void* dst, u32 size); // func_80080790
|
||||
void Dmamgr_osEPiStartDmaWrapper(OSPiHandle* pOParm1, OSIoMesg* pOParm2, s32 OParm3); // func_800808D4
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef _SECTION_H_
|
||||
#define _SECTION_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
extern u32 boot_text_start;
|
||||
extern u32 boot_text_end;
|
||||
|
||||
extern u32 boot_data_start;
|
||||
extern u32 boot_data_end;
|
||||
|
||||
extern u32 boot_rodata_start;
|
||||
extern u32 boot_rodata_end;
|
||||
|
||||
extern u32 boot_bss_start;
|
||||
extern u32 boot_bss_end;
|
||||
|
||||
extern u32 code_text_start;
|
||||
extern u32 code_text_end;
|
||||
|
||||
extern u32 code_data_start;
|
||||
extern u32 code_data_end;
|
||||
|
||||
extern u32 code_rodata_start;
|
||||
extern u32 code_rodata_end;
|
||||
|
||||
extern u32 code_bss_start;
|
||||
extern u32 code_bss_end;
|
||||
|
||||
#endif
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
#include <structs.h>
|
||||
#include <dmadata.h>
|
||||
#include <segment.h>
|
||||
#include <section.h>
|
||||
#include <pre_boot_variables.h>
|
||||
|
||||
extern UNK_TYPE1 D_800969C0; // D_800969C0
|
||||
|
|
@ -92,7 +93,7 @@ extern char dmamgrString800981D4[]; // D_800981D4
|
|||
extern char dmamgrString800981E4[]; // D_800981E4
|
||||
extern char dmamgrString800981F4[]; // D_800981F4
|
||||
extern char dmamgrThreadName[]; // D_80098204
|
||||
extern UNK_TYPE1 D_80098210; // D_80098210
|
||||
extern char D_80098210[]; // D_80098210
|
||||
extern char yaz0String80098220[]; // D_80098220
|
||||
extern char yaz0String8009823C[]; // D_8009823C
|
||||
extern char D_80098280[]; // D_80098280
|
||||
|
|
@ -230,46 +231,46 @@ extern char D_80099078[]; // D_80099078
|
|||
extern char D_8009907C[]; // D_8009907C
|
||||
extern char D_80099080[]; // D_80099080
|
||||
extern char D_800990B0[]; // D_800990B0
|
||||
extern f32 D_800990C0; // D_800990C0
|
||||
extern UNK_TYPE4 D_800990E4; // D_800990E4
|
||||
extern UNK_TYPE4 D_800990E8; // D_800990E8
|
||||
extern UNK_TYPE4 D_800990EC; // D_800990EC
|
||||
extern UNK_TYPE4 D_800990F0; // D_800990F0
|
||||
extern UNK_TYPE4 D_800990F4; // D_800990F4
|
||||
extern UNK_TYPE4 D_800990F8; // D_800990F8
|
||||
extern UNK_TYPE4 D_800990FC; // D_800990FC
|
||||
extern UNK_TYPE4 D_80099100; // D_80099100
|
||||
extern UNK_TYPE4 D_80099104; // D_80099104
|
||||
extern UNK_TYPE4 D_80099108; // D_80099108
|
||||
extern UNK_TYPE4 D_8009910C; // D_8009910C
|
||||
extern UNK_TYPE1 D_800991A0; // D_800991A0
|
||||
extern f32 D_800990C0[9]; // D_800990C0
|
||||
extern f32 D_800990E4; // D_800990E4
|
||||
extern f32 D_800990E8; // D_800990E8
|
||||
extern f32 D_800990EC; // D_800990EC
|
||||
extern f32 D_800990F0; // D_800990F0
|
||||
extern f32 D_800990F4; // D_800990F4
|
||||
extern f32 D_800990F8; // D_800990F8
|
||||
extern f32 D_800990FC; // D_800990FC
|
||||
extern f32 D_80099100; // D_80099100
|
||||
extern f32 D_80099104; // D_80099104
|
||||
extern f32 D_80099108; // D_80099108
|
||||
extern f32 D_8009910C; // D_8009910C
|
||||
extern u16 D_800991A0[64]; // D_800991A0
|
||||
extern du P[5]; // D_80099220
|
||||
extern du rpi; // D_80099248
|
||||
extern du pihi; // D_80099250
|
||||
extern du pilo; // D_80099258
|
||||
extern fu zero; // D_80099260
|
||||
extern UNK_TYPE1 __osHwIntTable; // D_80099270
|
||||
extern UNK_PTR leoDiskStack; // D_80099290
|
||||
extern UNK_TYPE1 D_80099270; // D_80099270
|
||||
extern UNK_PTR __osIntTable; // D_80099290
|
||||
extern f64 D_800992C0; // D_800992C0
|
||||
extern f64 D_800992F0; // D_800992F0
|
||||
extern f64 D_800992F8; // D_800992F8
|
||||
extern UNK_TYPE1 D_80099300; // D_80099300
|
||||
extern char D_80099300[]; // D_80099300
|
||||
extern char D_80099304[]; // D_80099304
|
||||
extern UNK_TYPE1 D_8009930C; // D_8009930C
|
||||
extern UNK_TYPE1 D_80099400; // D_80099400
|
||||
extern f32 D_80099400; // D_80099400
|
||||
extern f64 D_80099428; // D_80099428
|
||||
extern f64 D_80099430; // D_80099430
|
||||
extern f64 D_80099438; // D_80099438
|
||||
extern UNK_TYPE4 D_80099440; // D_80099440
|
||||
extern f32 __libm_qnan_f; // D_80099450
|
||||
extern UNK_TYPE8 D_80099460; // D_80099460
|
||||
extern UNK_TYPE1 D_800994A8; // D_800994A8
|
||||
extern UNK_TYPE1 D_800994AC; // D_800994AC
|
||||
extern UNK_TYPE1 D_800994B0; // D_800994B0
|
||||
extern f64 D_80099460[9]; // D_80099460
|
||||
extern char D_800994A8[]; // D_800994A8
|
||||
extern char D_800994AC[]; // D_800994AC
|
||||
extern char D_800994B0[]; // D_800994B0
|
||||
extern UNK_TYPE1 D_800994B1; // D_800994B1
|
||||
extern UNK_TYPE8 D_800994B8; // D_800994B8
|
||||
extern UNK_TYPE1 D_800994C0; // D_800994C0
|
||||
extern UNK_TYPE1 D_800994C8; // D_800994C8
|
||||
extern f64 D_800994B8; // D_800994B8
|
||||
extern f64 D_800994C0; // D_800994C0
|
||||
extern f64 D_800994C8; // D_800994C8
|
||||
extern char D_800994D0[]; // D_800994D0
|
||||
extern char D_800994DC[]; // D_800994DC
|
||||
extern StackEntry bootStackEntry; // D_80099500
|
||||
|
|
@ -283,7 +284,7 @@ extern StackEntry irqmgrStackEntry; // D_8009A670
|
|||
extern OSThread mainOSThread; // D_8009A690
|
||||
extern u8 mainStack[2304]; // D_8009A840
|
||||
extern StackEntry mainStackEntry; // D_8009B140
|
||||
extern UNK_TYPE4 D_8009B160[50]; // D_8009B160
|
||||
extern OSMesg D_8009B160[50]; // D_8009B160
|
||||
extern OSMesgQueue D_8009B228; // D_8009B228
|
||||
extern OSViMode D_8009B240; // D_8009B240
|
||||
extern u8 D_8009B290; // D_8009B290
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ SECTIONS
|
|||
|
||||
boot 0x80080060:
|
||||
{
|
||||
boot_text_start = .;
|
||||
build/src/boot_O2_g3/boot_0x80080060.o(.text)
|
||||
build/asm/idle.o(.text)
|
||||
build/src/boot_O2_g3/idle.o(.text)
|
||||
build/src/boot_O2_g3/boot_0x800805E0.o(.text)
|
||||
build/src/boot_O2_g3/z_std_dma.o(.text)
|
||||
build/asm/boot_0x80080E30.o(.text)
|
||||
|
|
@ -195,11 +196,15 @@ SECTIONS
|
|||
build/src/boot_O2_g3/boot_0x800968B0.o(.text)
|
||||
build/asm/boot_0x800968F0.o(.text)
|
||||
build/asm/boot_0x80096930.o(.text)
|
||||
boot_text_end = .;
|
||||
|
||||
boot_data_start = .;
|
||||
build/asm/boot_data.o(.text)
|
||||
boot_data_end = .;
|
||||
|
||||
boot_rodata_start = .;
|
||||
build/src/boot_O2_g3/boot_0x80080060.o(.rodata)
|
||||
build/asm/boot_rodata_idle.o(.text)
|
||||
build/src/boot_O2_g3/idle.o(.rodata)
|
||||
build/asm/boot_rodata_z_std_dma.o(.text)
|
||||
build/asm/boot_rodata_0x80080E30.o(.text)
|
||||
build/asm/boot_rodata_0x80081250.o(.text)
|
||||
|
|
@ -222,13 +227,16 @@ SECTIONS
|
|||
build/asm/boot_rodata_xldtob.o(.text)
|
||||
build/asm/boot_rodata_llcvt.o(.text)
|
||||
build/asm/boot_rodata_build_date.o(.text)
|
||||
|
||||
boot_bss_start = .;
|
||||
boot_rodata_end = .;
|
||||
}
|
||||
|
||||
boot_bss_start = .;
|
||||
. += 0xC5C0;
|
||||
boot_bss_end = .;
|
||||
|
||||
code :
|
||||
{
|
||||
code_text_start = .;
|
||||
build/src/code/code_0x800A5AC0.o(.text)
|
||||
build/asm/z_en_item00.o(.text)
|
||||
build/asm/z_eff_blure.o(.text)
|
||||
|
|
@ -364,9 +372,13 @@ SECTIONS
|
|||
build/asm/code_0x801AA020.o(.text)
|
||||
build/asm/code_0x801AA610.o(.text)
|
||||
build/asm/code_0x801AAAA0.o(.text)
|
||||
code_text_end = .;
|
||||
|
||||
code_data_start = .;
|
||||
build/asm/code_data.o(.text)
|
||||
code_data_end = .;
|
||||
|
||||
code_rodata_start = .;
|
||||
build/asm/code_rodata_z_en_item00.o(.text)
|
||||
build/asm/code_rodata_z_eff_blure.o(.text)
|
||||
build/asm/code_rodata_z_eff_shield_particle.o(.text)
|
||||
|
|
@ -444,10 +456,13 @@ SECTIONS
|
|||
build/asm/code_rodata_0x801A5BD0.o(.text)
|
||||
build/asm/code_rodata_0x801A7B10.o(.text)
|
||||
build/asm/code_rodata_0x801AA610.o(.text)
|
||||
|
||||
code_bss_start = .;
|
||||
code_rodata_end = .;
|
||||
}
|
||||
|
||||
code_bss_start = .;
|
||||
. += 0x24F00;
|
||||
code_bss_end = .;
|
||||
|
||||
ovl_title 0x80800000:
|
||||
{
|
||||
build/asm/ovl_title_0x80800000.o(.text)
|
||||
|
|
|
|||
|
|
@ -1,108 +0,0 @@
|
|||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_80080180(UNK_TYPE* a0, UNK_TYPE a1, UNK_TYPE a2) {
|
||||
while (a1 -= sizeof(u32)) {
|
||||
*a0++ = a2;
|
||||
}
|
||||
}
|
||||
|
||||
UNK_RET func_8008019C(void) {
|
||||
func_80080180(&D_80000500, 0x25800, 0x00010001);
|
||||
func_800805E0(0);
|
||||
func_8008FE60(&D_80000500);
|
||||
func_8008AE70(0);
|
||||
}
|
||||
|
||||
UNK_RET func_800801EC(void) {
|
||||
UNK_TYPE sp1C;
|
||||
UNK_PTR sp18 = (UNK_PTR)(0x80000000 + osMemSize);
|
||||
func_80080150((void*)0x80000400, &D_80000500);
|
||||
func_80080150(&D_80025D00, (int*)func_80080060);
|
||||
func_80080150(&D_80208EA0, sp18);
|
||||
}
|
||||
|
||||
UNK_RET func_80080250(void) {
|
||||
UNK_TYPE* v0;
|
||||
UNK_PTR v1;
|
||||
UNK_PTR t7;
|
||||
UNK_TYPE sp58;
|
||||
UNK_TYPE sp54;
|
||||
UNK_TYPE sp50;
|
||||
UNK_TYPE sp4C;
|
||||
UNK_TYPE sp48;
|
||||
OSMesgQueue sp30;
|
||||
OSMesg sp2C;
|
||||
UNK_TYPE sp28;
|
||||
|
||||
osCreateMesgQueue(&sp30, &sp2C, 1);
|
||||
|
||||
v1 = &code_vrom_start;
|
||||
t7 = &code_vrom_end;
|
||||
v0 = &dmamgrChunkSize;
|
||||
sp28 = *v0;
|
||||
*v0 = 0;
|
||||
|
||||
func_80080C04((DmaRequest*)&sp48, (UNK_FUN_ARG)func_800A5AC0, v1, (u32)t7 - (u32)v1, 0, &sp30, 0);
|
||||
func_8008019C();
|
||||
func_800801EC();
|
||||
osRecvMesg(&sp30, 0, 1);
|
||||
|
||||
dmamgrChunkSize = sp28;
|
||||
|
||||
func_80080150(&D_801E3FA0, &D_80208EA0);
|
||||
}
|
||||
|
||||
UNK_RET func_80080300(UNK_TYPE a0) {
|
||||
func_80085320(&irqmgrThreadInfo, &irqmgrStack, &irqmgrStack[1280], 0, 256, &irqmgrThreadName);
|
||||
func_80081754(&irqmgrContext, &irqmgrThreadInfo, 18, 1);
|
||||
func_80080D0C();
|
||||
func_80080250();
|
||||
func_80174BF0(a0);
|
||||
func_80080E00();
|
||||
}
|
||||
|
||||
void func_8008038C(void) {
|
||||
u32 i;
|
||||
osCreateViManager(254);
|
||||
|
||||
viEnabledSpecialFeatures = 66;
|
||||
screenXScale = 1.0;
|
||||
screenYScale = 1.0;
|
||||
|
||||
switch (osTvType) {
|
||||
case 1:
|
||||
D_8009B290 = 2;
|
||||
for (i = 0; i < 20; i++) {
|
||||
D_800980E0[i] = D_8009B240[i];
|
||||
}
|
||||
screenYScale = D_800981B0;
|
||||
break;
|
||||
case 2:
|
||||
D_8009B290 = 30;
|
||||
for (i = 0; i < 20; i++) {
|
||||
osViModeMpalLan1[i] = D_8009B240[i];
|
||||
}
|
||||
screenYScale = D_800981B0;
|
||||
break;
|
||||
case 0:
|
||||
D_8009B290 = 44;
|
||||
for (i = 0; i < 20; i++) {
|
||||
osViModeNtscLan1[i] = D_8009B240[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
D_80096B20 = 1;
|
||||
}
|
||||
|
||||
void func_80080514(UNK_TYPE a0) {
|
||||
func_8008038C();
|
||||
osCreatePiManager(150, (OSMesgQueue*)&D_8009B228, (OSMesg*)&D_8009B160, 50);
|
||||
func_80085320(&mainThreadInfo, &mainStack, &mainStack[2304], 0, 1024, &mainThreadName);
|
||||
osCreateThread((OSThread*)&mainOSThread, 3, (void (*)(void*))func_80080300, (void*)a0, (void*)&mainThreadInfo, 12);
|
||||
osStartThread((OSThread*)&mainOSThread);
|
||||
osSetThreadPri(NULL, 0);
|
||||
|
||||
while(1);
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Idle_ClearMemory(void* begin, void* end){
|
||||
if (begin < end) {
|
||||
bzero(begin, (s32)(int)end - (int)begin);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// This loop shouldn't unroll
|
||||
void Idle_InitFramebuffer(u32* ptr, u32 numBytes, u32 value) {
|
||||
while (numBytes) {
|
||||
*ptr++ = value;
|
||||
numBytes -= sizeof(u32);
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("./asm/nonmatching/idle/Idle_InitFramebuffer.asm")
|
||||
#endif
|
||||
|
||||
void Idle_InitScreen(void) {
|
||||
Idle_InitFramebuffer((u32*)&D_80000500, 0x25800, 0x00010001);
|
||||
func_800805E0(0);
|
||||
osViSwapBuffer(&D_80000500);
|
||||
osViRepeatLine(0);
|
||||
}
|
||||
|
||||
void Idle_InitMemory(void) {
|
||||
u32 pad;
|
||||
void* memEnd = (void*)(0x80000000 + osMemSize);
|
||||
|
||||
Idle_ClearMemory((void*)0x80000400, &D_80000500);
|
||||
Idle_ClearMemory(&D_80025D00, (int*)&boot_text_start);
|
||||
Idle_ClearMemory(&code_bss_end, memEnd);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc around Dmamgr_SendRequest
|
||||
void Idle_InitCodeAndMemory(void) {
|
||||
DmaRequest dmaReq;
|
||||
OSMesgQueue queue;
|
||||
OSMesg mesg;
|
||||
u32 oldSize;
|
||||
|
||||
osCreateMesgQueue(&queue, &mesg, 1);
|
||||
|
||||
oldSize = dmamgrChunkSize;
|
||||
dmamgrChunkSize = 0;
|
||||
|
||||
Dmamgr_SendRequest(&dmaReq, (u32)&code_text_start, (u32)&code_vrom_start, (u32)&code_vrom_end - (u32)&code_vrom_start, 0, &queue, 0);
|
||||
Idle_InitScreen();
|
||||
Idle_InitMemory();
|
||||
osRecvMesg(&queue, 0, 1);
|
||||
|
||||
dmamgrChunkSize = oldSize;
|
||||
|
||||
Idle_ClearMemory(&code_bss_start, &code_bss_end);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("./asm/nonmatching/idle/Idle_InitCodeAndMemory.asm")
|
||||
#endif
|
||||
|
||||
void Idle_MainThreadEntry(void* arg) {
|
||||
StackCheck_Init(&irqmgrStackEntry, (u32)&irqmgrStack, (u32)&irqmgrStack[1280], 0, 256, "irqmgr");
|
||||
Irqmgr_Start(&irqmgrContext, &irqmgrStackEntry, 18, 1);
|
||||
Dmamgr_Start();
|
||||
Idle_InitCodeAndMemory();
|
||||
main(arg);
|
||||
Dmamgr_Stop();
|
||||
}
|
||||
|
||||
void func_8008038C(void) {
|
||||
osCreateViManager(254);
|
||||
|
||||
viEnabledSpecialFeatures = 66;
|
||||
screenXScale = 1.0;
|
||||
screenYScale = 1.0;
|
||||
|
||||
switch (osTvType) {
|
||||
case 1:
|
||||
D_8009B290 = 2;
|
||||
D_8009B240 = osViModeNtscLan1;
|
||||
break;
|
||||
case 2:
|
||||
D_8009B290 = 30;
|
||||
D_8009B240 = osViModeMpalLan1;
|
||||
break;
|
||||
case 0:
|
||||
D_8009B290 = 44;
|
||||
D_8009B240 = D_800980E0;
|
||||
screenYScale = 0.833f;
|
||||
break;
|
||||
}
|
||||
|
||||
D_80096B20 = 1;
|
||||
}
|
||||
|
||||
void Idle_ThreadEntry(void* arg) {
|
||||
func_8008038C();
|
||||
osCreatePiManager(150, &D_8009B228, D_8009B160, 50);
|
||||
StackCheck_Init(&mainStackEntry, (u32)&mainStack, (u32)&mainStack[2304], 0, 1024, "main");
|
||||
osCreateThread(&mainOSThread, 3, (osCreateThread_func)Idle_MainThreadEntry, arg, &mainStack[2304], 12);
|
||||
osStartThread(&mainOSThread);
|
||||
osSetThreadPri(NULL, 0);
|
||||
|
||||
for(;;);
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ boot_0x800805E0
|
|||
boot_0x800968B0
|
||||
fault
|
||||
fault_drawer
|
||||
idle
|
||||
stackcheck
|
||||
z_actor
|
||||
z_DLF
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
0x80080300:("Idle_MainThreadEntry","void","void* arg"),
|
||||
0x8008038C:("func_8008038C","void","void"),
|
||||
0x80080514:("Idle_ThreadEntry","void","void* arg"),
|
||||
0x800805E0:("func_800805E0","void","void"),
|
||||
0x800805E0:("func_800805E0","void","s32 param_1"),
|
||||
0x80080748:("func_80080748","void","void"),
|
||||
0x80080790:("Dmamgr_DoDmaTransfer","s32","u32 src, void* dst, u32 size"),
|
||||
0x800808D4:("Dmamgr_osEPiStartDmaWrapper","void","OSPiHandle* pOParm1, OSIoMesg* pOParm2, s32 OParm3"),
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
0x800981E4:("dmamgrString800981E4","char","[]",0xf),
|
||||
0x800981F4:("dmamgrString800981F4","char","[]",0xf),
|
||||
0x80098204:("dmamgrThreadName","char","[]",0x7),
|
||||
0x80098210:("D_80098210","UNK_TYPE1","",0x1),
|
||||
0x80098210:("D_80098210","char","[]",0xe),
|
||||
0x80098220:("yaz0String80098220","char","[]",0x1c),
|
||||
0x8009823C:("yaz0String8009823C","char","[]",0x1e),
|
||||
0x80098260:("__switch_D_80098260","UNK_PTR","",0x4),
|
||||
|
|
@ -226,48 +226,48 @@
|
|||
0x80099080:("D_80099080","char","[]",0x7),
|
||||
0x80099090:("__switch_D_80099090","UNK_PTR","",0x4),
|
||||
0x800990B0:("D_800990B0","char","[]",0x6),
|
||||
0x800990C0:("D_800990C0","f32","",0x4),
|
||||
0x800990E4:("D_800990E4","UNK_TYPE4","",0x4),
|
||||
0x800990E8:("D_800990E8","UNK_TYPE4","",0x4),
|
||||
0x800990EC:("D_800990EC","UNK_TYPE4","",0x4),
|
||||
0x800990F0:("D_800990F0","UNK_TYPE4","",0x4),
|
||||
0x800990F4:("D_800990F4","UNK_TYPE4","",0x4),
|
||||
0x800990F8:("D_800990F8","UNK_TYPE4","",0x4),
|
||||
0x800990FC:("D_800990FC","UNK_TYPE4","",0x4),
|
||||
0x80099100:("D_80099100","UNK_TYPE4","",0x4),
|
||||
0x80099104:("D_80099104","UNK_TYPE4","",0x4),
|
||||
0x80099108:("D_80099108","UNK_TYPE4","",0x4),
|
||||
0x8009910C:("D_8009910C","UNK_TYPE4","",0x4),
|
||||
0x800991A0:("D_800991A0","UNK_TYPE1","",0x1),
|
||||
0x800990C0:("D_800990C0","f32","[9]",0x24),
|
||||
0x800990E4:("D_800990E4","f32","",0x4),
|
||||
0x800990E8:("D_800990E8","f32","",0x4),
|
||||
0x800990EC:("D_800990EC","f32","",0x4),
|
||||
0x800990F0:("D_800990F0","f32","",0x4),
|
||||
0x800990F4:("D_800990F4","f32","",0x4),
|
||||
0x800990F8:("D_800990F8","f32","",0x4),
|
||||
0x800990FC:("D_800990FC","f32","",0x4),
|
||||
0x80099100:("D_80099100","f32","",0x4),
|
||||
0x80099104:("D_80099104","f32","",0x4),
|
||||
0x80099108:("D_80099108","f32","",0x4),
|
||||
0x8009910C:("D_8009910C","f32","",0x4),
|
||||
0x800991A0:("D_800991A0","u16","[64]",0x80),
|
||||
0x80099220:("P","du","[5]",0x28),
|
||||
0x80099248:("rpi","du","",0x8),
|
||||
0x80099250:("pihi","du","",0x8),
|
||||
0x80099258:("pilo","du","",0x8),
|
||||
0x80099260:("zero","fu","",0x4),
|
||||
0x80099270:("__osHwIntTable","UNK_TYPE1","",0x1),
|
||||
0x80099290:("leoDiskStack","UNK_PTR","",0x4),
|
||||
0x80099270:("D_80099270","UNK_TYPE1","",0x1),
|
||||
0x80099290:("__osIntTable","UNK_PTR","",0x4),
|
||||
0x800992C0:("D_800992C0","f64","",0x8),
|
||||
0x800992D0:("__switch_D_800992D0","UNK_PTR","",0x4),
|
||||
0x800992F0:("D_800992F0","f64","",0x8),
|
||||
0x800992F8:("D_800992F8","f64","",0x8),
|
||||
0x80099300:("D_80099300","UNK_TYPE1","",0x1),
|
||||
0x80099300:("D_80099300","char","[]",0x4),
|
||||
0x80099304:("D_80099304","char","[]",0x6),
|
||||
0x8009930C:("D_8009930C","UNK_TYPE1","",0x1),
|
||||
0x80099324:("__switch_D_80099324","UNK_PTR","",0x4),
|
||||
0x80099400:("D_80099400","UNK_TYPE1","",0x1),
|
||||
0x80099400:("D_80099400","f32","",0x4),
|
||||
0x80099428:("D_80099428","f64","",0x8),
|
||||
0x80099430:("D_80099430","f64","",0x8),
|
||||
0x80099438:("D_80099438","f64","",0x8),
|
||||
0x80099440:("D_80099440","UNK_TYPE4","",0x4),
|
||||
0x80099450:("__libm_qnan_f","f32","",0x4),
|
||||
0x80099460:("D_80099460","UNK_TYPE8","",0x8),
|
||||
0x800994A8:("D_800994A8","UNK_TYPE1","",0x1),
|
||||
0x800994AC:("D_800994AC","UNK_TYPE1","",0x1),
|
||||
0x800994B0:("D_800994B0","UNK_TYPE1","",0x1),
|
||||
0x80099460:("D_80099460","f64","[9]",0x48),
|
||||
0x800994A8:("D_800994A8","char","[]",0x4),
|
||||
0x800994AC:("D_800994AC","char","[]",0x4),
|
||||
0x800994B0:("D_800994B0","char","[]",0x2),
|
||||
0x800994B1:("D_800994B1","UNK_TYPE1","",0x1),
|
||||
0x800994B8:("D_800994B8","UNK_TYPE8","",0x8),
|
||||
0x800994C0:("D_800994C0","UNK_TYPE1","",0x1),
|
||||
0x800994C8:("D_800994C8","UNK_TYPE1","",0x1),
|
||||
0x800994B8:("D_800994B8","f64","",0x8),
|
||||
0x800994C0:("D_800994C0","f64","",0x8),
|
||||
0x800994C8:("D_800994C8","f64","",0x8),
|
||||
0x800994D0:("D_800994D0","char","[]",0xc),
|
||||
0x800994DC:("D_800994DC","char","[]",0x12),
|
||||
0x80099500:("bootStackEntry","StackEntry","",0x1c),
|
||||
|
|
@ -281,7 +281,7 @@
|
|||
0x8009A690:("mainOSThread","OSThread","",0x1b0),
|
||||
0x8009A840:("mainStack","u8","[2304]",0x900),
|
||||
0x8009B140:("mainStackEntry","StackEntry","",0x1c),
|
||||
0x8009B160:("D_8009B160","UNK_TYPE4","[50]",0xc8),
|
||||
0x8009B160:("D_8009B160","OSMesg","[50]",0xc8),
|
||||
0x8009B228:("D_8009B228","OSMesgQueue","",0x18),
|
||||
0x8009B240:("D_8009B240","OSViMode","",0x50),
|
||||
0x8009B290:("D_8009B290","u8","",0x1),
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ class Disassembler:
|
|||
self.functions = set()
|
||||
self.labels = set()
|
||||
self.vars = set()
|
||||
self.switch_cases = set()
|
||||
self.vars_sorted = list()
|
||||
self.vars_length = dict()
|
||||
self.data_regions = list()
|
||||
|
|
@ -417,7 +418,7 @@ class Disassembler:
|
|||
addr_i = i
|
||||
case_addr = file.get_inst(addr_i)
|
||||
while self.is_in_code(case_addr):
|
||||
self.add_label(case_addr)
|
||||
self.switch_cases.add(case_addr)
|
||||
addr_i += 1
|
||||
if addr_i >= (file.size // 4):
|
||||
break
|
||||
|
|
@ -443,7 +444,9 @@ class Disassembler:
|
|||
f = open(filename, 'w')
|
||||
write_header(f)
|
||||
|
||||
if addr in self.labels:
|
||||
if addr in self.labels and addr not in self.switch_cases:
|
||||
f.write(".L_%08X:\n" % addr)
|
||||
if addr in self.switch_cases:
|
||||
f.write("glabel .L_%08X\n" % addr)
|
||||
if addr in self.functions:
|
||||
name = get_func_name(addr)
|
||||
|
|
@ -456,7 +459,7 @@ class Disassembler:
|
|||
name = self.make_load(addr)
|
||||
f.write("glabel %s\n" % name)
|
||||
f.write("/* %06d 0x%08X */ .word\t%s\n" % (i, addr, get_func_name(inst)))
|
||||
elif inst in self.labels:
|
||||
elif inst in self.switch_cases:
|
||||
if self.is_start_of_variable(addr):
|
||||
name = self.make_load(addr)
|
||||
f.write("glabel %s\n" % name)
|
||||
|
|
@ -938,6 +941,7 @@ class Disassembler:
|
|||
f.write("#include <structs.h>\n"
|
||||
"#include <dmadata.h>\n"
|
||||
"#include <segment.h>\n"
|
||||
"#include <section.h>\n"
|
||||
"#include <pre_boot_variables.h>\n"
|
||||
"\n"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue