Formatting

This commit is contained in:
Maschell 2018-03-11 16:46:31 +01:00
parent 100029ffc7
commit fcb17e5826
29 changed files with 180 additions and 197 deletions

View File

@ -29,7 +29,7 @@ LIB := lib
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
CFLAGS = -g -O2 -Wall -D__wiiu__ $(MACHDEP) $(INCLUDE) CFLAGS = -g -Os -Wall -D__wiiu__ $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS)
ASFLAGS := -g ASFLAGS := -g

View File

@ -29,7 +29,9 @@ u32 acp_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, GetMetaXml, ACPMetaXml * _ACPMetaXml); EXPORT_DECL(void, GetMetaXml, ACPMetaXml * _ACPMetaXml);
void InitAcquireACP(void) { void InitAcquireACP(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nn_acp.rpl", &acp_handle); OSDynLoad_Acquire("nn_acp.rpl", &acp_handle);
} }

View File

@ -31,8 +31,7 @@ extern "C" {
#include "os_types.h" #include "os_types.h"
typedef struct ACPMetaXml_ typedef struct ACPMetaXml_ {
{
u8 data[0x3440]; u8 data[0x3440];
} ACPMetaXml; } ACPMetaXml;

View File

@ -36,7 +36,9 @@ EXPORT_DECL(s32, AOC_DeleteContent, u64 title_id, u16 contentIndexes[], u32 numb
EXPORT_DECL(s32, AOC_GetPurchaseInfo, u32 * bResult, u64 title_id, u16 contentIndexes[], u32 numberOfContent, void * buffer, u32 buffer_size); EXPORT_DECL(s32, AOC_GetPurchaseInfo, u32 * bResult, u64 title_id, u16 contentIndexes[], u32 numberOfContent, void * buffer, u32 buffer_size);
void InitAcquireAoc(void) { void InitAcquireAoc(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nn_aoc.rpl", &aoc_handle); OSDynLoad_Acquire("nn_aoc.rpl", &aoc_handle);
} }

View File

@ -50,20 +50,19 @@ EXPORT_DECL(void, AXSetVoiceEndOffset, void *v, u32 offset);
EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset); EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset);
void InitAcquireAX(void) { void InitAcquireAX(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
u32 *funcPointer = 0; u32 *funcPointer = 0;
if(OS_FIRMWARE >= 400) if(OS_FIRMWARE >= 400) {
{
AXInit = 0; AXInit = 0;
OSDynLoad_Acquire("snd_core.rpl", &sound_handle_old); OSDynLoad_Acquire("snd_core.rpl", &sound_handle_old);
OSDynLoad_Acquire("sndcore2.rpl", &sound_handle); OSDynLoad_Acquire("sndcore2.rpl", &sound_handle);
OS_FIND_EXPORT(sound_handle, AXInitWithParams); OS_FIND_EXPORT(sound_handle, AXInitWithParams);
OS_FIND_EXPORT(sound_handle, AXGetInputSamplesPerSec); OS_FIND_EXPORT(sound_handle, AXGetInputSamplesPerSec);
} } else {
else
{
AXInitWithParams = 0; AXInitWithParams = 0;
AXGetInputSamplesPerSec = 0; AXGetInputSamplesPerSec = 0;
@ -97,8 +96,7 @@ void InitAXFunctionPointers(void){
OS_FIND_EXPORT(sound_handle, AXSetVoiceLoopOffset); OS_FIND_EXPORT(sound_handle, AXSetVoiceLoopOffset);
} }
void ProperlyEndTransitionAudio(void) void ProperlyEndTransitionAudio(void) {
{
bool (* check_os_audio_transition_flag_old)(void); bool (* check_os_audio_transition_flag_old)(void);
void (* AXInit_old)(void); void (* AXInit_old)(void);
void (* AXQuit_old)(void); void (* AXQuit_old)(void);
@ -111,8 +109,7 @@ void ProperlyEndTransitionAudio(void)
OS_FIND_EXPORT_EX(sound_handle, AXInit, AXInit_old); OS_FIND_EXPORT_EX(sound_handle, AXInit, AXInit_old);
OS_FIND_EXPORT_EX(sound_handle, AXQuit, AXQuit_old); OS_FIND_EXPORT_EX(sound_handle, AXQuit, AXQuit_old);
if (check_os_audio_transition_flag_old()) if (check_os_audio_transition_flag_old()) {
{
AXInit_old(); AXInit_old();
AXQuit_old(); AXQuit_old();
} }

View File

@ -39,7 +39,9 @@ EXPORT_DECL(struct curl_slist *, n_curl_slist_append, struct curl_slist *list, c
EXPORT_DECL(void, n_curl_slist_free_all, struct curl_slist *list); EXPORT_DECL(void, n_curl_slist_free_all, struct curl_slist *list);
void InitAcquireCurl(void) { void InitAcquireCurl(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nlibcurl", &libcurl_handle); OSDynLoad_Acquire("nlibcurl", &libcurl_handle);
} }

View File

@ -42,8 +42,7 @@ typedef struct FSCmdBlock_ {
u8 buffer[FS_CMD_BLOCK_SIZE]; u8 buffer[FS_CMD_BLOCK_SIZE];
} FSCmdBlock; } FSCmdBlock;
typedef struct typedef struct {
{
u32 flag; u32 flag;
u32 permission; u32 permission;
u32 owner_id; u32 owner_id;
@ -57,15 +56,13 @@ typedef struct
u8 attributes[48]; u8 attributes[48];
} __attribute__((packed)) FSStat; } __attribute__((packed)) FSStat;
typedef struct typedef struct {
{
FSStat stat; FSStat stat;
char name[FS_MAX_ENTNAME_SIZE]; char name[FS_MAX_ENTNAME_SIZE];
} FSDirEntry; } FSDirEntry;
typedef void (*FSAsyncCallback)(FSClient * pClient, FSCmdBlock * pCmd, s32 result, void *context); typedef void (*FSAsyncCallback)(FSClient * pClient, FSCmdBlock * pCmd, s32 result, void *context);
typedef struct typedef struct {
{
FSAsyncCallback userCallback; FSAsyncCallback userCallback;
void *userContext; void *userContext;
OSMessageQueue *ioMsgQueue; OSMessageQueue *ioMsgQueue;

View File

@ -79,7 +79,9 @@ EXPORT_DECL(s32, FSMakeQuotaAsync ,void *pClient, void *pCmd, const char *path,u
EXPORT_DECL(s32, FSGetCwd,void * client,void * block,char * buffer,u32 bufferSize,u32 flags); EXPORT_DECL(s32, FSGetCwd,void * client,void * block,char * buffer,u32 bufferSize,u32 flags);
void InitFSFunctionPointers(void) { void InitFSFunctionPointers(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
u32 *funcPointer = 0; u32 *funcPointer = 0;
OS_FIND_EXPORT(coreinit_handle, FSInit); OS_FIND_EXPORT(coreinit_handle, FSInit);

View File

@ -103,7 +103,9 @@ EXPORT_DECL(void, GX2ResolveAAColorBuffer, const GX2ColorBuffer * srcBuffer, GX2
EXPORT_DECL(void, GX2ClearBuffersEx, GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,s32 clearFlags); EXPORT_DECL(void, GX2ClearBuffersEx, GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,s32 clearFlags);
void InitAcquireGX2(void) { void InitAcquireGX2(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("gx2.rpl", &gx2_handle); OSDynLoad_Acquire("gx2.rpl", &gx2_handle);
} }

View File

@ -110,8 +110,7 @@ extern void (*GX2CallDisplayList)(void * list, u32 size);
extern void (*GX2ExpandAAColorBuffer)(GX2ColorBuffer * buffer); extern void (*GX2ExpandAAColorBuffer)(GX2ColorBuffer * buffer);
extern void (*GX2ResolveAAColorBuffer)(const GX2ColorBuffer * srcBuffer, GX2Surface * dstSurface,u32 dstMip,u32 dstSlice); extern void (*GX2ResolveAAColorBuffer)(const GX2ColorBuffer * srcBuffer, GX2Surface * dstSurface,u32 dstMip,u32 dstSlice);
static inline void GX2InitDepthBuffer(GX2DepthBuffer *depthBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa) static inline void GX2InitDepthBuffer(GX2DepthBuffer *depthBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa) {
{
depthBuffer->surface.dimension = dimension; depthBuffer->surface.dimension = dimension;
depthBuffer->surface.width = width; depthBuffer->surface.width = width;
depthBuffer->surface.height = height; depthBuffer->surface.height = height;
@ -133,8 +132,7 @@ static inline void GX2InitDepthBuffer(GX2DepthBuffer *depthBuffer, s32 dimension
GX2InitDepthBufferRegs(depthBuffer); GX2InitDepthBufferRegs(depthBuffer);
} }
static inline void GX2InitColorBuffer(GX2ColorBuffer *colorBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa) static inline void GX2InitColorBuffer(GX2ColorBuffer *colorBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa) {
{
colorBuffer->surface.dimension = dimension; colorBuffer->surface.dimension = dimension;
colorBuffer->surface.width = width; colorBuffer->surface.width = width;
colorBuffer->surface.height = height; colorBuffer->surface.height = height;
@ -166,8 +164,7 @@ static inline void GX2InitColorBuffer(GX2ColorBuffer *colorBuffer, s32 dimension
GX2InitColorBufferRegs(colorBuffer); GX2InitColorBufferRegs(colorBuffer);
} }
static inline void GX2InitAttribStream(GX2AttribStream* attr, u32 location, u32 buffer, u32 offset, s32 format) static inline void GX2InitAttribStream(GX2AttribStream* attr, u32 location, u32 buffer, u32 offset, s32 format) {
{
attr->location = location; attr->location = location;
attr->buffer = buffer; attr->buffer = buffer;
attr->offset = offset; attr->offset = offset;
@ -178,8 +175,7 @@ static inline void GX2InitAttribStream(GX2AttribStream* attr, u32 location, u32
attr->endian_swap = GX2_ENDIANSWAP_DEFAULT; attr->endian_swap = GX2_ENDIANSWAP_DEFAULT;
} }
static inline void GX2InitTexture(GX2Texture *tex, u32 width, u32 height, u32 depth, u32 num_mips, s32 format, s32 dimension, s32 tile) static inline void GX2InitTexture(GX2Texture *tex, u32 width, u32 height, u32 depth, u32 num_mips, s32 format, s32 dimension, s32 tile) {
{
tex->surface.dimension = dimension; tex->surface.dimension = dimension;
tex->surface.width = width; tex->surface.width = width;
tex->surface.height = height; tex->surface.height = height;

View File

@ -590,8 +590,7 @@ typedef struct _GX2FetchShader {
u32 divisor[3]; u32 divisor[3];
} GX2FetchShader; } GX2FetchShader;
typedef struct _GX2AttribVar typedef struct _GX2AttribVar {
{
const char *name; const char *name;
s32 var_type; s32 var_type;
u32 array_count; u32 array_count;
@ -610,15 +609,13 @@ typedef struct _GX2UniformInitialValue {
u32 offset; u32 offset;
} GX2UniformInitialValue; } GX2UniformInitialValue;
typedef struct _GX2SamplerVar typedef struct _GX2SamplerVar {
{
const char *name; const char *name;
s32 sampler_type; s32 sampler_type;
u32 location; u32 location;
} GX2SamplerVar; } GX2SamplerVar;
typedef struct _GX2UniformVar typedef struct _GX2UniformVar {
{
const char *name; const char *name;
s32 var_type; s32 var_type;
u32 array_count; u32 array_count;

View File

@ -27,7 +27,9 @@
u32 nfp_handle __attribute__((section(".data"))) = 0; u32 nfp_handle __attribute__((section(".data"))) = 0;
void InitAcquireNFP(void) { void InitAcquireNFP(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nn_nfp.rpl", &nfp_handle); OSDynLoad_Acquire("nn_nfp.rpl", &nfp_handle);
} }

View File

@ -33,7 +33,9 @@ EXPORT_DECL(u8, nn_act_GetDefaultAccount, void);
EXPORT_DECL(u32, nn_act_GetPersistentIdEx, u8 slot); EXPORT_DECL(u32, nn_act_GetPersistentIdEx, u8 slot);
void InitAcquireACT(void) { void InitAcquireACT(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nn_act.rpl", &nn_act_handle); OSDynLoad_Acquire("nn_act.rpl", &nn_act_handle);
} }

View File

@ -27,7 +27,9 @@
u32 nn_nim_handle __attribute__((section(".data"))) = 0; u32 nn_nim_handle __attribute__((section(".data"))) = 0;
void InitAcquireNim(void) { void InitAcquireNim(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nn_nim.rpl", &nn_nim_handle); OSDynLoad_Acquire("nn_nim.rpl", &nn_nim_handle);
} }

View File

@ -31,7 +31,9 @@ EXPORT_DECL(void, SAVEInit, void);
EXPORT_DECL(int, SAVEOpenFile, void *pClient, void *pCmd, unsigned char user, const char *path, const char *mode, int *fd, int errHandling); EXPORT_DECL(int, SAVEOpenFile, void *pClient, void *pCmd, unsigned char user, const char *path, const char *mode, int *fd, int errHandling);
void InitAcquireSave(void) { void InitAcquireSave(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nn_save.rpl", &nn_save_handle); OSDynLoad_Acquire("nn_save.rpl", &nn_save_handle);
} }

View File

@ -27,7 +27,9 @@
u32 ntag_handle __attribute__((section(".data"))) = 0; u32 ntag_handle __attribute__((section(".data"))) = 0;
void InitAcquireNTAG(void) { void InitAcquireNTAG(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("ntag.rpl", &ntag_handle); OSDynLoad_Acquire("ntag.rpl", &ntag_handle);
} }

View File

@ -5,8 +5,7 @@
extern "C" { extern "C" {
#endif #endif
typedef struct _OsSpecifics typedef struct _OsSpecifics {
{
unsigned int addr_OSDynLoad_Acquire; unsigned int addr_OSDynLoad_Acquire;
unsigned int addr_OSDynLoad_FindExport; unsigned int addr_OSDynLoad_FindExport;
unsigned int addr_OSTitle_main_entry; unsigned int addr_OSTitle_main_entry;
@ -18,8 +17,7 @@ typedef struct _OsSpecifics
unsigned int addr_KernSyscallTbl5; unsigned int addr_KernSyscallTbl5;
} OsSpecifics; } OsSpecifics;
typedef struct _s_mem_area typedef struct _s_mem_area {
{
unsigned int address; unsigned int address;
unsigned int size; unsigned int size;
struct _s_mem_area* next; struct _s_mem_area* next;

View File

@ -204,8 +204,7 @@ EXPORT_DECL(s32, IOS_IoctlAsync,s32 fd, u32 request, void *input_buffer,u32 inpu
EXPORT_DECL(s32, IOS_Open,char *path, u32 mode); EXPORT_DECL(s32, IOS_Open,char *path, u32 mode);
EXPORT_DECL(s32, IOS_Close,s32 fd); EXPORT_DECL(s32, IOS_Close,s32 fd);
void _os_find_export(u32 handle, const char *funcName, void *funcPointer) void _os_find_export(u32 handle, const char *funcName, void *funcPointer) {
{
OSDynLoad_FindExport(handle, 0, funcName, funcPointer); OSDynLoad_FindExport(handle, 0, funcName, funcPointer);
if(!*(u32 *)funcPointer) { if(!*(u32 *)funcPointer) {
@ -406,8 +405,7 @@ void InitOSFunctionPointers(void){
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Special non library functions //! Special non library functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(OS_FIRMWARE == 550) if(OS_FIRMWARE == 550) {
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x01010180); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x01010180);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0101006C); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0101006C);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x0100080C); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x0100080C);
@ -415,9 +413,7 @@ void InitOSFunctionPointers(void){
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19E80); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19E80);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13DBC); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13DBC);
} } else if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540) {
else if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FFA4); // loader.elf EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FFA4); // loader.elf
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FE90); // loader.elf EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FE90); // loader.elf
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC); // loader.elf EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC); // loader.elf
@ -425,9 +421,7 @@ void InitOSFunctionPointers(void){
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00); // loader.elf EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00); // loader.elf
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13C3C); // loader.elf EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13C3C); // loader.elf
} } else if(OS_FIRMWARE == 500 || OS_FIRMWARE == 510) {
else if(OS_FIRMWARE == 500 || OS_FIRMWARE == 510)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FBC4); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FBC4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FAB0); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FAB0);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC);
@ -435,9 +429,7 @@ void InitOSFunctionPointers(void){
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13C3C); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13C3C);
} } else if(OS_FIRMWARE == 410) {
else if(OS_FIRMWARE == 410)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8);
@ -445,9 +437,7 @@ void InitOSFunctionPointers(void){
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13BFC); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13BFC);
} } else if(OS_FIRMWARE == 400) { //same for 402 and 403
else if(OS_FIRMWARE == 400) //same for 402 and 403
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8);
@ -455,9 +445,7 @@ void InitOSFunctionPointers(void){
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13BFC); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13BFC);
} } else if(OS_FIRMWARE == 310) {
else if(OS_FIRMWARE == 310)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8);
@ -465,9 +453,7 @@ void InitOSFunctionPointers(void){
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C);
} } else if(OS_FIRMWARE == 300) {
else if(OS_FIRMWARE == 300)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8);
@ -475,9 +461,7 @@ void InitOSFunctionPointers(void){
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C);
} } else {
else
{
OSFatal("Missing all OS specific addresses."); OSFatal("Missing all OS specific addresses.");
} }
} }

View File

@ -140,8 +140,7 @@ typedef struct OSContext_ {
u32 mmcr1; u32 mmcr1;
} OSContext; } OSContext;
typedef enum OSExceptionType typedef enum OSExceptionType {
{
OS_EXCEPTION_TYPE_SYSTEM_RESET = 0, OS_EXCEPTION_TYPE_SYSTEM_RESET = 0,
OS_EXCEPTION_TYPE_MACHINE_CHECK = 1, OS_EXCEPTION_TYPE_MACHINE_CHECK = 1,
OS_EXCEPTION_TYPE_DSI = 2, OS_EXCEPTION_TYPE_DSI = 2,

View File

@ -38,7 +38,9 @@ EXPORT_DECL(void,WPADSetAutoSleepTime,u8 minute);
EXPORT_DECL(void,WPADDisconnect,s32 chan); EXPORT_DECL(void,WPADDisconnect,s32 chan);
void InitAcquirePadScore(void) { void InitAcquirePadScore(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("padscore.rpl", &padscore_handle); OSDynLoad_Acquire("padscore.rpl", &padscore_handle);
} }

View File

@ -103,8 +103,7 @@ extern u32 padscore_handle;
#define WPAD_PRO_STICK_R_EMULATION_LEFT 0x00400000 #define WPAD_PRO_STICK_R_EMULATION_LEFT 0x00400000
#define WPAD_PRO_STICK_R_EMULATION_RIGHT 0x00800000 #define WPAD_PRO_STICK_R_EMULATION_RIGHT 0x00800000
typedef struct _KPADData typedef struct _KPADData {
{
u32 btns_h; u32 btns_h;
u32 btns_d; u32 btns_d;
u32 btns_r; u32 btns_r;
@ -133,16 +132,13 @@ typedef struct _KPADData
s8 pos_valid; s8 pos_valid;
u8 format; u8 format;
union union {
{ struct {
struct
{
f32 stick_x; f32 stick_x;
f32 stick_y; f32 stick_y;
} nunchuck; } nunchuck;
struct struct {
{
u32 btns_h; u32 btns_h;
u32 btns_d; u32 btns_d;
u32 btns_r; u32 btns_r;
@ -154,8 +150,7 @@ typedef struct _KPADData
f32 rtrigger; f32 rtrigger;
} classic; } classic;
struct struct {
{
u32 btns_h; u32 btns_h;
u32 btns_d; u32 btns_d;
u32 btns_r; u32 btns_r;

View File

@ -30,7 +30,9 @@ EXPORT_DECL(u32, ProcUIInForeground, void);
EXPORT_DECL(void, ProcUIRegisterCallback, u32 type,ProcUICallback callback,void* param, u32 unkwn); EXPORT_DECL(void, ProcUIRegisterCallback, u32 type,ProcUICallback callback,void* param, u32 unkwn);
void InitAcquireProcUI(void) { void InitAcquireProcUI(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("proc_ui.rpl", &proc_ui_handle); OSDynLoad_Acquire("proc_ui.rpl", &proc_ui_handle);
} }

View File

@ -53,7 +53,9 @@ EXPORT_DECL(s32, NSSLRead, s32 connection, const void* buf, s32 len,s32 * read);
EXPORT_DECL(s32, NSSLCreateConnection, s32 context, const char* host, s32 hotlen,s32 options,s32 sock,s32 block); EXPORT_DECL(s32, NSSLCreateConnection, s32 context, const char* host, s32 hotlen,s32 options,s32 sock,s32 block);
void InitAcquireSocket(void) { void InitAcquireSocket(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nsysnet.rpl", &nsysnet_handle); OSDynLoad_Acquire("nsysnet.rpl", &nsysnet_handle);
} }

View File

@ -77,8 +77,7 @@ struct sockaddr_in {
char sin_zero[8]; char sin_zero[8];
}; };
struct sockaddr struct sockaddr {
{
unsigned short sa_family; unsigned short sa_family;
char sa_data[14]; char sa_data[14];
}; };

View File

@ -34,7 +34,9 @@ EXPORT_DECL(s32, SYSLaunchTitle, u64 titleId);
EXPORT_DECL(s32, SYSLaunchSettings, s32 unk); EXPORT_DECL(s32, SYSLaunchSettings, s32 unk);
void InitAcquireSys(void) { void InitAcquireSys(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("sysapp.rpl", &sysapp_handle); OSDynLoad_Acquire("sysapp.rpl", &sysapp_handle);
} }

View File

@ -47,7 +47,9 @@ EXPORT_DECL(s32, HIDRead,u32 handle, unsigned char *p_buffer, u32 buffer_length,
EXPORT_DECL(s32, HIDWrite,u32 handle, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDWrite,u32 handle, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
void InitAcquireSysHID(void) { void InitAcquireSysHID(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("nsyshid.rpl", &syshid_handle); OSDynLoad_Acquire("nsyshid.rpl", &syshid_handle);
} }

View File

@ -32,8 +32,7 @@ extern "C" {
extern u32 syshid_handle; extern u32 syshid_handle;
typedef struct typedef struct {
{
u32 handle; u32 handle;
u32 physical_device_inst; u32 physical_device_inst;
u16 vid; u16 vid;
@ -54,8 +53,7 @@ typedef struct _HIDClient HIDClient;
typedef s32 (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,u32 attach); typedef s32 (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,u32 attach);
struct _HIDClient struct _HIDClient {
{
HIDClient *next; HIDClient *next;
HIDAttachCallback attach_cb; HIDAttachCallback attach_cb;
}; };

View File

@ -91,7 +91,9 @@ EXPORT_DECL(void, VPADBASEGetSensorBarSetting, s32 chan, s8 *setting);
EXPORT_DECL(s32, VPADSetSensorBar, s32 chan, bool on); EXPORT_DECL(s32, VPADSetSensorBar, s32 chan, bool on);
void InitAcquireVPad(void) { void InitAcquireVPad(void) {
if(coreinit_handle == 0){ InitAcquireOS(); }; if(coreinit_handle == 0) {
InitAcquireOS();
};
OSDynLoad_Acquire("vpad.rpl", &vpad_handle); OSDynLoad_Acquire("vpad.rpl", &vpad_handle);
OSDynLoad_Acquire("vpadbase.rpl", &vpadbase_handle); OSDynLoad_Acquire("vpadbase.rpl", &vpadbase_handle);
} }

View File

@ -68,52 +68,44 @@ extern u32 vpadbase_handle;
#define VPAD_MASK_EMULATED_STICKS 0x7F800000 #define VPAD_MASK_EMULATED_STICKS 0x7F800000
#define VPAD_MASK_BUTTONS ~VPAD_MASK_EMULATED_STICKS #define VPAD_MASK_BUTTONS ~VPAD_MASK_EMULATED_STICKS
typedef enum VPADTPResolution typedef enum VPADTPResolution {
{
VPAD_TP_1920x1080, VPAD_TP_1920x1080,
VPAD_TP_1280x720, VPAD_TP_1280x720,
VPAD_TP_854x480 VPAD_TP_854x480
} VPADTPResolution; } VPADTPResolution;
typedef enum VPADGyroZeroDriftMode typedef enum VPADGyroZeroDriftMode {
{
VPAD_GYRO_ZERODRIFT_LOOSE, VPAD_GYRO_ZERODRIFT_LOOSE,
VPAD_GYRO_ZERODRIFT_STANDARD, VPAD_GYRO_ZERODRIFT_STANDARD,
VPAD_GYRO_ZERODRIFT_TIGHT VPAD_GYRO_ZERODRIFT_TIGHT
} VPADGyroZeroDriftMode; } VPADGyroZeroDriftMode;
typedef struct typedef struct {
{
f32 x,y; f32 x,y;
} Vec2D; } Vec2D;
typedef struct typedef struct {
{
f32 x,y,z; f32 x,y,z;
} Vec3D; } Vec3D;
typedef struct typedef struct {
{
Vec3D X,Y,Z; Vec3D X,Y,Z;
} VPADDir; } VPADDir;
typedef struct typedef struct {
{
u16 x, y; /* Touch coordinates */ u16 x, y; /* Touch coordinates */
u16 touched; /* 1 = Touched, 0 = Not touched */ u16 touched; /* 1 = Touched, 0 = Not touched */
u16 invalid; /* 0 = All valid, 1 = X invalid, 2 = Y invalid, 3 = Both invalid? */ u16 invalid; /* 0 = All valid, 1 = X invalid, 2 = Y invalid, 3 = Both invalid? */
} VPADTPData; } VPADTPData;
typedef struct typedef struct {
{
s16 offsetX; s16 offsetX;
s16 offsetY; s16 offsetY;
f32 scaleX; f32 scaleX;
f32 scaleY; f32 scaleY;
} VPADTPCalibrationParam; } VPADTPCalibrationParam;
typedef struct typedef struct {
{
u32 btns_h; /* Held buttons */ u32 btns_h; /* Held buttons */
u32 btns_d; /* Buttons that are pressed at that instant */ u32 btns_d; /* Buttons that are pressed at that instant */
u32 btns_r; /* Released buttons */ u32 btns_r; /* Released buttons */