Using u32 and s32 only instead of (unsigned) int to be more consistent with data types

This commit is contained in:
Maschell 2017-04-10 11:04:06 +02:00
parent 5e01fb7d3f
commit a136b12c52
18 changed files with 314 additions and 314 deletions

View File

@ -51,7 +51,7 @@ EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset);
void InitAcquireAX(void) void InitAcquireAX(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
if(OS_FIRMWARE >= 400) if(OS_FIRMWARE >= 400)
{ {
@ -73,7 +73,7 @@ void InitAcquireAX(void)
void InitAXFunctionPointers(void) void InitAXFunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
InitAcquireAX(); InitAcquireAX();
@ -102,8 +102,8 @@ void ProperlyEndTransitionAudio(void)
void (* AXInit_old)(void); void (* AXInit_old)(void);
void (* AXQuit_old)(void); void (* AXQuit_old)(void);
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
unsigned int sound_handle; u32 sound_handle;
OSDynLoad_Acquire("snd_core.rpl", &sound_handle); OSDynLoad_Acquire("snd_core.rpl", &sound_handle);
OS_FIND_EXPORT_EX(sound_handle, check_os_audio_transition_flag, check_os_audio_transition_flag_old); OS_FIND_EXPORT_EX(sound_handle, check_os_audio_transition_flag, check_os_audio_transition_flag_old);

View File

@ -41,7 +41,7 @@ void InitAcquireCurl(void)
void InitCurlFunctionPointers(void) void InitCurlFunctionPointers(void)
{ {
InitAcquireCurl(); InitAcquireCurl();
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
OS_FIND_EXPORT_EX(libcurl_handle, curl_global_init, n_curl_global_init); OS_FIND_EXPORT_EX(libcurl_handle, curl_global_init, n_curl_global_init);
OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_init, n_curl_easy_init); OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_init, n_curl_easy_init);

View File

@ -17,7 +17,7 @@ extern "C" {
#define FS_STATUS_OK 0 #define FS_STATUS_OK 0
#define FS_RET_UNSUPPORTED_CMD 0x0400 #define FS_RET_UNSUPPORTED_CMD 0x0400
#define FS_RET_NO_ERROR 0x0000 #define FS_RET_NO_ERROR 0x0000
#define FS_RET_ALL_ERROR (unsigned int)(-1) #define FS_RET_ALL_ERROR (u32)(-1)
#define FS_STAT_FLAG_IS_DIRECTORY 0x80000000 #define FS_STAT_FLAG_IS_DIRECTORY 0x80000000

View File

@ -24,59 +24,59 @@
#include "fs_functions.h" #include "fs_functions.h"
#include "os_functions.h" #include "os_functions.h"
EXPORT_DECL(int, FSInit, void); EXPORT_DECL(s32, FSInit, void);
EXPORT_DECL(int, FSShutdown, void); EXPORT_DECL(s32, FSShutdown, void);
EXPORT_DECL(int, FSAddClientEx, void *pClient, int unk_zero_param, int errHandling); EXPORT_DECL(s32, FSAddClientEx, void *pClient, s32 unk_zero_param, s32 errHandling);
EXPORT_DECL(int, FSDelClient, void *pClient); EXPORT_DECL(s32, FSDelClient, void *pClient);
EXPORT_DECL(void, FSInitCmdBlock, void *pCmd); EXPORT_DECL(void, FSInitCmdBlock, void *pCmd);
EXPORT_DECL(int, FSGetMountSource, void *pClient, void *pCmd, int type, void *source, int errHandling); EXPORT_DECL(s32, FSGetMountSource, void *pClient, void *pCmd, s32 type, void *source, s32 errHandling);
EXPORT_DECL(int, FSMount, void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, int errHandling); EXPORT_DECL(s32, FSMount, void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, s32 errHandling);
EXPORT_DECL(int, FSUnmount, void *pClient, void *pCmd, const char *target, int errHandling); EXPORT_DECL(s32, FSUnmount, void *pClient, void *pCmd, const char *target, s32 errHandling);
EXPORT_DECL(int, FSGetStat, void *pClient, void *pCmd, const char *path, FSStat *stats, int errHandling); EXPORT_DECL(s32, FSGetStat, void *pClient, void *pCmd, const char *path, FSStat *stats, s32 errHandling);
EXPORT_DECL(int, FSGetStatAsync, void *pClient, void *pCmd, const char *path, void *stats, int error, void *asyncParams); EXPORT_DECL(s32, FSGetStatAsync, void *pClient, void *pCmd, const char *path, void *stats, s32 error, void *asyncParams);
EXPORT_DECL(int, FSRename, void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error); EXPORT_DECL(s32, FSRename, void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error);
EXPORT_DECL(int, FSRenameAsync, void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams); EXPORT_DECL(s32, FSRenameAsync, void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error, void *asyncParams);
EXPORT_DECL(int, FSRemove, void *pClient, void *pCmd, const char *path, int error); EXPORT_DECL(s32, FSRemove, void *pClient, void *pCmd, const char *path, s32 error);
EXPORT_DECL(int, FSRemoveAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams); EXPORT_DECL(s32, FSRemoveAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(int, FSFlushQuota, void *pClient, void *pCmd, const char* path, int error); EXPORT_DECL(s32, FSFlushQuota, void *pClient, void *pCmd, const char* path, s32 error);
EXPORT_DECL(int, FSFlushQuotaAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams); EXPORT_DECL(s32, FSFlushQuotaAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(int, FSGetFreeSpaceSize, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error); EXPORT_DECL(s32, FSGetFreeSpaceSize, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error);
EXPORT_DECL(int, FSGetFreeSpaceSizeAsync, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error, void *asyncParams); EXPORT_DECL(s32, FSGetFreeSpaceSizeAsync, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error, void *asyncParams);
EXPORT_DECL(int, FSRollbackQuota, void *pClient, void *pCmd, const char *path, int error); EXPORT_DECL(s32, FSRollbackQuota, void *pClient, void *pCmd, const char *path, s32 error);
EXPORT_DECL(int, FSRollbackQuotaAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams); EXPORT_DECL(s32, FSRollbackQuotaAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(int, FSOpenDir, void *pClient, void *pCmd, const char *path, int *dh, int errHandling); EXPORT_DECL(s32, FSOpenDir, void *pClient, void *pCmd, const char *path, s32 *dh, s32 errHandling);
EXPORT_DECL(int, FSOpenDirAsync, void *pClient, void* pCmd, const char *path, int *handle, int error, void *asyncParams); EXPORT_DECL(s32, FSOpenDirAsync, void *pClient, void* pCmd, const char *path, s32 *handle, s32 error, void *asyncParams);
EXPORT_DECL(int, FSReadDir, void *pClient, void *pCmd, int dh, FSDirEntry *dir_entry, int errHandling); EXPORT_DECL(s32, FSReadDir, void *pClient, void *pCmd, s32 dh, FSDirEntry *dir_entry, s32 errHandling);
EXPORT_DECL(int, FSRewindDir, void *pClient, void *pCmd, int dh, int errHandling); EXPORT_DECL(s32, FSRewindDir, void *pClient, void *pCmd, s32 dh, s32 errHandling);
EXPORT_DECL(int, FSCloseDir, void *pClient, void *pCmd, int dh, int errHandling); EXPORT_DECL(s32, FSCloseDir, void *pClient, void *pCmd, s32 dh, s32 errHandling);
EXPORT_DECL(int, FSChangeDir, void *pClient, void *pCmd, const char *path, int errHandling); EXPORT_DECL(s32, FSChangeDir, void *pClient, void *pCmd, const char *path, s32 errHandling);
EXPORT_DECL(int, FSChangeDirAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams); EXPORT_DECL(s32, FSChangeDirAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(int, FSMakeDir, void *pClient, void *pCmd, const char *path, int errHandling); EXPORT_DECL(s32, FSMakeDir, void *pClient, void *pCmd, const char *path, s32 errHandling);
EXPORT_DECL(int, FSMakeDirAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams); EXPORT_DECL(s32, FSMakeDirAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(int, FSOpenFile, void *pClient, void *pCmd, const char *path, const char *mode, int *fd, int errHandling); EXPORT_DECL(s32, FSOpenFile, void *pClient, void *pCmd, const char *path, const char *mode, s32 *fd, s32 errHandling);
EXPORT_DECL(int, FSOpenFileAsync, void *pClient, void *pCmd, const char *path, const char *mode, int *handle, int error, const void *asyncParams); EXPORT_DECL(s32, FSOpenFileAsync, void *pClient, void *pCmd, const char *path, const char *mode, s32 *handle, s32 error, const void *asyncParams);
EXPORT_DECL(int, FSReadFile, void *pClient, void *pCmd, void *buffer, int size, int count, int fd, int flag, int errHandling); EXPORT_DECL(s32, FSReadFile, void *pClient, void *pCmd, void *buffer, s32 size, s32 count, s32 fd, s32 flag, s32 errHandling);
EXPORT_DECL(int, FSCloseFile, void *pClient, void *pCmd, int fd, int errHandling); EXPORT_DECL(s32, FSCloseFile, void *pClient, void *pCmd, s32 fd, s32 errHandling);
EXPORT_DECL(int, FSFlushFile, void *pClient, void *pCmd, int fd, int error); EXPORT_DECL(s32, FSFlushFile, void *pClient, void *pCmd, s32 fd, s32 error);
EXPORT_DECL(int, FSTruncateFile, void *pClient, void *pCmd, int fd, int error); EXPORT_DECL(s32, FSTruncateFile, void *pClient, void *pCmd, s32 fd, s32 error);
EXPORT_DECL(int, FSGetStatFile, void *pClient, void *pCmd, int fd, void *buffer, int error); EXPORT_DECL(s32, FSGetStatFile, void *pClient, void *pCmd, s32 fd, void *buffer, s32 error);
EXPORT_DECL(int, FSSetPosFile, void *pClient, void *pCmd, int fd, int pos, int error); EXPORT_DECL(s32, FSSetPosFile, void *pClient, void *pCmd, s32 fd, s32 pos, s32 error);
EXPORT_DECL(int, FSWriteFile, void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error); EXPORT_DECL(s32, FSWriteFile, void *pClient, void *pCmd, const void *source, s32 block_size, s32 block_count, s32 fd, s32 flag, s32 error);
EXPORT_DECL(int, FSBindMount, void *pClient, void *pCmd, char *source, char *target, int error); EXPORT_DECL(s32, FSBindMount, void *pClient, void *pCmd, char *source, char *target, s32 error);
EXPORT_DECL(int, FSBindUnmount, void *pClient, void *pCmd, char *target, int error); EXPORT_DECL(s32, FSBindUnmount, void *pClient, void *pCmd, char *target, s32 error);
EXPORT_DECL(int, FSMakeQuota, void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling); EXPORT_DECL(s32, FSMakeQuota, void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling);
EXPORT_DECL(int, FSMakeQuotaAsync ,void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling,const void *asyncParams); EXPORT_DECL(s32, FSMakeQuotaAsync ,void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling,const void *asyncParams);
void InitFSFunctionPointers(void) void InitFSFunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
OS_FIND_EXPORT(coreinit_handle, FSInit); OS_FIND_EXPORT(coreinit_handle, FSInit);
OS_FIND_EXPORT(coreinit_handle, FSShutdown); OS_FIND_EXPORT(coreinit_handle, FSShutdown);

View File

@ -33,59 +33,59 @@ extern "C" {
void InitFSFunctionPointers(void); void InitFSFunctionPointers(void);
extern int (* FSInit)(void); extern s32 (* FSInit)(void);
extern int (* FSShutdown)(void); extern s32 (* FSShutdown)(void);
extern int (* FSAddClientEx)(void *pClient, int unk_zero_param, int errHandling); extern s32 (* FSAddClientEx)(void *pClient, s32 unk_zero_param, s32 errHandling);
extern int (* FSDelClient)(void *pClient); extern s32 (* FSDelClient)(void *pClient);
extern void (* FSInitCmdBlock)(void *pCmd); extern void (* FSInitCmdBlock)(void *pCmd);
extern int (* FSGetMountSource)(void *pClient, void *pCmd, int type, void *source, int errHandling); extern s32 (* FSGetMountSource)(void *pClient, void *pCmd, s32 type, void *source, s32 errHandling);
extern int (* FSMount)(void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, int errHandling); extern s32 (* FSMount)(void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, s32 errHandling);
extern int (* FSUnmount)(void *pClient, void *pCmd, const char *target, int errHandling); extern s32 (* FSUnmount)(void *pClient, void *pCmd, const char *target, s32 errHandling);
extern int (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error); extern s32 (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error);
extern int (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams); extern s32 (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error, void *asyncParams);
extern int (* FSRemove)(void *pClient, void *pCmd, const char *path, int error); extern s32 (* FSRemove)(void *pClient, void *pCmd, const char *path, s32 error);
extern int (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams); extern s32 (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSGetStat)(void *pClient, void *pCmd, const char *path, FSStat *stats, int errHandling); extern s32 (* FSGetStat)(void *pClient, void *pCmd, const char *path, FSStat *stats, s32 errHandling);
extern int (* FSGetStatAsync)(void *pClient, void *pCmd, const char *path, void *stats, int error, void *asyncParams); extern s32 (* FSGetStatAsync)(void *pClient, void *pCmd, const char *path, void *stats, s32 error, void *asyncParams);
extern int (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error); extern s32 (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error);
extern int (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams); extern s32 (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error, void *asyncParams);
extern int (* FSRemove)(void *pClient, void *pCmd, const char *path, int error); extern s32 (* FSRemove)(void *pClient, void *pCmd, const char *path, s32 error);
extern int (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams); extern s32 (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSFlushQuota)(void *pClient, void *pCmd, const char* path, int error); extern s32 (* FSFlushQuota)(void *pClient, void *pCmd, const char* path, s32 error);
extern int (* FSFlushQuotaAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams); extern s32 (* FSFlushQuotaAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSGetFreeSpaceSize)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error); extern s32 (* FSGetFreeSpaceSize)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error);
extern int (* FSGetFreeSpaceSizeAsync)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error, void *asyncParams); extern s32 (* FSGetFreeSpaceSizeAsync)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error, void *asyncParams);
extern int (* FSRollbackQuota)(void *pClient, void *pCmd, const char *path, int error); extern s32 (* FSRollbackQuota)(void *pClient, void *pCmd, const char *path, s32 error);
extern int (* FSRollbackQuotaAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams); extern s32 (* FSRollbackQuotaAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSOpenDir)(void *pClient, void *pCmd, const char *path, int *dh, int errHandling); extern s32 (* FSOpenDir)(void *pClient, void *pCmd, const char *path, s32 *dh, s32 errHandling);
extern int (* FSOpenDirAsync)(void *pClient, void* pCmd, const char *path, int *handle, int error, void *asyncParams); extern s32 (* FSOpenDirAsync)(void *pClient, void* pCmd, const char *path, s32 *handle, s32 error, void *asyncParams);
extern int (* FSReadDir)(void *pClient, void *pCmd, int dh, FSDirEntry *dir_entry, int errHandling); extern s32 (* FSReadDir)(void *pClient, void *pCmd, s32 dh, FSDirEntry *dir_entry, s32 errHandling);
extern int (* FSRewindDir)(void *pClient, void *pCmd, int dh, int errHandling); extern s32 (* FSRewindDir)(void *pClient, void *pCmd, s32 dh, s32 errHandling);
extern int (* FSCloseDir)(void *pClient, void *pCmd, int dh, int errHandling); extern s32 (* FSCloseDir)(void *pClient, void *pCmd, s32 dh, s32 errHandling);
extern int (* FSChangeDir)(void *pClient, void *pCmd, const char *path, int errHandling); extern s32 (* FSChangeDir)(void *pClient, void *pCmd, const char *path, s32 errHandling);
extern int (* FSChangeDirAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams); extern s32 (* FSChangeDirAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSMakeDir)(void *pClient, void *pCmd, const char *path, int errHandling); extern s32 (* FSMakeDir)(void *pClient, void *pCmd, const char *path, s32 errHandling);
extern int (* FSMakeDirAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams); extern s32 (* FSMakeDirAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSOpenFile)(void *pClient, void *pCmd, const char *path, const char *mode, int *fd, int errHandling); extern s32 (* FSOpenFile)(void *pClient, void *pCmd, const char *path, const char *mode, s32 *fd, s32 errHandling);
extern int (* FSOpenFileAsync)(void *pClient, void *pCmd, const char *path, const char *mode, int *handle, int error, const void *asyncParams); extern s32 (* FSOpenFileAsync)(void *pClient, void *pCmd, const char *path, const char *mode, s32 *handle, s32 error, const void *asyncParams);
extern int (* FSReadFile)(void *pClient, void *pCmd, void *buffer, int size, int count, int fd, int flag, int errHandling); extern s32 (* FSReadFile)(void *pClient, void *pCmd, void *buffer, s32 size, s32 count, s32 fd, s32 flag, s32 errHandling);
extern int (* FSCloseFile)(void *pClient, void *pCmd, int fd, int errHandling); extern s32 (* FSCloseFile)(void *pClient, void *pCmd, s32 fd, s32 errHandling);
extern int (* FSFlushFile)(void *pClient, void *pCmd, int fd, int error); extern s32 (* FSFlushFile)(void *pClient, void *pCmd, s32 fd, s32 error);
extern int (* FSTruncateFile)(void *pClient, void *pCmd, int fd, int error); extern s32 (* FSTruncateFile)(void *pClient, void *pCmd, s32 fd, s32 error);
extern int (* FSGetStatFile)(void *pClient, void *pCmd, int fd, void *buffer, int error); extern s32 (* FSGetStatFile)(void *pClient, void *pCmd, s32 fd, void *buffer, s32 error);
extern int (* FSSetPosFile)(void *pClient, void *pCmd, int fd, int pos, int error); extern s32 (* FSSetPosFile)(void *pClient, void *pCmd, s32 fd, s32 pos, s32 error);
extern int (* FSWriteFile)(void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error); extern s32 (* FSWriteFile)(void *pClient, void *pCmd, const void *source, s32 block_size, s32 block_count, s32 fd, s32 flag, s32 error);
extern int (* FSBindMount)(void *pClient, void *pCmd, char *source, char *target, int error); extern s32 (* FSBindMount)(void *pClient, void *pCmd, char *source, char *target, s32 error);
extern int (* FSBindUnmount)(void *pClient, void *pCmd, char *target, int error); extern s32 (* FSBindUnmount)(void *pClient, void *pCmd, char *target, s32 error);
extern int (* FSMakeQuota)( void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling); extern s32 (* FSMakeQuota)( void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling);
extern int (* FSMakeQuotaAsync)(void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling,const void *asyncParams); extern s32 (* FSMakeQuotaAsync)(void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling,const void *asyncParams);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -93,7 +93,7 @@ EXPORT_DECL(s32, GX2GetSystemDRCScanMode, void);
EXPORT_DECL(void, GX2RSetAllocator, void * (* allocFunc)(u32, u32, u32), void (* freeFunc)(u32, void*)); EXPORT_DECL(void, GX2RSetAllocator, void * (* allocFunc)(u32, u32, u32), void (* freeFunc)(u32, void*));
EXPORT_DECL(void, GX2CopySurface, GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice ); EXPORT_DECL(void, GX2CopySurface, GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice );
EXPORT_DECL(void, GX2ClearBuffersEx, GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,int 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)
{ {
@ -102,7 +102,7 @@ void InitAcquireGX2(void)
void InitGX2FunctionPointers(void) void InitGX2FunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
InitAcquireGX2(); InitAcquireGX2();
OS_FIND_EXPORT(gx2_handle, GX2Init); OS_FIND_EXPORT(gx2_handle, GX2Init);

View File

@ -30,7 +30,7 @@ extern "C" {
#include "gx2_types.h" #include "gx2_types.h"
extern unsigned int gx2_handle; extern u32 gx2_handle;
void InitGX2FunctionPointers(void); void InitGX2FunctionPointers(void);
void InitAcquireGX2(void); void InitAcquireGX2(void);
@ -101,7 +101,7 @@ extern s32 (* GX2GetSystemTVScanMode)(void);
extern s32 (* GX2GetSystemDRCScanMode)(void); extern s32 (* GX2GetSystemDRCScanMode)(void);
extern void (* GX2RSetAllocator)(void * (*allocFunc)(u32, u32, u32), void (*freeFunc)(u32, void*)); extern void (* GX2RSetAllocator)(void * (*allocFunc)(u32, u32, u32), void (*freeFunc)(u32, void*));
extern void (* GX2CopySurface)(GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice ); extern void (* GX2CopySurface)(GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice );
extern void (* GX2ClearBuffersEx)(GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,int clearFlags); extern void (* GX2ClearBuffersEx)(GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,s32 clearFlags);
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)
{ {

View File

@ -29,24 +29,24 @@ u32 coreinit_handle __attribute__((section(".data"))) = 0;
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Lib handle functions //! Lib handle functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, OSDynLoad_Acquire, const char* rpl, u32 *handle); EXPORT_DECL(s32, OSDynLoad_Acquire, const char* rpl, u32 *handle);
EXPORT_DECL(int, OSDynLoad_FindExport, u32 handle, int isdata, const char *symbol, void *address); EXPORT_DECL(s32, OSDynLoad_FindExport, u32 handle, s32 isdata, const char *symbol, void *address);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Security functions //! Security functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, OSGetSecurityLevel, void); EXPORT_DECL(s32, OSGetSecurityLevel, void);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Thread functions //! Thread functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, OSCreateThread, void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr); EXPORT_DECL(s32, OSCreateThread, void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
EXPORT_DECL(int, OSResumeThread, void *thread); EXPORT_DECL(s32, OSResumeThread, void *thread);
EXPORT_DECL(int, OSSuspendThread, void *thread); EXPORT_DECL(s32, OSSuspendThread, void *thread);
EXPORT_DECL(int, OSIsThreadTerminated, void *thread); EXPORT_DECL(s32, OSIsThreadTerminated, void *thread);
EXPORT_DECL(int, OSIsThreadSuspended, void *thread); EXPORT_DECL(s32, OSIsThreadSuspended, void *thread);
EXPORT_DECL(int, OSSetThreadPriority, void * thread, int priority); EXPORT_DECL(s32, OSSetThreadPriority, void * thread, s32 priority);
EXPORT_DECL(int, OSJoinThread, void * thread, int * ret_val); EXPORT_DECL(s32, OSJoinThread, void * thread, s32 * ret_val);
EXPORT_DECL(void, OSDetachThread, void * thread); EXPORT_DECL(void, OSDetachThread, void * thread);
EXPORT_DECL(void, OSSleepTicks, u64 ticks); EXPORT_DECL(void, OSSleepTicks, u64 ticks);
EXPORT_DECL(u64, OSGetTick, void); EXPORT_DECL(u64, OSGetTick, void);
@ -60,58 +60,58 @@ EXPORT_DECL(void, OSTicksToCalendarTime, u64 time, OSCalendarTime * calendarTime
EXPORT_DECL(void, OSInitMutex, void* mutex); EXPORT_DECL(void, OSInitMutex, void* mutex);
EXPORT_DECL(void, OSLockMutex, void* mutex); EXPORT_DECL(void, OSLockMutex, void* mutex);
EXPORT_DECL(void, OSUnlockMutex, void* mutex); EXPORT_DECL(void, OSUnlockMutex, void* mutex);
EXPORT_DECL(int, OSTryLockMutex, void* mutex); EXPORT_DECL(s32, OSTryLockMutex, void* mutex);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! System functions //! System functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(u64, OSGetTitleID, void); EXPORT_DECL(u64, OSGetTitleID, void);
EXPORT_DECL(void, OSGetArgcArgv, int* argc, char*** argv); EXPORT_DECL(void, OSGetArgcArgv, s32* argc, char*** argv);
EXPORT_DECL(void, __Exit, void); EXPORT_DECL(void, __Exit, void);
EXPORT_DECL(void, OSFatal, const char* msg); EXPORT_DECL(void, OSFatal, const char* msg);
EXPORT_DECL(void, OSSetExceptionCallback, u8 exceptionType, exception_callback newCallback); EXPORT_DECL(void, OSSetExceptionCallback, u8 exceptionType, exception_callback newCallback);
EXPORT_DECL(void, DCFlushRange, const void *addr, u32 length); EXPORT_DECL(void, DCFlushRange, const void *addr, u32 length);
EXPORT_DECL(void, ICInvalidateRange, const void *addr, u32 length); EXPORT_DECL(void, ICInvalidateRange, const void *addr, u32 length);
EXPORT_DECL(void*, OSEffectiveToPhysical, const void*); EXPORT_DECL(void*, OSEffectiveToPhysical, const void*);
EXPORT_DECL(int, __os_snprintf, char* s, int n, const char * format, ...); EXPORT_DECL(s32, __os_snprintf, char* s, s32 n, const char * format, ...);
EXPORT_DECL(int *, __gh_errno_ptr, void); EXPORT_DECL(s32 *, __gh_errno_ptr, void);
EXPORT_DECL(void, OSScreenInit, void); EXPORT_DECL(void, OSScreenInit, void);
EXPORT_DECL(unsigned int, OSScreenGetBufferSizeEx, unsigned int bufferNum); EXPORT_DECL(u32, OSScreenGetBufferSizeEx, u32 bufferNum);
EXPORT_DECL(int, OSScreenSetBufferEx, unsigned int bufferNum, void * addr); EXPORT_DECL(s32, OSScreenSetBufferEx, u32 bufferNum, void * addr);
EXPORT_DECL(int, OSScreenClearBufferEx, unsigned int bufferNum, unsigned int temp); EXPORT_DECL(s32, OSScreenClearBufferEx, u32 bufferNum, u32 temp);
EXPORT_DECL(int, OSScreenFlipBuffersEx, unsigned int bufferNum); EXPORT_DECL(s32, OSScreenFlipBuffersEx, u32 bufferNum);
EXPORT_DECL(int, OSScreenPutFontEx, unsigned int bufferNum, unsigned int posX, unsigned int posY, const char * buffer); EXPORT_DECL(s32, OSScreenPutFontEx, u32 bufferNum, u32 posX, u32 posY, const char * buffer);
EXPORT_DECL(int, OSScreenEnableEx, unsigned int bufferNum, int enable); EXPORT_DECL(s32, OSScreenEnableEx, u32 bufferNum, s32 enable);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Memory functions //! Memory functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeapEx); EXPORT_VAR(u32 *, pMEMAllocFromDefaultHeapEx);
EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeap); EXPORT_VAR(u32 *, pMEMAllocFromDefaultHeap);
EXPORT_VAR(unsigned int *, pMEMFreeToDefaultHeap); EXPORT_VAR(u32 *, pMEMFreeToDefaultHeap);
EXPORT_DECL(int, MEMGetBaseHeapHandle, int mem_arena); EXPORT_DECL(s32, MEMGetBaseHeapHandle, s32 mem_arena);
EXPORT_DECL(unsigned int, MEMGetAllocatableSizeForFrmHeapEx, int heap, int align); EXPORT_DECL(u32, MEMGetAllocatableSizeForFrmHeapEx, s32 heap, s32 align);
EXPORT_DECL(void *, MEMAllocFromFrmHeapEx, int heap, unsigned int size, int align); EXPORT_DECL(void *, MEMAllocFromFrmHeapEx, s32 heap, u32 size, s32 align);
EXPORT_DECL(void, MEMFreeToFrmHeap, int heap, int mode); EXPORT_DECL(void, MEMFreeToFrmHeap, s32 heap, s32 mode);
EXPORT_DECL(void *, MEMAllocFromExpHeapEx, int heap, unsigned int size, int align); EXPORT_DECL(void *, MEMAllocFromExpHeapEx, s32 heap, u32 size, s32 align);
EXPORT_DECL(int , MEMCreateExpHeapEx, void* address, unsigned int size, unsigned short flags); EXPORT_DECL(s32 , MEMCreateExpHeapEx, void* address, u32 size, unsigned short flags);
EXPORT_DECL(void *, MEMDestroyExpHeap, int heap); EXPORT_DECL(void *, MEMDestroyExpHeap, s32 heap);
EXPORT_DECL(void, MEMFreeToExpHeap, int heap, void* ptr); EXPORT_DECL(void, MEMFreeToExpHeap, s32 heap, void* ptr);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! MCP functions //! MCP functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, MCP_Open, void); EXPORT_DECL(s32, MCP_Open, void);
EXPORT_DECL(int, MCP_Close, int handle); EXPORT_DECL(s32, MCP_Close, s32 handle);
EXPORT_DECL(int, MCP_GetOwnTitleInfo, int handle, void * data); EXPORT_DECL(s32, MCP_GetOwnTitleInfo, s32 handle, void * data);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Loader functions (not real rpl) //! Loader functions (not real rpl)
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, LiWaitIopComplete, int unknown_syscall_arg_r3, int * remaining_bytes); EXPORT_DECL(s32, LiWaitIopComplete, s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
EXPORT_DECL(int, LiWaitIopCompleteWithInterrupts, int unknown_syscall_arg_r3, int * remaining_bytes); EXPORT_DECL(s32, LiWaitIopCompleteWithInterrupts, s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
EXPORT_DECL(void, addr_LiWaitOneChunk, void); EXPORT_DECL(void, addr_LiWaitOneChunk, void);
EXPORT_DECL(void, addr_sgIsLoadingBuffer, void); EXPORT_DECL(void, addr_sgIsLoadingBuffer, void);
EXPORT_DECL(void, addr_gDynloadInitialized, void); EXPORT_DECL(void, addr_gDynloadInitialized, void);
@ -130,39 +130,39 @@ EXPORT_DECL(void, DCInvalidateRange, void *buffer, uint32_t length);
//! Energy Saver functions //! Energy Saver functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Burn-in Reduction //Burn-in Reduction
EXPORT_DECL(int, IMEnableDim,void); EXPORT_DECL(s32, IMEnableDim,void);
EXPORT_DECL(int, IMDisableDim,void); EXPORT_DECL(s32, IMDisableDim,void);
EXPORT_DECL(int, IMIsDimEnabled,int * result); EXPORT_DECL(s32, IMIsDimEnabled,s32 * result);
//Auto power down //Auto power down
EXPORT_DECL(int, IMEnableAPD,void); EXPORT_DECL(s32, IMEnableAPD,void);
EXPORT_DECL(int, IMDisableAPD,void); EXPORT_DECL(s32, IMDisableAPD,void);
EXPORT_DECL(int, IMIsAPDEnabled,int * result); EXPORT_DECL(s32, IMIsAPDEnabled,s32 * result);
EXPORT_DECL(int, IMIsAPDEnabledBySysSettings,int * result); EXPORT_DECL(s32, IMIsAPDEnabledBySysSettings,s32 * result);
EXPORT_DECL(s32, OSSendAppSwitchRequest,int param,void* unknown1,void* unknown2); EXPORT_DECL(s32, OSSendAppSwitchRequest,s32 param,void* unknown1,void* unknown2);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS functions //! IOS functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, IOS_Ioctl,int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len); EXPORT_DECL(s32, IOS_Ioctl,s32 fd, u32 request, void *input_buffer,u32 input_buffer_len, void *output_buffer, u32 output_buffer_len);
EXPORT_DECL(int, IOS_Open,char *path, unsigned int mode); EXPORT_DECL(s32, IOS_Open,char *path, u32 mode);
EXPORT_DECL(int, IOS_Close,int fd); EXPORT_DECL(s32, IOS_Close,s32 fd);
void InitAcquireOS(void) void InitAcquireOS(void)
{ {
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Lib handle functions //! Lib handle functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_FUNC_WRITE(OSDynLoad_Acquire, (int (*)(const char*, unsigned *))OS_SPECIFICS->addr_OSDynLoad_Acquire); EXPORT_FUNC_WRITE(OSDynLoad_Acquire, (s32 (*)(const char*, unsigned *))OS_SPECIFICS->addr_OSDynLoad_Acquire);
EXPORT_FUNC_WRITE(OSDynLoad_FindExport, (int (*)(u32, int, const char *, void *))OS_SPECIFICS->addr_OSDynLoad_FindExport); EXPORT_FUNC_WRITE(OSDynLoad_FindExport, (s32 (*)(u32, s32, const char *, void *))OS_SPECIFICS->addr_OSDynLoad_FindExport);
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle); OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
} }
void InitOSFunctionPointers(void) void InitOSFunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
InitAcquireOS(); InitAcquireOS();
@ -270,73 +270,73 @@ void InitOSFunctionPointers(void)
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540) if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540)
{ {
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100FFA4); // loader.elf EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FFA4); // loader.elf
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FE90); // loader.elf EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FE90); // loader.elf
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC); // loader.elf EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC); // loader.elf
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18558); // kernel.elf EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF18558); // kernel.elf
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19D00); // loader.elf EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00); // loader.elf
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))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, (int (*)(int, int *))0x0100FBC4); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FBC4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FAB0); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FAB0);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18534); EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF18534);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19D00); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13C3C); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13C3C);
} }
else if(OS_FIRMWARE == 410) else if(OS_FIRMWARE == 410)
{ {
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100F78C); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100F678); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007F8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF166DC); EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF166DC);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19CC0); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))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, (int (*)(int, int *))0x0100F78C); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100F678); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007F8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15E70); EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF15E70);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19CC0); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13BFC); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13BFC);
} }
else if(OS_FIRMWARE == 550) else if(OS_FIRMWARE == 550)
{ {
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x01010180); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x01010180);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0101006C); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0101006C);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x0100080C); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x0100080C);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF184E4); EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF184E4);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19E80); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19E80);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13DBC); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13DBC);
} }
else if(OS_FIRMWARE == 310) else if(OS_FIRMWARE == 310)
{ {
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100C4E4); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100C3D4); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010004D8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15A0C); EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF15A0C);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19340); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE1329C); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C);
} }
else if(OS_FIRMWARE == 300) else if(OS_FIRMWARE == 300)
{ {
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100C4E4); EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100C3D4); EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010004D8); EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15974); EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF15974);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19340); EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE1329C); EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C);
} }
else else
{ {

View File

@ -72,24 +72,24 @@ void InitAcquireOS(void);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Lib handle functions //! Lib handle functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* OSDynLoad_Acquire)(const char* rpl, u32 *handle); extern s32 (* OSDynLoad_Acquire)(const char* rpl, u32 *handle);
extern int (* OSDynLoad_FindExport)(u32 handle, int isdata, const char *symbol, void *address); extern s32 (* OSDynLoad_FindExport)(u32 handle, s32 isdata, const char *symbol, void *address);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Security functions //! Security functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* OSGetSecurityLevel)(void); extern s32 (* OSGetSecurityLevel)(void);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Thread functions //! Thread functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* OSCreateThread)(void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr); extern s32 (* OSCreateThread)(void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
extern int (* OSResumeThread)(void *thread); extern s32 (* OSResumeThread)(void *thread);
extern int (* OSSuspendThread)(void *thread); extern s32 (* OSSuspendThread)(void *thread);
extern int (* OSIsThreadTerminated)(void *thread); extern s32 (* OSIsThreadTerminated)(void *thread);
extern int (* OSIsThreadSuspended)(void *thread); extern s32 (* OSIsThreadSuspended)(void *thread);
extern int (* OSJoinThread)(void * thread, int * ret_val); extern s32 (* OSJoinThread)(void * thread, s32 * ret_val);
extern int (* OSSetThreadPriority)(void * thread, int priority); extern s32 (* OSSetThreadPriority)(void * thread, s32 priority);
extern void (* OSDetachThread)(void * thread); extern void (* OSDetachThread)(void * thread);
extern void (* OSSleepTicks)(u64 ticks); extern void (* OSSleepTicks)(u64 ticks);
extern u64 (* OSGetTick)(void); extern u64 (* OSGetTick)(void);
@ -102,28 +102,28 @@ extern void (*OSTicksToCalendarTime)(u64 time, OSCalendarTime *calendarTime);
extern void (* OSInitMutex)(void* mutex); extern void (* OSInitMutex)(void* mutex);
extern void (* OSLockMutex)(void* mutex); extern void (* OSLockMutex)(void* mutex);
extern void (* OSUnlockMutex)(void* mutex); extern void (* OSUnlockMutex)(void* mutex);
extern int (* OSTryLockMutex)(void* mutex); extern s32 (* OSTryLockMutex)(void* mutex);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! System functions //! System functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern u64 (* OSGetTitleID)(void); extern u64 (* OSGetTitleID)(void);
extern void (* OSGetArgcArgv)(int* argc, char*** argv); extern void (* OSGetArgcArgv)(s32* argc, char*** argv);
extern void (* __Exit)(void); extern void (* __Exit)(void);
extern void (* OSFatal)(const char* msg); extern void (* OSFatal)(const char* msg);
extern void (* DCFlushRange)(const void *addr, u32 length); extern void (* DCFlushRange)(const void *addr, u32 length);
extern void (* ICInvalidateRange)(const void *addr, u32 length); extern void (* ICInvalidateRange)(const void *addr, u32 length);
extern void* (* OSEffectiveToPhysical)(const void*); extern void* (* OSEffectiveToPhysical)(const void*);
extern int (* __os_snprintf)(char* s, int n, const char * format, ...); extern s32 (* __os_snprintf)(char* s, s32 n, const char * format, ...);
extern int * (* __gh_errno_ptr)(void); extern s32 * (* __gh_errno_ptr)(void);
extern void (*OSScreenInit)(void); extern void (*OSScreenInit)(void);
extern unsigned int (*OSScreenGetBufferSizeEx)(unsigned int bufferNum); extern u32 (*OSScreenGetBufferSizeEx)(u32 bufferNum);
extern int (*OSScreenSetBufferEx)(unsigned int bufferNum, void * addr); extern s32 (*OSScreenSetBufferEx)(u32 bufferNum, void * addr);
extern int (*OSScreenClearBufferEx)(unsigned int bufferNum, unsigned int temp); extern s32 (*OSScreenClearBufferEx)(u32 bufferNum, u32 temp);
extern int (*OSScreenFlipBuffersEx)(unsigned int bufferNum); extern s32 (*OSScreenFlipBuffersEx)(u32 bufferNum);
extern int (*OSScreenPutFontEx)(unsigned int bufferNum, unsigned int posX, unsigned int posY, const char * buffer); extern s32 (*OSScreenPutFontEx)(u32 bufferNum, u32 posX, u32 posY, const char * buffer);
extern int (*OSScreenEnableEx)(unsigned int bufferNum, int enable); extern s32 (*OSScreenEnableEx)(u32 bufferNum, s32 enable);
typedef unsigned char (*exception_callback)(void * interruptedContext); typedef unsigned char (*exception_callback)(void * interruptedContext);
extern void (* OSSetExceptionCallback)(u8 exceptionType, exception_callback newCallback); extern void (* OSSetExceptionCallback)(u8 exceptionType, exception_callback newCallback);
@ -131,15 +131,15 @@ extern void (* OSSetExceptionCallback)(u8 exceptionType, exception_callback newC
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! MCP functions //! MCP functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* MCP_Open)(void); extern s32 (* MCP_Open)(void);
extern int (* MCP_Close)(int handle); extern s32 (* MCP_Close)(s32 handle);
extern int (* MCP_GetOwnTitleInfo)(int handle, void * data); extern s32 (* MCP_GetOwnTitleInfo)(s32 handle, void * data);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! LOADER functions //! LOADER functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* LiWaitIopComplete)(int unknown_syscall_arg_r3, int * remaining_bytes); extern s32 (* LiWaitIopComplete)(s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
extern int (* LiWaitIopCompleteWithInterrupts)(int unknown_syscall_arg_r3, int * remaining_bytes); extern s32 (* LiWaitIopCompleteWithInterrupts)(s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
extern void (* addr_LiWaitOneChunk)(void); extern void (* addr_LiWaitOneChunk)(void);
extern void (* addr_sgIsLoadingBuffer)(void); extern void (* addr_sgIsLoadingBuffer)(void);
extern void (* addr_gDynloadInitialized)(void); extern void (* addr_gDynloadInitialized)(void);
@ -158,24 +158,24 @@ extern void (*DCInvalidateRange)(void *buffer, uint32_t length);
//! Energy Saver functions //! Energy Saver functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
////Burn-in Reduction ////Burn-in Reduction
extern int (*IMEnableDim)(void); extern s32 (*IMEnableDim)(void);
extern int (*IMDisableDim)(void); extern s32 (*IMDisableDim)(void);
extern int (*IMIsDimEnabled)(int * result); extern s32 (*IMIsDimEnabled)(s32 * result);
//Auto power down //Auto power down
extern int (*IMEnableAPD)(void); extern s32 (*IMEnableAPD)(void);
extern int (*IMDisableAPD)(void); extern s32 (*IMDisableAPD)(void);
extern int (*IMIsAPDEnabled)(int * result); extern s32 (*IMIsAPDEnabled)(s32 * result);
extern int (*IMIsAPDEnabledBySysSettings)(int * result); extern s32 (*IMIsAPDEnabledBySysSettings)(s32 * result);
extern s32 (*OSSendAppSwitchRequest)(int param,void* unknown1,void* unknown2); extern s32 (*OSSendAppSwitchRequest)(s32 param,void* unknown1,void* unknown2);
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS functions //! IOS functions
//!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (*IOS_Ioctl)(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len); extern s32 (*IOS_Ioctl)(s32 fd, u32 request, void *input_buffer,u32 input_buffer_len, void *output_buffer, u32 output_buffer_len);
extern int (*IOS_Open)(char *path, unsigned int mode); extern s32 (*IOS_Open)(char *path, u32 mode);
extern int (*IOS_Close)(int fd); extern s32 (*IOS_Close)(s32 fd);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -43,7 +43,7 @@ void InitAcquirePadScore(void)
void InitPadScoreFunctionPointers(void) void InitPadScoreFunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
InitAcquirePadScore(); InitAcquirePadScore();
OS_FIND_EXPORT(padscore_handle, WPADInit); OS_FIND_EXPORT(padscore_handle, WPADInit);

View File

@ -29,23 +29,23 @@ u32 hostIpAddress = 0;
u32 nsysnet_handle __attribute__((section(".data"))) = 0; u32 nsysnet_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, socket_lib_init, void); EXPORT_DECL(void, socket_lib_init, void);
EXPORT_DECL(int, socket, int domain, int type, int protocol); EXPORT_DECL(s32, socket, s32 domain, s32 type, s32 protocol);
EXPORT_DECL(int, socketclose, int s); EXPORT_DECL(s32, socketclose, s32 s);
EXPORT_DECL(int, connect, int s, void *addr, int addrlen); EXPORT_DECL(s32, connect, s32 s, void *addr, s32 addrlen);
EXPORT_DECL(int, bind, s32 s,struct sockaddr *name,s32 namelen); EXPORT_DECL(s32, bind, s32 s,struct sockaddr *name,s32 namelen);
EXPORT_DECL(int, listen, s32 s,u32 backlog); EXPORT_DECL(s32, listen, s32 s,u32 backlog);
EXPORT_DECL(int, accept, s32 s,struct sockaddr *addr,s32 *addrlen); EXPORT_DECL(s32, accept, s32 s,struct sockaddr *addr,s32 *addrlen);
EXPORT_DECL(int, send, int s, const void *buffer, int size, int flags); EXPORT_DECL(s32, send, s32 s, const void *buffer, s32 size, s32 flags);
EXPORT_DECL(int, recv, int s, void *buffer, int size, int flags); EXPORT_DECL(s32, recv, s32 s, void *buffer, s32 size, s32 flags);
EXPORT_DECL(int, recvfrom,int sockfd, void *buf, int len, int flags,struct sockaddr *src_addr, int *addrlen); EXPORT_DECL(s32, recvfrom,s32 sockfd, void *buf, s32 len, s32 flags,struct sockaddr *src_addr, s32 *addrlen);
EXPORT_DECL(int, sendto, int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len); EXPORT_DECL(s32, sendto, s32 s, const void *buffer, s32 size, s32 flags, const struct sockaddr *dest, s32 dest_len);
EXPORT_DECL(int, setsockopt, int s, int level, int optname, void *optval, int optlen); EXPORT_DECL(s32, setsockopt, s32 s, s32 level, s32 optname, void *optval, s32 optlen);
EXPORT_DECL(char *, inet_ntoa, struct in_addr in); EXPORT_DECL(char *, inet_ntoa, struct in_addr in);
EXPORT_DECL(int, inet_aton, const char *cp, struct in_addr *inp); EXPORT_DECL(s32, inet_aton, const char *cp, struct in_addr *inp);
EXPORT_DECL(int, NSSLWrite, int connection, const void* buf, int len,int * written); EXPORT_DECL(s32, NSSLWrite, s32 connection, const void* buf, s32 len,s32 * written);
EXPORT_DECL(int, NSSLRead, int connection, const void* buf, int len,int * read); EXPORT_DECL(s32, NSSLRead, s32 connection, const void* buf, s32 len,s32 * read);
EXPORT_DECL(int, NSSLCreateConnection, int context, const char* host, int hotlen,int options,int sock,int block); EXPORT_DECL(s32, NSSLCreateConnection, s32 context, const char* host, s32 hotlen,s32 options,s32 sock,s32 block);
void InitAcquireSocket(void) void InitAcquireSocket(void)
{ {
@ -54,15 +54,15 @@ void InitAcquireSocket(void)
void InitSocketFunctionPointers(void) void InitSocketFunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
InitAcquireSocket(); InitAcquireSocket();
unsigned int nn_ac_handle; u32 nn_ac_handle;
int(*ACInitialize)(); s32(*ACInitialize)();
int(*ACGetStartupId) (unsigned int *id); s32(*ACGetStartupId) (u32 *id);
int(*ACConnectWithConfigId) (unsigned int id); s32(*ACConnectWithConfigId) (u32 id);
int(*ACGetAssignedAddress) (u32 * ip); s32(*ACGetAssignedAddress) (u32 * ip);
OSDynLoad_Acquire("nn_ac.rpl", &nn_ac_handle); OSDynLoad_Acquire("nn_ac.rpl", &nn_ac_handle);
OSDynLoad_FindExport(nn_ac_handle, 0, "ACInitialize", &ACInitialize); OSDynLoad_FindExport(nn_ac_handle, 0, "ACInitialize", &ACInitialize);
OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetStartupId", &ACGetStartupId); OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetStartupId", &ACGetStartupId);
@ -88,7 +88,7 @@ void InitSocketFunctionPointers(void)
OS_FIND_EXPORT(nsysnet_handle, NSSLRead); OS_FIND_EXPORT(nsysnet_handle, NSSLRead);
OS_FIND_EXPORT(nsysnet_handle, NSSLCreateConnection); OS_FIND_EXPORT(nsysnet_handle, NSSLCreateConnection);
unsigned int nn_startupid; u32 nn_startupid;
ACInitialize(); ACInitialize();
ACGetStartupId(&nn_startupid); ACGetStartupId(&nn_startupid);
ACConnectWithConfigId(nn_startupid); ACConnectWithConfigId(nn_startupid);

View File

@ -61,7 +61,7 @@ extern u32 nsysnet_handle;
struct in_addr { struct in_addr {
unsigned int s_addr; u32 s_addr;
}; };
struct sockaddr_in { struct sockaddr_in {
short sin_family; short sin_family;
@ -81,25 +81,25 @@ void InitSocketFunctionPointers(void);
void InitAcquireSocket(void); void InitAcquireSocket(void);
extern void (*socket_lib_init)(void); extern void (*socket_lib_init)(void);
extern int (*socket)(int domain, int type, int protocol); extern s32 (*socket)(s32 domain, s32 type, s32 protocol);
extern int (*socketclose)(int s); extern s32 (*socketclose)(s32 s);
extern int (*connect)(int s, void *addr, int addrlen); extern s32 (*connect)(s32 s, void *addr, s32 addrlen);
extern int (*bind)(s32 s,struct sockaddr *name,s32 namelen); extern s32 (*bind)(s32 s,struct sockaddr *name,s32 namelen);
extern int (*listen)(s32 s,u32 backlog); extern s32 (*listen)(s32 s,u32 backlog);
extern int (*accept)(s32 s,struct sockaddr *addr,s32 *addrlen); extern s32 (*accept)(s32 s,struct sockaddr *addr,s32 *addrlen);
extern int (*send)(int s, const void *buffer, int size, int flags); extern s32 (*send)(s32 s, const void *buffer, s32 size, s32 flags);
extern int (*recv)(int s, void *buffer, int size, int flags); extern s32 (*recv)(s32 s, void *buffer, s32 size, s32 flags);
extern int (*recvfrom)(int sockfd, void *buf, int len, int flags,struct sockaddr *src_addr, int *addrlen); extern s32 (*recvfrom)(s32 sockfd, void *buf, s32 len, s32 flags,struct sockaddr *src_addr, s32 *addrlen);
extern int (*sendto)(int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len); extern s32 (*sendto)(s32 s, const void *buffer, s32 size, s32 flags, const struct sockaddr *dest, s32 dest_len);
extern int (*setsockopt)(int s, int level, int optname, void *optval, int optlen); extern s32 (*setsockopt)(s32 s, s32 level, s32 optname, void *optval, s32 optlen);
extern int (* NSSLWrite)(int connection, const void* buf, int len,int * written); extern s32 (* NSSLWrite)(s32 connection, const void* buf, s32 len,s32 * written);
extern int (* NSSLRead)(int connection, const void* buf, int len,int * read); extern s32 (* NSSLRead)(s32 connection, const void* buf, s32 len,s32 * read);
extern int (* NSSLCreateConnection)(int context, const char* host, int hotlen,int options,int sock,int block); extern s32 (* NSSLCreateConnection)(s32 context, const char* host, s32 hotlen,s32 options,s32 sock,s32 block);
extern char * (*inet_ntoa)(struct in_addr in); extern char * (*inet_ntoa)(struct in_addr in);
extern int (*inet_aton)(const char *cp, struct in_addr *inp); extern s32 (*inet_aton)(const char *cp, struct in_addr *inp);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -25,11 +25,11 @@
u32 sysapp_handle __attribute__((section(".data"))) = 0; u32 sysapp_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(int, _SYSLaunchTitleByPathFromLauncher, const char* path, int len, int zero); EXPORT_DECL(s32, _SYSLaunchTitleByPathFromLauncher, const char* path, s32 len, s32 zero);
EXPORT_DECL(int, SYSRelaunchTitle, int argc, char** argv); EXPORT_DECL(s32, SYSRelaunchTitle, s32 argc, char** argv);
EXPORT_DECL(int, SYSLaunchMenu, void); EXPORT_DECL(s32, SYSLaunchMenu, void);
EXPORT_DECL(int, SYSCheckTitleExists, u64 titleId); EXPORT_DECL(s32, SYSCheckTitleExists, u64 titleId);
EXPORT_DECL(int, SYSLaunchTitle, u64 titleId); EXPORT_DECL(s32, SYSLaunchTitle, u64 titleId);
void InitAcquireSys(void) void InitAcquireSys(void)
{ {
@ -38,7 +38,7 @@ void InitAcquireSys(void)
void InitSysFunctionPointers(void) void InitSysFunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
InitAcquireSys(); InitAcquireSys();
OS_FIND_EXPORT(sysapp_handle, _SYSLaunchTitleByPathFromLauncher); OS_FIND_EXPORT(sysapp_handle, _SYSLaunchTitleByPathFromLauncher);

View File

@ -33,8 +33,8 @@ extern u32 sysapp_handle;
void InitSysFunctionPointers(void); void InitSysFunctionPointers(void);
void InitAcquireSys(void); void InitAcquireSys(void);
extern int(*_SYSLaunchTitleByPathFromLauncher)(const char* path, int len, int zero); extern int(*_SYSLaunchTitleByPathFromLauncher)(const char* path, s32 len, s32 zero);
extern int (* SYSRelaunchTitle)(int argc, char** argv); extern int (* SYSRelaunchTitle)(s32 argc, char** argv);
extern int (* SYSLaunchMenu)(void); extern int (* SYSLaunchMenu)(void);
extern int (* SYSCheckTitleExists)(u64 titleId); extern int (* SYSCheckTitleExists)(u64 titleId);
extern int (* SYSLaunchTitle)(u64 titleId); extern int (* SYSLaunchTitle)(u64 titleId);

View File

@ -26,25 +26,25 @@
u32 syshid_handle __attribute__((section(".data"))) = 0; u32 syshid_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(int, HIDSetup,void); EXPORT_DECL(s32, HIDSetup,void);
EXPORT_DECL(int, HIDTeardown,void); EXPORT_DECL(s32, HIDTeardown,void);
EXPORT_DECL(int, HIDAddClient,HIDClient *p_client, HIDAttachCallback attach_callback); EXPORT_DECL(s32, HIDAddClient,HIDClient *p_client, HIDAttachCallback attach_callback);
EXPORT_DECL(int, HIDDelClient,HIDClient *p_client); EXPORT_DECL(s32, HIDDelClient,HIDClient *p_client);
EXPORT_DECL(int, HIDGetDescriptor,unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDGetDescriptor,u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetDescriptor,unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDSetDescriptor,u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetProtocol,unsigned int handle,u8 interface_index,u8 protocol, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDSetProtocol,u32 handle,u8 s32erface_index,u8 protocol, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDGetProtocol,unsigned int handle,u8 interface_index,u8 * protocol, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDGetProtocol,u32 handle,u8 s32erface_index,u8 * protocol, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDGetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDGetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDSetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetIdle,unsigned int handle, u8 interface_index,u8 duration, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDSetIdle,u32 handle, u8 s32erface_index,u8 duration, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDRead,unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user); EXPORT_DECL(s32, HIDRead,u32 handle, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDWrite,unsigned int handle, unsigned char *p_buffer, unsigned int 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)
{ {
@ -59,7 +59,7 @@ void InitSysHIDFunctionPointers(void)
return; return;
} }
unsigned int funcPointer = 0; u32 funcPointer = 0;
//! assigning those is not mandatory and it does not always work to load them //! assigning those is not mandatory and it does not always work to load them
OS_FIND_EXPORT(syshid_handle, HIDSetup); OS_FIND_EXPORT(syshid_handle, HIDSetup);

View File

@ -32,8 +32,8 @@ extern u32 syshid_handle;
typedef struct typedef struct
{ {
unsigned int handle; u32 handle;
unsigned int physical_device_inst; u32 physical_device_inst;
unsigned short vid; unsigned short vid;
unsigned short pid; unsigned short pid;
unsigned char interface_index; unsigned char interface_index;
@ -50,7 +50,7 @@ typedef struct _HIDClient HIDClient;
#define HID_DEVICE_DETACH 0 #define HID_DEVICE_DETACH 0
#define HID_DEVICE_ATTACH 1 #define HID_DEVICE_ATTACH 1
typedef int (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,unsigned int attach); typedef s32 (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,u32 attach);
struct _HIDClient struct _HIDClient
{ {
@ -58,30 +58,30 @@ struct _HIDClient
HIDAttachCallback attach_cb; HIDAttachCallback attach_cb;
}; };
typedef void (*HIDCallback)(unsigned int handle,int error,unsigned char *p_buffer,unsigned int bytes_transferred,void *p_user); typedef void (*HIDCallback)(u32 handle,s32 error,unsigned char *p_buffer,u32 bytes_transferred,void *p_user);
void InitSysHIDFunctionPointers(void); void InitSysHIDFunctionPointers(void);
void InitAcquireSysHID(void); void InitAcquireSysHID(void);
extern int(*HIDSetup)(void); extern s32(*HIDSetup)(void);
extern int(*HIDTeardown)(void); extern s32(*HIDTeardown)(void);
extern int(*HIDAddClient)(HIDClient *p_client, HIDAttachCallback attach_callback); extern s32(*HIDAddClient)(HIDClient *p_client, HIDAttachCallback attach_callback);
extern int(*HIDDelClient)(HIDClient *p_client); extern s32(*HIDDelClient)(HIDClient *p_client);
extern int(*HIDGetDescriptor)(unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user); extern s32(*HIDGetDescriptor)(u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDSetDescriptor)(unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user); extern s32(*HIDSetDescriptor)(u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDGetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user); extern s32(*HIDGetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDSetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user); extern s32(*HIDSetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDSetIdle)(unsigned int handle, u8 interface_index,u8 duration, HIDCallback hc, void *p_user); extern s32(*HIDSetIdle)(u32 handle, u8 s32erface_index,u8 duration, HIDCallback hc, void *p_user);
extern int(* HIDSetProtocol)(unsigned int handle,u8 interface_index,u8 protocol, HIDCallback hc, void *p_user); extern s32(* HIDSetProtocol)(u32 handle,u8 s32erface_index,u8 protocol, HIDCallback hc, void *p_user);
extern int(* HIDGetProtocol)(unsigned int handle,u8 interface_index,u8 * protocol, HIDCallback hc, void *p_user); extern s32(* HIDGetProtocol)(u32 handle,u8 s32erface_index,u8 * protocol, HIDCallback hc, void *p_user);
extern int(*HIDRead)(unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user); extern s32(*HIDRead)(u32 handle, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDWrite)(unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user); extern s32(*HIDWrite)(u32 handle, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -28,11 +28,11 @@ u32 vpad_handle __attribute__((section(".data"))) = 0;
u32 vpadbase_handle __attribute__((section(".data"))) = 0; u32 vpadbase_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, VPADInit, void); EXPORT_DECL(void, VPADInit, void);
EXPORT_DECL(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error); EXPORT_DECL(s32, VPADRead, s32 chan, VPADData *buffer, u32 buffer_size, s32 *error);
EXPORT_DECL(int, VPADGetLcdMode, int padnum, int *lcdmode); EXPORT_DECL(s32, VPADGetLcdMode, s32 padnum, s32 *lcdmode);
EXPORT_DECL(int, VPADSetLcdMode, int padnum, int lcdmode); EXPORT_DECL(s32, VPADSetLcdMode, s32 padnum, s32 lcdmode);
EXPORT_DECL(int, VPADBASEGetMotorOnRemainingCount, int padnum); EXPORT_DECL(s32, VPADBASEGetMotorOnRemainingCount, s32 padnum);
EXPORT_DECL(int, VPADBASESetMotorOnRemainingCount, int padnum, int counter); EXPORT_DECL(s32, VPADBASESetMotorOnRemainingCount, s32 padnum, s32 counter);
void InitAcquireVPad(void) void InitAcquireVPad(void)
{ {
@ -42,7 +42,7 @@ void InitAcquireVPad(void)
void InitVPadFunctionPointers(void) void InitVPadFunctionPointers(void)
{ {
unsigned int *funcPointer = 0; u32 *funcPointer = 0;
InitAcquireVPad(); InitAcquireVPad();

View File

@ -100,12 +100,12 @@ typedef struct
void InitVPadFunctionPointers(void); void InitVPadFunctionPointers(void);
void InitAcquireVPad(void); void InitAcquireVPad(void);
extern int (* VPADRead)(int chan, VPADData *buffer, u32 buffer_size, s32 *error); extern s32 (* VPADRead)(s32 chan, VPADData *buffer, u32 buffer_size, s32 *error);
extern int (* VPADGetLcdMode)(int padnum, int *lcdmode); extern s32 (* VPADGetLcdMode)(s32 padnum, s32 *lcdmode);
extern int (* VPADSetLcdMode)(int padnum, int lcdmode); extern s32 (* VPADSetLcdMode)(s32 padnum, s32 lcdmode);
extern void (* VPADInit)(void); extern void (* VPADInit)(void);
extern int (* VPADBASEGetMotorOnRemainingCount)(int lcdmode); extern s32 (* VPADBASEGetMotorOnRemainingCount)(s32 lcdmode);
extern int (* VPADBASESetMotorOnRemainingCount)(int lcdmode,int counter); extern s32 (* VPADBASESetMotorOnRemainingCount)(s32 lcdmode,s32 counter);
#ifdef __cplusplus #ifdef __cplusplus
} }