Skip to content

Commit

Permalink
7D140 OK (#50)
Browse files Browse the repository at this point in the history
* Split 7D140

* func_8007C540 OK

* func_8007C5EC OK

* func_8007C61C OK

* func_8007C640 OK

* bss

* Reorder global.h
  • Loading branch information
hensldm authored Jul 20, 2024
1 parent ca20e21 commit 0d88020
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ OSMesgQueue* func_800744B0(UNK_PTR arg0);
void func_800748B0(UNK_PTR arg0);
void func_8007451C(UNK_PTR arg0, OSMesgQueue* arg1);
void func_80074C88(UNK_PTR, struct Input*, s32);
void func_80075020(UNK_PTR, OSMesgQueue*, UNK_PTR, s32, s32, void*);

// dma
void DmaMgr_RequestSync(void* ram, u32 vrom, u32 size);
Expand Down Expand Up @@ -101,9 +102,11 @@ extern MallocRecord D_800F8E58;
extern u8 D_800FAAF8;
extern u8 D_800FAB1C;
extern u8 D_800FAB20;
extern UNK_TYPE D_801001F8;
extern UNK_TYPE D_80108620;
extern UNK_TYPE D_80108624;
extern UNK_TYPE D_80108628;
extern struct Input D_8010DEE0;
extern UNK_TYPE D_8010DF40;


Expand Down
2 changes: 2 additions & 0 deletions include/ys64thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#define Y_THREAD_ID_IDLE 1
#define Y_THREAD_ID_FAULT 2
#define Y_THREAD_ID_MAIN 3
#define Y_THREAD_ID_PAD 7
#define Y_THREAD_ID_DMA 18
#define Y_THREAD_ID_EEPMGR 20

#define Y_PRIORITY_IDLE 10
#define Y_PRIORITY_MAIN 10
#define Y_PRIORITY_PAD 15
#define Y_PRIORITY_EEPMGR 16
#define Y_PRIORITY_DMA 18
#define Y_PRIORITY_FAULT OS_PRIORITY_APPMAX
Expand Down
5 changes: 5 additions & 0 deletions linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,8 @@ sMainStack = 0x800FD5B8;
sMainStackInfo = 0x800FFCB8;
sPiMgrCmdQueue = 0x80100490;
sPiMgrCmdBuff = 0x80100470;
sSerialEventQueue = 0x8010DAA0;
sSerialMsgBuff = 0x8010DAB8;
sPadStack = 0x8010DAC0;
sPadStackInfo = 0x8010DEC0;
D_8010DEE0 = 0x8010DEE0;
30 changes: 30 additions & 0 deletions src/main/7D140.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "global.h"

#include "pad.h"
#include "stack.h"
#include "stackcheck.h"
#include "ys64thread.h"

OSMesgQueue sSerialEventQueue;
OSMesg sSerialMsgBuff[1];
STACK(sPadStack, 0x400);
StackEntry sPadStackInfo;

void func_8007C540(void) {
osCreateMesgQueue(&sSerialEventQueue, sSerialMsgBuff, ARRAY_COUNT(sSerialMsgBuff));
osSetEventMesg(OS_EVENT_SI, &sSerialEventQueue, NULL);
StackCheck_Init(&sPadStackInfo, sPadStack, STACK_TOP(sPadStack), 0, 0x100, "padmgr");
func_80075020(&D_8010DF40, &sSerialEventQueue, &D_801001F8, Y_THREAD_ID_PAD, Y_PRIORITY_PAD, STACK_TOP(sPadStack));
}

void func_8007C5EC(void) {
func_80074C88(&D_8010DF40, &D_8010DEE0, 1);
}

void func_8007C61C(void) {
func_800744B0(&D_8010DF40);
}

void func_8007C640(OSMesgQueue* arg0) {
func_8007451C(&D_8010DF40, arg0);
}
7 changes: 5 additions & 2 deletions yamls/us/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
- [0x79D60, asm] # Probably has at least 2 file split
- [0x7CA70, asm]
- [0x7CC30, asm]
- [0x7D140, asm]
- [0x7D140, c, 7D140]
- [0x7D270, asm]
- [0x7D9A0, c, eepmgr]
- [0x7E1E0, asm]
Expand Down Expand Up @@ -349,7 +349,8 @@
- [0xB3600, rodata]
- [0xB3640, rodata, 7CA70]
- [0xB3690, rodata, 7CC30]
- [0xB36A0, rodata, 7D140]
- [0xB36A0, .rodata, 7D140]
- [0xB36B0, rodata, 7D270]
- [0xB36E0, .rodata, eepmgr]
- [0xB39F0, .rodata, dmamgr]
- [0xB3AA0, rodata, 7EC30]
Expand Down Expand Up @@ -382,6 +383,8 @@
- {type: bss, vram: 0x800B4CB0, name: 800B4CB0}
- {type: .bss, vram: 0x80108630, name: fault}
- {type: bss, vram: 0x801090D0, name: 801090D0}
- {type: .bss, vram: 0x8010DAA0, name: 7D140}
- {type: bss, vram: 0x8010DEE0, name: 8010DEE0}
- {type: .bss, vram: 0x8010E840, name: dmamgr}
- {type: .bss, vram: 0x8010ED90, name: 7EFD0}

Expand Down

0 comments on commit 0d88020

Please sign in to comment.