Finished 1B3E0

Finished 42C30
Finished 1B510
Finished 19DD0
This commit is contained in:
Ogre 2023-09-01 14:35:59 +02:00
parent 0352f1bfd7
commit 5c248739e1
8 changed files with 113 additions and 12 deletions

View File

@ -123,7 +123,7 @@ segments:
- [0x1B360, asm]
- [0x1B3A0, asm]
- [0x1B3E0, c]
- [0x1B510, asm]
- [0x1B510, c]
- [0x1B530, asm]
- [0x1B650, asm]
- [0x1B7A0, asm]
@ -362,7 +362,7 @@ segments:
subsegments:
- [0x40E80, asm]
- [0x420D0, asm]
- [0x42C30, asm]
- [0x42C30, c]
- [0x42C90, asm]
- [0x43100, asm]
- [0x45CB0, asm]

View File

@ -5,7 +5,12 @@ void func_8008949C(void*);
INCLUDE_ASM(const s32, "19050", __idle_start_4_threads);
INCLUDE_ASM(const s32, "19050", func_80088EF0);
/* 192F0 80088EF0*/
s32* func_80088EF0(void) {
extern s32 D_800E8B14;
return &D_800E8B14;
}
typedef struct {
/* 0x00 */ OSMesgQueue field_0x0;
@ -87,4 +92,16 @@ INCLUDE_ASM(const s32, "19050", __start_thread_800B9C88);
INCLUDE_ASM(const s32, "19050", func_80089804);
INCLUDE_ASM(const s32, "19050", func_80089990);
/* 19D90 80089990 */
void func_80089990(s32 arg0) {
extern void func_80089A10();
extern s32 D_800AA090;
s32 mask;
func_80089A10();
mask = osSetIntMask(OS_IM_NONE);
D_800AA090 = arg0;
osSetIntMask(mask);
}

View File

@ -2,12 +2,12 @@
#include <PR/os.h>
extern void* FP_800A9E84;
extern void (*SWAP_BUFFER_FUNC)(void* buffers);
void __set_fp_800A9E84(void* arg0) {
void set_swap_buffer_func(void (*arg0)(void*)) {
s32 mask;
mask = osSetIntMask(OS_IM_NONE);
FP_800A9E84 = arg0;
SWAP_BUFFER_FUNC = arg0;
osSetIntMask(mask);
}

View File

@ -3,7 +3,49 @@
void __start_thread_800BE1C0(void);
void __thread_8008AFE0(void*);
INCLUDE_ASM(const s32, "1B3E0", __thread_8008AFE0);
extern void (*D_800AA090)(s32);
extern void (*D_800AA094)();
extern s32 D_800E79A4;
extern OSMesgQueue MQ_800C4C28;
extern OSMesg OSMESG_800BE1A0[8];
/* 1B3E0 8008AFE0 */
void __thread_8008AFE0(void* arg0) {
typedef struct {
/* 0x0 */ void* field_0x0;
/* 0x4 */ OSMesgQueue* field_0x4;
/* 0x8 */ s32 field_0x8;
/* 0xc */ s32 field_0xc;
} Stack;
extern void func_80089054(OSMesg, OSMesgQueue*, s32);
Stack sp10;
u16* sp20;
s16 temp_v0;
osCreateMesgQueue(&MQ_800C4C28, OSMESG_800BE1A0, 8);
func_80089054(&sp10, &MQ_800C4C28, 3);
while(1) {
osRecvMesg(&MQ_800C4C28, &sp20, OS_MESG_BLOCK);
temp_v0 = *sp20;
switch(temp_v0) {
case 1:
if (D_800AA090 != NULL) {
D_800AA090(D_800E79A4);
}
break;
case 2:
if(D_800AA094 != NULL) {
D_800AA094();
}
break;
}
}
}
void __start_thread_800BE1C0(void) {
extern u8 SP_THREAD_800BE1C0[1];

7
src/1B510.c Normal file
View File

@ -0,0 +1,7 @@
#include "common.h"
/* 1B510 8008B110 */
void __osViSwapBuffer_3(void** buffers) {
osViSwapBuffer(buffers[3]);
}

View File

@ -102,7 +102,7 @@ s32 func_80072944(void) {
INCLUDE_ASM(const s32, "main", __calls_copy_controller_data);
INCLUDE_ASM(const s32, "main", func_8007307C);
INCLUDE_ASM(const s32, "main", __calls_osViSwapBuffer_8007307C);
INCLUDE_ASM(const s32, "main", func_80073164);

View File

@ -0,0 +1,33 @@
#include "common.h"
u8 D_80187020;
u8 D_80187021;
/* 42C30 8016CD30 */
u8 func_8016CD30(void) {
return D_80187020;
}
/* 42C3C 8016CD3C */
u8 func_8016CD3C(void) {
u8 temp_v0;
temp_v0 = D_80187021;
D_80187021 = 0;
return temp_v0;
}
/* 42C50 8016CD50 */
void func_8016CD50(u8 arg0) {
D_80187020 = arg0;
}
/* 42C5C 8016CD5C */
void func_8016CD5C(u8 arg0) {
if (D_80187020 != arg0) {
D_80187021 = arg0 + 1;
}
D_80187020 = arg0;
}

View File

@ -12,6 +12,9 @@ D_800E7D90 = 0x800E7D90; // size:0x58
D_800E7DE8 = 0x800E7DE8; // size:0x58
D_800AEFE0 = 0x800AEFE0; // size:0x8
__calls_osViSwapBuffer_8007307C = 0x8007307C;
__osViSwapBuffer_3 = 0x8008B110;
osAiSetFrequency = 0x8008C430;
osAiGetLength = 0x8008C410;
osAiGetStatus = 0x8008C420;
@ -246,9 +249,8 @@ __thread_800893C0 = 0x800893C0;
__thread_80089540 = 0x80089540;
FP_800A9E84 = 0x800A9E84;
__set_fp_800A9E84 = 0x800899D0;
SWAP_BUFFER_FUNC = 0x800A9E84;
set_swap_buffer_func = 0x800899D0;
romCopy = 0x80089F80;