j2d / map_path work, d_drawlist / d_attention cleanup (#208)

* work on fop actor / actor mng, daalink, d_a_obj_item

* d_a_title mostly decompiled

* daalink / d_event / JMessage / dmsg_out_font work

* msg_scrn_base / msg_scrn_boss

* some work on mDo machine, d_menu_save, d_tresure, and various

* remove asm

* progress

* finish d_menu_save / d_pane_class_alpha / d_pane_class / rename some data

* rename more data

* remove asm / progress

* match all of d_pane_class

* fixes / some dKankyo doc

* bunch of j2d work. d_drawlist / d_attention cleanup

* progress / asm

* cleanup wip

* decompile JStage

* setup some more JStudio structs

* set up d_demo classes

* some d_demo work

* cleanup dolphin os stuff

* some initial dEvent documentation

* some At collision documentation

* match JUTConsole::doDraw

* dbgs work / split up some of d_a_alink into .inc files

* d_a_alink_spinner work
This commit is contained in:
TakaRikka
2022-08-30 15:22:17 -06:00
committed by GitHub
parent bc30d007e1
commit f8979749e3
613 changed files with 30182 additions and 40087 deletions
+98 -844
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -4,9 +4,9 @@
#include "dolphin/types.h"
extern "C" {
void GXBeginDisplayList(void* pDL, u32 capacity);
void GXBeginDisplayList(void* list, u32 capacity);
void GXEndDisplayList(void);
void GXCallDisplayList(const void* pDL, u32 size);
void GXCallDisplayList(void* list, u32 nbytes);
};
#endif /* GXDISPLAYLIST_H */
File diff suppressed because it is too large Load Diff
+89
View File
@@ -0,0 +1,89 @@
#ifndef GXSTRUCT_H
#define GXSTRUCT_H
#include "dolphin/types.h"
#include "global.h"
typedef struct _GXColor {
/* 0x0 */ u8 r;
/* 0x1 */ u8 g;
/* 0x2 */ u8 b;
/* 0x3 */ u8 a;
} GXColor;
typedef struct _GXColorS10 {
/* 0x0 */ s16 r;
/* 0x2 */ s16 g;
/* 0x4 */ s16 b;
/* 0x6 */ s16 a;
} GXColorS10;
typedef struct _GXRenderModeObj {
/* 0x00 */ s32 vi_tv_mode;
/* 0x04 */ u16 fb_width;
/* 0x06 */ u16 efb_height;
/* 0x08 */ u16 xfb_height;
/* 0x0A */ u16 vi_x_origin;
/* 0x0C */ u16 vi_y_origin;
/* 0x0E */ u16 vi_width;
/* 0x10 */ u16 vi_height;
/* 0x14 */ s32 xfb_mode;
/* 0x18 */ u8 field_rendering;
/* 0x19 */ u8 antialiasing;
/* 0x1A */ u8 sample_pattern[12][2];
/* 0x32 */ u8 vfilter[7];
} GXRenderModeObj;
STATIC_ASSERT(sizeof(_GXRenderModeObj) == 60);
typedef struct _GXTexObj {
/* 0x00 */ u32 texture_filter;
/* 0x04 */ u32 texture_lod;
/* 0x08 */ u32 texture_size;
/* 0x0C */ u32 texture_address;
/* 0x10 */ u32 user_data;
/* 0x14 */ u32 texture_format;
/* 0x18 */ u32 tlut_name;
/* 0x1C */ u16 texture_time_count;
/* 0x1E */ u8 texture_tile_type;
/* 0x1F */ u8 texture_flags;
} GXTexObj;
typedef struct _GXTlutObj {
/* 0x0 */ u32 format;
/* 0x4 */ u32 address;
/* 0x8 */ u32 numEntries;
} GXTlutObj;
typedef struct _GXLightObj {
/* 0x0 */ u32 data[16];
} GXLightObj;
typedef struct _GXFogAdjTable {
/* 0x0 */ u16 r[10];
} GXFogAdjTable;
typedef struct _GXFifoObj {
/* 0x00 */ void* base;
/* 0x04 */ u32 end;
/* 0x08 */ u32 size;
/* 0x0C */ u32 high_wtrmark;
/* 0x10 */ u32 low_wtrmark;
/* 0x14 */ void* read_ptr;
/* 0x18 */ void* write_ptr;
/* 0x1C */ void* rw_dst;
/* 0x20 */ u8 fifo_wrap;
/* 0x21 */ u8 cpu_fifo_ready;
/* 0x22 */ u8 gp_fifo_ready;
/* 0x23 */ u8 field_0x23[93];
} GXFifoObj; // Size: 0x80
typedef struct _GXTexRegion {
/* 0x00 */ u8 dummy[0x10];
} GXTexRegion; // Size: 0x10
typedef struct _GXTlutRegion {
/* 0x00 */ u8 dummy[0x10];
} GXTlutRegion; // Size: 0x10
#endif /* GXSTRUCT_H */
+57 -216
View File
@@ -1,236 +1,81 @@
// at some point: we should split this up into various OS/... headers. but not
// yet, since barely any files include this atm.
#ifndef OS_H_
#define OS_H_
#include "Runtime.PPCEABI.H/__va_arg.h"
#include "dolphin/types.h"
#include "Runtime.PPCEABI.H/__va_arg.h"
#include "dolphin/os/OSAlarm.h"
#include "dolphin/os/OSAlloc.h"
#include "dolphin/os/OSArena.h"
#include "dolphin/os/OSAudioSystem.h"
#include "dolphin/os/OSCache.h"
#include "dolphin/os/OSContext.h"
#include "dolphin/os/OSError.h"
#include "dolphin/os/OSExec.h"
#include "dolphin/os/OSFont.h"
#include "dolphin/os/OSInterrupt.h"
#include "dolphin/os/OSLink.h"
#include "dolphin/os/OSMemory.h"
#include "dolphin/os/OSMessage.h"
#include "dolphin/os/OSMutex.h"
#include "dolphin/os/OSReboot.h"
#include "dolphin/os/OSReset.h"
#include "dolphin/os/OSResetSW.h"
#include "dolphin/os/OSRtc.h"
#include "dolphin/os/OSSync.h"
#include "dolphin/os/OSThread.h"
#include "dolphin/os/OSTime.h"
#ifdef __cplusplus
extern "C" {
#endif
#define OS_BUS_CLOCK (*(u32*)0x800000F8)
#define OS_CORE_CLOCK (*(u32*)0x800000FC)
#define OS_TIMER_CLOCK (OS_BUS_CLOCK / 4)
/* TODO: more structs, and get rid of the ones that are faked! */
#define OS_MESSAGE_NON_BLOCKING 0
#define OS_MESSAGE_BLOCKING 1
struct OSThread;
struct OSMutex {
u8 unk[24];
};
struct OSMutexLink {
struct OSMutex* prev;
struct OSMutex* next;
};
struct OSMutexQueue {
struct OSMutex* prev;
struct OSMutex* next;
};
struct OSContext {
u32 gpr[32];
u32 cr;
u32 lr;
u32 ctr;
u32 xer;
double fpr[32];
u32 padding_1;
u32 fpscr;
u32 srr0;
u32 srr1;
u16 mode;
u16 state;
u32 gqr[8];
u32 padding_2;
double ps[32];
};
typedef void (*OSSwitchThreadCallback)(OSThread* from, OSThread* to);
struct OSThreadLink {
struct OSThread* prev;
struct OSThread* next;
};
struct OSThreadQueue {
struct OSThread* head;
struct OSThread* tail;
};
struct OSCond {
struct OSThreadQueue queue;
};
typedef void* OSMessage;
struct OSMessageQueue {
struct OSThreadQueue sending_queue;
struct OSThreadQueue receiving_queue;
void** message_array;
s32 num_messages;
s32 first_index;
s32 num_used;
};
typedef u32 OSTick;
typedef s64 OSTime;
struct OSCalendarTime {
s32 seconds;
s32 minutes;
s32 hours;
s32 day_of_month;
s32 month;
s32 year;
s32 week_day;
s32 year_day;
s32 milliseconds;
s32 microseconds;
};
typedef s32 OSHeapHandle;
typedef enum OSSoundMode {
SOUND_MODE_MONO = 0,
SOUND_MODE_STEREO = 1,
} OSSoundMode;
typedef u16 OSThreadState;
#define OS_THREAD_STATE_UNINITIALIZED 0
#define OS_THREAD_STATE_READY 1
#define OS_THREAD_STATE_RUNNING 2
#define OS_THREAD_STATE_WAITING 4
#define OS_THREAD_STATE_DEAD 8
struct OSThread {
OSContext context;
OSThreadState state;
u16 attributes;
s32 suspend_count;
u32 effective_priority;
u32 base_priority;
void* exit_value;
OSThreadQueue* queue;
OSThreadLink link;
OSThreadQueue join_queue;
OSMutex* mutex;
OSMutexQueue owned_mutexes;
OSThreadLink active_threads_link;
u8* stack_base;
u8* stack_end;
u8* error_code;
void* data[2];
};
struct OSAlarm;
struct OSAlarmLink {
/* 0x0 */ OSAlarm* prev;
/* 0x4 */ OSAlarm* next;
};
typedef void (*OSAlarmHandler)(OSAlarm* alarm, OSContext* context);
struct OSAlarm {
/* 0x00 */ OSAlarmHandler handler;
/* 0x04 */ u32 tag;
/* 0x08 */ OSTime fire_time;
/* 0x10 */ OSAlarmLink link;
/* 0x18 */ OSTime period_time;
/* 0x20 */ OSTime start_time;
}; // Size: 0x28
extern "C" {
s32 OSEnableScheduler(void);
s32 OSDisableScheduler(void);
s32 OSCheckActiveThreads(void);
OSThread* OSGetCurrentThread(void);
s32 OSSuspendThread(OSThread* thread);
s32 OSSetThreadPriority(OSThread* thread, u32 pri);
s32 OSGetThreadPriority(OSThread* thread);
BOOL OSCreateThread(OSThread* thread, void* func, void* param, void* stack, u32 stackSize,
int priority, int attr);
void OSCancelThread(OSThread* thread);
void OSDetachThread(OSThread* thread);
s32 OSResumeThread(OSThread* thread);
void OSExitThread(void* exit_val);
BOOL OSIsThreadSuspended(OSThread* thread);
BOOL OSIsThreadTerminated(OSThread* thread);
OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback callback);
void OSInitMessageQueue(OSMessageQueue* queue, OSMessage* messages, int message_count);
BOOL OSReceiveMessage(OSMessageQueue* queue, OSMessage* message, int flags);
BOOL OSSendMessage(OSMessageQueue* queue, OSMessage message, int flags);
BOOL OSJamMessage(OSMessageQueue* queue, OSMessage message, int flags);
u32 OSGetConsoleType(void);
s32 OSGetConsoleType(void);
u32 OSGetResetCode(void);
u32 OSGetSoundMode(void);
void OSSetSoundMode(OSSoundMode mode);
void OSAttention(const char* msg, ...);
void OSPanic(const char* file, s32 line, const char* fmt, ...);
void OSReport(const char* fmt, ...);
void OSReport_Error(const char* fmt, ...);
void OSReport_FatalError(const char* fmt, ...);
void OSReport_System(const char* fmt, ...);
void OSReport_Warning(const char* fmt, ...);
void OSAttention(char* msg, ...);
void OSPanic(char* file, s32 line, char* fmt, ...);
void OSReport(char* fmt, ...);
void OSReport_Error(char* fmt, ...);
void OSReport_FatalError(char* fmt, ...);
void OSReport_System(char* fmt, ...);
void OSReport_Warning(char* fmt, ...);
void OSReportDisable(void);
void OSReportEnable(void);
void OSReportForceEnableOff(void);
void OSReportForceEnableOn(void);
void OSVReport(const char* format, va_list list);
void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* out_time);
OSTime OSGetTime(void);
OSTick OSGetTick(void);
u32 OSGetArenaLo();
u32 OSGetArenaHi();
u32 OSInitAlloc(u32 low, u32 high, int maxHeaps);
void OSSetArenaLo(u32 newLo);
void OSSetArenaHi(u32 newHi);
void* OSAllocFromArenaLo(u32 size, int alignment);
void OSInitMutex(OSMutex* mutex);
void OSLockMutex(OSMutex* mutex);
BOOL OSTryLockMutex(OSMutex* mutex);
void OSUnlockMutex(OSMutex* mutex);
BOOL OSDisableInterrupts();
BOOL OSEnableInterrupts();
BOOL OSRestoreInterrupts(s32 level);
void OSResetSystem(s32 param_1, u32 param_2, s32 param_3);
void OSSetSaveRegion(void* start, void* end);
void LCDisable(void);
void OSVReport(char* format, va_list list);
void OSVAttention(char* fmt, va_list args);
void OSReportInit(void);
void OSReportInit__Fv(void); // needed for inline asm
u8* OSGetStackPointer(void);
void __OSFPRInit(void);
static void InquiryCallback(u32 param_0, void* param_1);
void OSInit(void);
static void OSExceptionInit(void);
void __OSDBIntegrator(void);
void __OSDBJump(void);
void OSCreateAlarm(OSAlarm* alarm);
void OSCancelAlarm(OSAlarm* alarm);
void OSSetAlarm(OSAlarm* alarm, OSTime time, OSAlarmHandler handler);
void OSSetPeriodicAlarm(OSAlarm*, OSTime, OSTime, OSAlarmHandler);
void OSInitCond(OSCond* cond);
void OSWaitCond(OSCond* cond, OSMutex* mutex);
void OSSignalCond(OSCond* cond);
void DCStoreRangeNoSync(void*, u32);
typedef void (*OSExceptionHandler)(OSException, OSContext*);
OSExceptionHandler __OSSetExceptionHandler(OSException exception, OSExceptionHandler handler);
OSExceptionHandler __OSGetExceptionHandler(OSException exception);
static void OSExceptionVector(void);
void __DBVECTOR();
void __OSEVSetNumber();
void __OSEVEnd();
static void OSDefaultExceptionHandler(OSException exception, OSContext* context);
void __OSPSInit(void);
void __OSGetDIConfig(void);
void OSRegisterVersion(char* version);
void OSSwitchFiberEx(u32, u32, u32, u32, u32, u32);
inline s16 __OSf32tos16(register f32 inF) {
register s16 out;
@@ -268,7 +113,7 @@ inline void OSf32tou8(f32* f, u8* out) {
*out = __OSf32tou8(*f);
}
inline void OSInitFastCast(void) {
inline void i_OSInitFastCast(void) {
// clang-format off
asm {
li r3, 4
@@ -287,14 +132,6 @@ inline void OSInitFastCast(void) {
// clang-format on
}
}; // extern "C"
void OSSwitchFiberEx(u32, u32, u32, u32, u32, u32);
void OSVAttention(const char* fmt, va_list args);
void OSReportInit(void);
#include "dolphin/dvd/dvd.h"
struct GLOBAL_MEMORY {
@@ -386,4 +223,8 @@ inline void* OSPhysicalToCached(u32 offset) {
return (void*)(offset + 0x80000000);
}
#ifdef __cplusplus
};
#endif
#endif
+36
View File
@@ -2,5 +2,41 @@
#define OSALARM_H
#include "dolphin/types.h"
#include "dolphin/os/OSTime.h"
#include "dolphin/os/OSError.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OSAlarmLink {
/* 0x0 */ struct OSAlarm* prev;
/* 0x4 */ struct OSAlarm* next;
} OSAlarmLink;
typedef void (*OSAlarmHandler)(struct OSAlarm* alarm, struct OSContext* context);
typedef struct OSAlarm {
/* 0x00 */ OSAlarmHandler handler;
/* 0x04 */ u32 tag;
/* 0x08 */ OSTime fire_time;
/* 0x10 */ OSAlarmLink link;
/* 0x18 */ OSTime period_time;
/* 0x20 */ OSTime start_time;
} OSAlarm; // Size: 0x28
void OSInitAlarm(void);
void OSCreateAlarm(OSAlarm* alarm);
static void InsertAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler);
void OSSetAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler);
void OSSetPeriodicAlarm(OSAlarm* alarm, s64 start, s64 period, OSAlarmHandler* handler);
void OSCancelAlarm(OSAlarm* alarm);
static void DecrementerExceptionCallback(OSException* exception, struct OSContext* context);
static void DecrementerExceptionHandler(OSException* exception, struct OSContext* context);
static s32 OnReset(s32 param_0);
#ifdef __cplusplus
};
#endif
#endif /* OSALARM_H */
+16
View File
@@ -3,4 +3,20 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef u32 OSHeapHandle;
static void* DLInsert(void* param_0, void* param_1);
void OSFreeToHeap(OSHeapHandle heap, void* ptr);
void OSSetCurrentHeap(OSHeapHandle heap);
void* OSInitAlloc(void* lo, void* hi, s32 maxHeaps);
OSHeapHandle OSCreateHeap(void* start, void* end);
#ifdef __cplusplus
};
#endif
#endif /* OSALLOC_H */
+14
View File
@@ -3,4 +3,18 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void* OSGetArenaHi(void);
void* OSGetArenaLo(void);
void OSSetArenaHi(void* hi);
void OSSetArenaLo(void* lo);
void* OSAllocFromArenaLo(u32 size, s32 alignment);
#ifdef __cplusplus
};
#endif
#endif /* OSARENA_H */
+11
View File
@@ -3,4 +3,15 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void __OSInitAudioSystem(void);
void __OSStopAudioSystem(void);
#ifdef __cplusplus
};
#endif
#endif /* OSAUDIOSYSTEM_H */
+26 -4
View File
@@ -3,10 +3,32 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
void DCInvalidateRange(void*, u32);
void DCStoreRange(void*, u32);
void DCStoreRangeNoSync(void*, u32);
}
#endif
static void DCEnable(void);
void DCInvalidateRange(void* start, u32 nBytes);
void DCFlushRange(void* start, u32 nBytes);
void DCStoreRange(void* start, u32 nBytes);
void DCFlushRangeNoSync(void* start, u32 nBytes);
void DCStoreRangeNoSync(void* start, u32 nBytes);
void DCZeroRange(void* start, u32 nBytes);
void ICInvalidateRange(void* start, u32 nBytes);
void ICFlashInvalidate(void);
static void ICEnable(void);
void __LCEnable(void);
void LCEnable(void);
void LCDisable(void);
static void LCStoreBlocks(void* destAddr, void* srcAddr, u32 blockNum);
u32 LCStoreData(void* destAddr, void* srcAddr, u32 nBytes);
void LCQueueWait(u32 len);
static void L2GlobalInvalidate(void);
static void DMAErrorHandler(s32 error, struct OSContext* context);
void __OSCacheInit(void);
#ifdef __cplusplus
};
#endif
#endif /* OSCACHE_H */
+41
View File
@@ -3,4 +3,45 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*OSSwitchThreadCallback)(struct OSThread* from, struct OSThread* to);
typedef struct OSContext {
/* 0x000 */ u32 gpr[32];
/* 0x080 */ u32 cr;
/* 0x084 */ u32 lr;
/* 0x088 */ u32 ctr;
/* 0x08C */ u32 xer;
/* 0x090 */ f64 fpr[32];
/* 0x190 */ u32 padding_1;
/* 0x194 */ u32 fpscr;
/* 0x198 */ u32 srr0;
/* 0x19C */ u32 srr1;
/* 0x1A0 */ u16 mode;
/* 0x1A2 */ u16 state;
/* 0x1A4 */ u32 gqr[8];
/* 0x1C4 */ f64 ps[32];
} OSContext;
void __OSLoadFPUContext(void);
void __OSSaveFPUContext(OSContext* context);
void OSSaveFPUContext(OSContext* context);
void OSSetCurrentContext(OSContext* context);
OSContext* OSGetCurrentContext(void);
void OSSaveContext(OSContext* context);
void OSLoadContext(OSContext* context);
void OSClearContext(OSContext* context);
void OSInitContext(OSContext* context, u32 pc, u32 lr);
void OSDumpContext(OSContext* context);
static void OSSwitchFPUContext(OSContext* context);
void __OSContextInit(void);
void OSFillFPUContext(OSContext* context);
#ifdef __cplusplus
};
#endif
#endif /* OSCONTEXT_H */
+48 -19
View File
@@ -3,31 +3,60 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
struct OSContext;
extern u32 __OSFpscrEnableBits;
typedef u16 OSError;
typedef void (*OSErrorHandler)(OSError, OSContext*, u32, u32);
typedef void (*OSErrorHandler)(OSError error, OSContext* context, u32, u32);
#define OS_ERROR_SYSTEM_RESET 0x0
#define OS_ERROR_MACHINE_CHECK 0x1
#define OS_ERROR_DSI 0x2
#define OS_ERROR_ISI 0x3
#define OS_ERROR_INTERRUPT 0x4
#define OS_ERROR_ALIGNMENT 0x5
#define OS_ERROR_PROGRAM 0x6
#define OS_ERROR_FLOATING_POINT 0x7
#define OS_ERROR_DECREMENTER 0x8
#define OS_ERROR_SYSTEM_CALL 0x9
#define OS_ERROR_TRACE 0xa
#define OS_ERROR_PERFORMANCE_MONITOR 0xb
#define OS_ERROR_BREAKPOINT 0xc
#define OS_ERROR_RESERVED 0xd
#define OS_ERROR_THERMAL_INTERRUPT 0xe
#define OS_ERROR_MEMORY_PROTECTION 0xf
#define OS_ERROR_FLOATING_POINT_EXCEPTION 0x10
#define OS_ERROR_SYSTEM_RESET 0
#define OS_ERROR_MACHINE_CHECK 1
#define OS_ERROR_DSI 2
#define OS_ERROR_ISI 3
#define OS_ERROR_INTERRUPT 4
#define OS_ERROR_ALIGNMENT 5
#define OS_ERROR_PROGRAM 6
#define OS_ERROR_FLOATING_POINT 7
#define OS_ERROR_DECREMENTER 8
#define OS_ERROR_SYSTEM_CALL 9
#define OS_ERROR_TRACE 10
#define OS_ERROR_PERFORMANCE_MONITOR 11
#define OS_ERROR_BREAKPOINT 12
#define OS_ERROR_RESERVED 13
#define OS_ERROR_THERMAL_INTERRUPT 14
#define OS_ERROR_MEMORY_PROTECTION 15
#define OS_ERROR_FLOATING_POINT_EXCEPTION 16
extern "C" void OSSetErrorHandler(OSError, OSErrorHandler);
typedef enum OSException {
EXCEPTION_SYSTEM_RESET,
EXCEPTION_MACHINE_CHECK,
EXCEPTION_DSI,
EXCEPTION_ISI,
EXCEPTION_EXTERNAL_INTERRUPT,
EXCEPTION_ALIGNMENT,
EXCEPTION_PROGRAM,
EXCEPTION_FLOATING_POINT,
EXCEPTION_DECREMENTER,
EXCEPTION_SYSTEM_CALL,
EXCEPTION_TRACE ,
EXCEPTION_PERFORMANCE_MONITOR,
EXCEPTION_BREAKPOINT,
EXCEPTION_RESERVED,
EXCEPTION_THERMAL_INTERRUPT,
EXCEPTION_MEMORY_PROTECTION,
EXCEPTION_FLOATING_POINT_EXCEPTION,
} OSException;
OSErrorHandler OSSetErrorHandler(OSError error, OSErrorHandler handler);
void __OSUnhandledException(OSException exception, OSContext* context, u32 dsisr, u32 dar);
#ifdef __cplusplus
};
#endif
#endif /* OSERROR_H */
+17
View File
@@ -3,4 +3,21 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
static s32 PackArgs(void* param_0, u32 param_1, void* param_2);
static void Run(void);
static void ReadDisc(void* param_0, s32 param_1, s32 param_2);
static void Callback(void);
void __OSGetExecParams(void* param_0);
static void GetApploaderPosition(void);
void __OSBootDolSimple(u32 param_0, u32 param_1, void* param_2, void* param_3, s32 param_4, u32 param_5, void* param_6);
void __OSBootDol(s32 param_0, u32 param_1, s32 param_2);
#ifdef __cplusplus
};
#endif
#endif /* OSEXEC_H */
+12
View File
@@ -3,4 +3,16 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
static u32 GetFontCode(s16 param_0, u32 param_1);
u16 OSGetFontEncode(void);
static char* ParseStringS(s16 param_0, char* param_1, void* param_2, u32* param_3, u32 param_4, void* param_5);
#ifdef __cplusplus
};
#endif
#endif /* OSFONT_H */
+25
View File
@@ -3,4 +3,29 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef s16 OSInterrupt;
typedef u32 OSInterruptMask;
typedef void (*OSInterruptHandler)(OSInterrupt interrupt, struct OSContext* context);
BOOL OSDisableInterrupts(void);
void __RAS_OSDisableInterrupts_end(void);
BOOL OSEnableInterrupts(void);
BOOL OSRestoreInterrupts(BOOL enable);
OSInterruptHandler __OSSetInterruptHandler(OSInterrupt interrupt, OSInterruptHandler handler);
OSInterruptHandler __OSGetInterruptHandler(s16 index);
void __OSInterruptInit(void);
static OSInterruptMask SetInterruptMask(OSInterruptMask param_0, OSInterruptMask param_1);
OSInterruptMask __OSMaskInterrupts(OSInterruptMask mask);
OSInterruptMask __OSUnmaskInterrupts(OSInterruptMask mask);
void __OSDispatchInterrupt(OSInterrupt interrupt, struct OSContext* context);
static void ExternalInterruptHandler(OSInterrupt interrupt, struct OSContext* context);
#ifdef __cplusplus
};
#endif
#endif /* OSINTERRUPT_H */
+22 -7
View File
@@ -3,12 +3,16 @@
#include "dolphin/types.h"
struct OSSectionInfo {
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OSSectionInfo {
u32 mOffset;
u32 mSize;
};
} OSSectionInfo;
struct OSModuleInfo {
typedef struct OSModuleInfo {
u32 mId;
u32 mNext;
u32 mPrev;
@@ -33,10 +37,21 @@ struct OSModuleInfo {
u32 mModuleAlignment;
u32 mBssAlignment;
u32 fixSize;
};
} OSModuleInfo;
extern "C" BOOL OSLink(OSModuleInfo*);
extern "C" BOOL OSLinkFixed(OSModuleInfo*, u32);
extern "C" BOOL OSUnlink(OSModuleInfo*);
BOOL OSLink(OSModuleInfo* module);
BOOL OSLinkFixed(OSModuleInfo* module, u32 param_1);
BOOL OSUnlink(OSModuleInfo* module);
static void OSNotifyLink(void);
static void OSNotifyUnlink(void);
void OSSetStringTable(void* string_table);
static BOOL Relocate(OSModuleInfo* param_0, OSModuleInfo* param_1);
static BOOL Link(OSModuleInfo* module, u32 param_1);
static BOOL Undo(OSModuleInfo* param_0, OSModuleInfo* param_1);
void __OSModuleInit(void);
#ifdef __cplusplus
};
#endif
#endif /* OSLINK_H */
+17
View File
@@ -2,5 +2,22 @@
#define OSMEMORY_H
#include "dolphin/types.h"
#include "dolphin/os/OSInterrupt.h"
#ifdef __cplusplus
extern "C" {
#endif
static s32 OnReset(s32 param_0);
static void MEMIntrruptHandler(OSInterrupt interrupt, struct OSContext* context);
void OSProtectRange(u32 channel, void* address, u32 nBytes, u32 control);
static void Config24MB(void);
static void Config48MB(void);
static void RealMode(void);
void __OSInitMemoryProtection(void);
#ifdef __cplusplus
};
#endif
#endif /* OSMEMORY_H */
+25
View File
@@ -2,5 +2,30 @@
#define OSMESSAGE_H
#include "dolphin/types.h"
#include "dolphin/os/OSThread.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void* OSMessage;
typedef struct OSMessageQueue {
/* 0x00 */ OSThreadQueue sending_queue;
/* 0x08 */ OSThreadQueue receiving_queue;
/* 0x10 */ OSMessage* message_array;
/* 0x14 */ s32 num_messages;
/* 0x18 */ s32 first_index;
/* 0x1C */ s32 num_used;
} OSMessageQueue;
void OSInitMessageQueue(OSMessageQueue* queue, OSMessage* msgArray, s32 msgCount);
BOOL OSSendMessage(OSMessageQueue* queue, OSMessage msg, s32 flags);
BOOL OSReceiveMessage(OSMessageQueue* queue, OSMessage* msg, s32 flags);
BOOL OSJamMessage(OSMessageQueue* queue, OSMessage msg, s32 flags);
#ifdef __cplusplus
};
#endif
#endif /* OSMESSAGE_H */
+21
View File
@@ -2,5 +2,26 @@
#define OSMUTEX_H
#include "dolphin/types.h"
#include "dolphin/os/OSThread.h"
#ifdef __cplusplus
extern "C" {
#endif
void OSInitMutex(struct OSMutex* mutex);
void OSLockMutex(struct OSMutex* mutex);
void OSUnlockMutex(struct OSMutex* mutex);
void __OSUnlockAllMutex(struct OSThread* thread);
s32 OSTryLockMutex(struct OSMutex* mutex);
void OSInitCond(struct OSCond* cond);
void OSWaitCond(struct OSCond* cond, struct OSMutex* mutex);
void OSSignalCond(struct OSCond* cond);
s32 __OSCheckMutex(struct OSThread* thread);
BOOL __OSCheckDeadLock(struct OSThread* thread);
BOOL __OSCheckMutexes(struct OSThread* thread);
#ifdef __cplusplus
};
#endif
#endif /* OSMUTEX_H */
+12
View File
@@ -3,4 +3,16 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void __OSReboot(u32 param_0, u32 param_1);
void OSSetSaveRegion(void* start, void* end);
void OSGetSaveRegion(void* start, void* end);
#ifdef __cplusplus
};
#endif
#endif /* OSREBOOT_H */

Some files were not shown because too many files have changed in this diff Show More