almost all of dolphin matched (#2036)

* TRK full match

* remove trk asm

* ar done

* cleanup some dolphin headers

* more dolphin cleanup

* cleanup / GD fully matched

* almost all of GX fully matched

* GX / Mtx full matched

* most of OS done

* pad done

* most of VI

* remove asm

* forgot couple vec funcs

* couple JUtility matches
This commit is contained in:
TakaRikka
2024-01-20 02:22:19 +02:00
committed by GitHub
parent f97fc769df
commit 981cfe7283
461 changed files with 11570 additions and 22631 deletions
@@ -1,5 +1,16 @@
#ifndef METROTRK_PORTABLE_MAIN_TRK_H
#define METROTRK_PORTABLE_MAIN_TRK_H
#include "trk.h"
#ifdef __cplusplus
extern "C" {
#endif
DSError TRK_main(void);
#ifdef __cplusplus
}
#endif
#endif /* METROTRK_PORTABLE_MAIN_TRK_H */
@@ -1,35 +1,15 @@
#ifndef METROTRK_PORTABLE_MSGBUF_H
#define METROTRK_PORTABLE_MSGBUF_H
#include "dolphin/types.h"
#include "trk.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int MessageBufferID;
#define TRKMSGBUF_SIZE (0x800 + 0x80)
typedef struct TRKBuffer {
/* 0x00 */ u32 _00;
/* 0x04 */ BOOL isInUse;
/* 0x08 */ u32 length;
/* 0x0C */ u32 position;
/* 0x10 */ u8 data[TRKMSGBUF_SIZE];
} TRKBuffer;
/* typedef struct TRKBuffer {
u32 _00;
u32 _04;
s32 _08;
u32 _0C;
u32 _10;
u8 m_buffer[0x87C];
} TRKBuffer; */
s32 TRKSetBufferPosition(TRKBuffer*, u32);
DSError TRKSetBufferPosition(TRKBuffer* msg, u32 pos);
void* TRKGetBuffer(int);
void TRKResetBuffer(TRKBuffer* msg, BOOL keepData);
#ifdef __cplusplus
}
@@ -0,0 +1,26 @@
#ifndef OS_DOLPHIN_DDH_STUBS_H
#define OS_DOLPHIN_DDH_STUBS_H
#include "dolphin/os.h"
#include "amcstubs/AmcExi2Stubs.h"
#ifdef __cplusplus
extern "C" {
#endif
int ddh_cc_initialize(void* inputPendingPtrRef, AmcEXICallback monitorCallback);
int ddh_cc_shutdown();
int ddh_cc_open();
int ddh_cc_close();
int ddh_cc_read(u8* data, int size);
int ddh_cc_write(const u8* bytes, int length);
int ddh_cc_pre_continue();
int ddh_cc_post_stop();
int ddh_cc_peek();
int ddh_cc_initinterrupts();
#ifdef __cplusplus
}
#endif
#endif /* OS_DOLPHIN_DDH_STUBS_H */
@@ -0,0 +1,26 @@
#ifndef OS_DOLPHIN_GDEV_STUBS_H
#define OS_DOLPHIN_GDEV_STUBS_H
#include "dolphin/os.h"
#include "amcstubs/AmcExi2Stubs.h"
#ifdef __cplusplus
extern "C" {
#endif
int gdev_cc_initialize(void* inputPendingPtrRef, AmcEXICallback monitorCallback);
int gdev_cc_shutdown();
int gdev_cc_open();
int gdev_cc_close();
int gdev_cc_read(u8* data, int size);
int gdev_cc_write(const u8* bytes, int length);
int gdev_cc_pre_continue();
int gdev_cc_post_stop();
int gdev_cc_peek();
int gdev_cc_initinterrupts();
#ifdef __cplusplus
}
#endif
#endif /* OS_DOLPHIN_GDEV_STUBS_H */
@@ -1,6 +1,24 @@
#ifndef OS_DOLPHIN_UDP_STUBS_H
#define OS_DOLPHIN_UDP_STUBS_H
#include "dolphin/types.h"
#include "dolphin/os.h"
#ifdef __cplusplus
extern "C" {
#endif
int udp_cc_initialize(void* flagOut, __OSInterruptHandler handler);
int udp_cc_shutdown(void);
int udp_cc_open(void);
int udp_cc_close(void);
int udp_cc_read(u8* dest, int size);
int udp_cc_write(const u8* src, int size);
int udp_cc_peek(void);
int udp_cc_pre_continue(void);
int udp_cc_post_stop(void);
#ifdef __cplusplus
}
#endif
#endif /* OS_DOLPHIN_UDP_STUBS_H */
@@ -1,17 +1,21 @@
#ifndef OS_DOLPHIN_DOLPHIN_TRK_GLUE_H
#define OS_DOLPHIN_DOLPHIN_TRK_GLUE_H
#include "dolphin/os/OS.h"
#include "dolphin/os.h"
#include "trk.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*DBCommFunc)();
typedef int (*DBCommInitFunc)(void*, OSInterruptHandler);
typedef int (*DBCommInitFunc)(void*, __OSInterruptHandler);
typedef int (*DBCommReadFunc)(u8*, int);
typedef int (*DBCommWriteFunc)(const u8*, int);
typedef struct DBCommTable {
DBCommInitFunc initialize_func;
DBCommFunc initinterrupts_func;
DBCommFunc init_interrupts_func;
DBCommFunc shutdown_func;
DBCommFunc peek_func;
DBCommReadFunc read_func;
@@ -24,6 +28,13 @@ typedef struct DBCommTable {
void UnreserveEXI2Port();
void ReserveEXI2Port();
s32 TRKWriteUARTN(const void*, u32);
UARTError TRKWriteUARTN(const void*, u32);
void TRKLoadContext(OSContext* ctx, u32 r4);
int InitMetroTRKCommTable(int hwId);
#ifdef __cplusplus
}
#endif
#endif /* OS_DOLPHIN_DOLPHIN_TRK_GLUE_H */
@@ -9,7 +9,7 @@ extern "C" {
#endif
void TRKSwapAndGo();
void TRKTargetSetStopped(s32);
void TRKTargetSetStopped(unsigned int);
DSError TRKTargetInterrupt(TRKEvent*);
DSError TRKTargetSupportRequest();
void TRKDestructEvent(TRKEvent*);
@@ -124,16 +124,16 @@ typedef ProcessorState_PPC_6xx_7xx ProcessorState_PPC;
extern ProcessorState_PPC gTRKCPUState;
typedef struct TRKState {
/* 0x00 */ u32 GPR[32];
/* 0x80 */ u32 LR;
/* 0x84 */ u32 CTR;
/* 0x88 */ u32 XER;
/* 0x8C */ u32 MSR;
/* 0x90 */ u32 DAR;
/* 0x94 */ u32 DSISR;
/* 0x98 */ u32 stopped;
/* 0x9C */ u32 inputActivated;
/* 0xA0 */ void* inputPendingPtr;
u32 gpr[32]; // _00
u32 lr; // _80
u32 ctr; // _84
u32 xer; // _88
u32 msr; // _8C
u32 dar; // _90
u32 dsisr; // _94
BOOL isStopped; // _98
BOOL inputActivated; // _9C
void* inputPendingPtr; // _A0
} TRKState;
extern TRKState gTRKState;