Change int to s32
This commit is contained in:
parent
206fb7d931
commit
ec5f686ffb
20 changed files with 172 additions and 175 deletions
|
|
@ -5,7 +5,9 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int _prolog();
|
#include "dolphin/types.h"
|
||||||
|
|
||||||
|
extern s32 _prolog();
|
||||||
extern void _epilog();
|
extern void _epilog();
|
||||||
|
|
||||||
typedef void (*VoidFunc)(void);
|
typedef void (*VoidFunc)(void);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int _prolog();
|
#include "dolphin/types.h"
|
||||||
|
|
||||||
|
extern s32 _prolog();
|
||||||
extern void _epilog();
|
extern void _epilog();
|
||||||
|
|
||||||
typedef void (*VoidFunc)(void);
|
typedef void (*VoidFunc)(void);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ typedef struct data_read_stat {
|
||||||
} DataReadStat;
|
} DataReadStat;
|
||||||
|
|
||||||
void HuDataInit(void);
|
void HuDataInit(void);
|
||||||
int HuDataReadChk(s32 data_num);
|
s32 HuDataReadChk(s32 data_num);
|
||||||
DataReadStat *HuDataGetStatus(void *dir_ptr);
|
DataReadStat *HuDataGetStatus(void *dir_ptr);
|
||||||
void *HuDataGetDirPtr(s32 data_num);
|
void *HuDataGetDirPtr(s32 data_num);
|
||||||
DataReadStat *HuDataDirRead(s32 data_num);
|
DataReadStat *HuDataDirRead(s32 data_num);
|
||||||
|
|
@ -52,7 +52,7 @@ void HuDataDirClose(s32 data_id);
|
||||||
void HuDataDirCloseNum(s32 num);
|
void HuDataDirCloseNum(s32 num);
|
||||||
void *HuDataReadNumHeapShortForce(s32 data_id, s32 num, HeapID heap);
|
void *HuDataReadNumHeapShortForce(s32 data_id, s32 num, HeapID heap);
|
||||||
|
|
||||||
void HuDecodeData(void *src, void *dst, u32 size, int decode_type);
|
void HuDecodeData(void *src, void *dst, u32 size, s32 decode_type);
|
||||||
|
|
||||||
extern u32 DirDataSize;
|
extern u32 DirDataSize;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,30 +7,30 @@ void GWInit(void);
|
||||||
void GWGameStatReset(void);
|
void GWGameStatReset(void);
|
||||||
s32 GWMessSpeedGet(void);
|
s32 GWMessSpeedGet(void);
|
||||||
s32 GWMessDelayGet(void);
|
s32 GWMessDelayGet(void);
|
||||||
void GWMGRecordSet(int index, s32 value);
|
void GWMGRecordSet(s32 index, s32 value);
|
||||||
s32 GWMGRecordGet(int index);
|
s32 GWMGRecordGet(s32 index);
|
||||||
void GWCharColorGet(int character, GXColor *color);
|
void GWCharColorGet(s32 character, GXColor *color);
|
||||||
void GWBoardPlayCountSet(int board, u8 value);
|
void GWBoardPlayCountSet(s32 board, u8 value);
|
||||||
void GWBoardPlayCountAdd(int board, u8 value);
|
void GWBoardPlayCountAdd(s32 board, u8 value);
|
||||||
u8 GWBoardPlayCountGet(int board);
|
u8 GWBoardPlayCountGet(s32 board);
|
||||||
void GWBoardMaxStarsSet(int board, int value);
|
void GWBoardMaxStarsSet(s32 board, s32 value);
|
||||||
u16 GWBoardMaxStarsGet(int board);
|
u16 GWBoardMaxStarsGet(s32 board);
|
||||||
void GWBoardMaxCoinsSet(int board, int value);
|
void GWBoardMaxCoinsSet(s32 board, s32 value);
|
||||||
u16 GWBoardMaxCoinsGet(int board);
|
u16 GWBoardMaxCoinsGet(s32 board);
|
||||||
int GWBoardWinCountInc(int character, int board);
|
s32 GWBoardWinCountInc(s32 character, s32 board);
|
||||||
int GWBoardWinCountGet(int character, int board);
|
s32 GWBoardWinCountGet(s32 character, s32 board);
|
||||||
void GWBoardWinCountSet(int character, int board, int value);
|
void GWBoardWinCountSet(s32 character, s32 board, s32 value);
|
||||||
int GWMGAvailGet(int id);
|
s32 GWMGAvailGet(s32 id);
|
||||||
int GWMGAvailSet(int id);
|
s32 GWMGAvailSet(s32 id);
|
||||||
int GWMGCustomGet(int id);
|
s32 GWMGCustomGet(s32 id);
|
||||||
int GWMGCustomSet(int id);
|
s32 GWMGCustomSet(s32 id);
|
||||||
int GWMGCustomReset(int id);
|
s32 GWMGCustomReset(s32 id);
|
||||||
s16 GWCoinsGet(int player);
|
s16 GWCoinsGet(s32 player);
|
||||||
void GWCoinsSet(int player, s16 value);
|
void GWCoinsSet(s32 player, s16 value);
|
||||||
void GWCoinsAdd(int player, s16 amount);
|
void GWCoinsAdd(s32 player, s16 amount);
|
||||||
void GWStarsSet(int player, s16 value);
|
void GWStarsSet(s32 player, s16 value);
|
||||||
void GWStarsAdd(int player, s16 amount);
|
void GWStarsAdd(s32 player, s16 amount);
|
||||||
s32 GWStarsGet(int player);
|
s32 GWStarsGet(s32 player);
|
||||||
void GWTotalStarsSet(s16 value);
|
void GWTotalStarsSet(s16 value);
|
||||||
void GWTotalStarsAdd(s16 amount);
|
void GWTotalStarsAdd(s16 amount);
|
||||||
u16 GWTotalStarsGet(void);
|
u16 GWTotalStarsGet(void);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ typedef struct jump_buf {
|
||||||
double flt_regs[19];
|
double flt_regs[19];
|
||||||
} jmp_buf;
|
} jmp_buf;
|
||||||
|
|
||||||
int gcsetjmp(jmp_buf *jump);
|
s32 gcsetjmp(jmp_buf *jump);
|
||||||
int gclongjmp(jmp_buf *jump, int status);
|
s32 gclongjmp(jmp_buf *jump, s32 status);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ typedef void (*omObjFunc)(struct om_obj_data *);
|
||||||
|
|
||||||
typedef struct om_ovl_his_data {
|
typedef struct om_ovl_his_data {
|
||||||
OverlayID overlay;
|
OverlayID overlay;
|
||||||
int event;
|
s32 event;
|
||||||
int stat;
|
s32 stat;
|
||||||
} omOvlHisData;
|
} omOvlHisData;
|
||||||
|
|
||||||
typedef struct om_obj_data {
|
typedef struct om_obj_data {
|
||||||
|
|
@ -65,14 +65,14 @@ typedef struct om_dll_data {
|
||||||
s32 ret;
|
s32 ret;
|
||||||
} omDllData;
|
} omDllData;
|
||||||
|
|
||||||
void omMasterInit(int prio, FileListEntry *ovl_list, int ovl_count, OverlayID start_ovl);
|
void omMasterInit(s32 prio, FileListEntry *ovl_list, s32 ovl_count, OverlayID start_ovl);
|
||||||
void omOvlCallEx(OverlayID overlay, s16 arg2, int event, int stat);
|
void omOvlCallEx(OverlayID overlay, s16 arg2, s32 event, s32 stat);
|
||||||
void omOvlGotoEx(OverlayID overlay, s16 arg2, int event, int stat);
|
void omOvlGotoEx(OverlayID overlay, s16 arg2, s32 event, s32 stat);
|
||||||
void omOvlReturnEx(s16 level, s16 arg2);
|
void omOvlReturnEx(s16 level, s16 arg2);
|
||||||
void omOvlKill(s16 arg);
|
void omOvlKill(s16 arg);
|
||||||
void omOvlHisChg(s32 level, OverlayID overlay, int event, int stat);
|
void omOvlHisChg(s32 level, OverlayID overlay, s32 event, s32 stat);
|
||||||
omOvlHisData *omOvlHisGet(s32 level);
|
omOvlHisData *omOvlHisGet(s32 level);
|
||||||
Process *omInitObjMan(s16 max_objs, int prio);
|
Process *omInitObjMan(s16 max_objs, s32 prio);
|
||||||
void omDestroyObjMan(void);
|
void omDestroyObjMan(void);
|
||||||
omObjData *omAddObjEx(Process *objman_process, s16 prio, u16 mdlcnt, u16 mtncnt, s16 group, omObjFunc func);
|
omObjData *omAddObjEx(Process *objman_process, s16 prio, u16 mdlcnt, u16 mtncnt, s16 group, omObjFunc func);
|
||||||
void omAddMember(Process *objman_process, u16 group, omObjData *object);
|
void omAddMember(Process *objman_process, u16 group, omObjData *object);
|
||||||
|
|
@ -93,7 +93,7 @@ OverlayID omCurrentOvlGet(void);
|
||||||
|
|
||||||
void omDLLDBGOut(void);
|
void omDLLDBGOut(void);
|
||||||
void omDLLInit(FileListEntry *ovl_list);
|
void omDLLInit(FileListEntry *ovl_list);
|
||||||
int omDLLStart(s16 overlay, s16 flag);
|
s32 omDLLStart(s16 overlay, s16 flag);
|
||||||
void omDLLNumEnd(s16 overlay, s16 flag);
|
void omDLLNumEnd(s16 overlay, s16 flag);
|
||||||
void omDLLEnd(s16 dllno, s16 flag);
|
void omDLLEnd(s16 dllno, s16 flag);
|
||||||
omDllData *omDLLLink(omDllData **dll_ptr, s16 overlay, s16 flag);
|
omDllData *omDLLLink(omDllData **dll_ptr, s16 overlay, s16 flag);
|
||||||
|
|
@ -113,11 +113,11 @@ extern omObjData *omDBGSysKeyObj;
|
||||||
extern Process *omwatchproc;
|
extern Process *omwatchproc;
|
||||||
extern OverlayID omnextovl;
|
extern OverlayID omnextovl;
|
||||||
extern OverlayID omcurovl;
|
extern OverlayID omcurovl;
|
||||||
extern int omcurdll;
|
extern s32 omcurdll;
|
||||||
extern int omovlhisidx;
|
extern s32 omovlhisidx;
|
||||||
extern int omovlevtno;
|
extern s32 omovlevtno;
|
||||||
extern int omnextovlevtno;
|
extern s32 omnextovlevtno;
|
||||||
extern int omovlstat;
|
extern s32 omovlstat;
|
||||||
extern char omUPauseFlag;
|
extern char omUPauseFlag;
|
||||||
extern s16 omSysExitReq;
|
extern s16 omSysExitReq;
|
||||||
extern s16 omdispinfo;
|
extern s16 omdispinfo;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ typedef struct process {
|
||||||
u16 exec;
|
u16 exec;
|
||||||
u16 stat;
|
u16 stat;
|
||||||
u16 prio;
|
u16 prio;
|
||||||
int sleep_time;
|
s32 sleep_time;
|
||||||
u32 base_sp;
|
u32 base_sp;
|
||||||
jmp_buf jump;
|
jmp_buf jump;
|
||||||
void (*dtor)(void);
|
void (*dtor)(void);
|
||||||
|
|
@ -35,19 +35,19 @@ void HuPrcChildUnlink(Process *process);
|
||||||
Process *HuPrcChildCreate(void (*func)(void), u16 prio, u32 stack_size, s32 extra_size, Process *parent);
|
Process *HuPrcChildCreate(void (*func)(void), u16 prio, u32 stack_size, s32 extra_size, Process *parent);
|
||||||
void HuPrcChildWatch(void);
|
void HuPrcChildWatch(void);
|
||||||
Process *HuPrcCurrentGet(void);
|
Process *HuPrcCurrentGet(void);
|
||||||
int HuPrcKill(Process *process);
|
s32 HuPrcKill(Process *process);
|
||||||
void HuPrcChildKill(Process *process);
|
void HuPrcChildKill(Process *process);
|
||||||
void HuPrcSleep(int time);
|
void HuPrcSleep(s32 time);
|
||||||
void HuPrcVSleep();
|
void HuPrcVSleep();
|
||||||
void HuPrcWakeup(Process *process);
|
void HuPrcWakeup(Process *process);
|
||||||
void HuPrcDestructorSet2(Process *process, void (*func)(void));
|
void HuPrcDestructorSet2(Process *process, void (*func)(void));
|
||||||
void HuPrcDestructorSet(void (*func)(void));
|
void HuPrcDestructorSet(void (*func)(void));
|
||||||
void HuPrcCall(int tick);
|
void HuPrcCall(s32 tick);
|
||||||
void *HuPrcMemAlloc(s32 size);
|
void *HuPrcMemAlloc(s32 size);
|
||||||
void HuPrcMemFree(void *ptr);
|
void HuPrcMemFree(void *ptr);
|
||||||
void HuPrcSetStat(Process *process, u16 value);
|
void HuPrcSetStat(Process *process, u16 value);
|
||||||
void HuPrcResetStat(Process *process, u16 value);
|
void HuPrcResetStat(Process *process, u16 value);
|
||||||
void HuPrcAllPause(int flag);
|
void HuPrcAllPause(s32 flag);
|
||||||
void HuPrcAllUPause(int flag);
|
void HuPrcAllUPause(s32 flag);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -5,7 +5,7 @@ static void InitBoard(void) {
|
||||||
BoardCommonInit(BoardCreate, BoardDestroy);
|
BoardCommonInit(BoardCreate, BoardDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _prolog(void) {
|
s32 _prolog(void) {
|
||||||
const VoidFunc* ctors = _ctors;
|
const VoidFunc* ctors = _ctors;
|
||||||
while (*ctors != 0) {
|
while (*ctors != 0) {
|
||||||
(**ctors)();
|
(**ctors)();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include "REL/executor.h"
|
#include "REL/executor.h"
|
||||||
|
|
||||||
int _prolog(void) {
|
s32 _prolog(void) {
|
||||||
const VoidFunc* ctors = _ctors;
|
const VoidFunc* ctors = _ctors;
|
||||||
while (*ctors != 0) {
|
while (*ctors != 0) {
|
||||||
(**ctors)();
|
(**ctors)();
|
||||||
|
|
|
||||||
|
|
@ -453,7 +453,7 @@ void fn_1_EC(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int _prolog(void) {
|
s32 _prolog(void) {
|
||||||
const VoidFunc* ctors = _ctors;
|
const VoidFunc* ctors = _ctors;
|
||||||
while (*ctors != 0) {
|
while (*ctors != 0) {
|
||||||
(**ctors)();
|
(**ctors)();
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ static DataReadStat ATTRIBUTE_ALIGN(32) ReadDataStat[DATA_MAX_READSTAT];
|
||||||
|
|
||||||
void HuDataInit(void)
|
void HuDataInit(void)
|
||||||
{
|
{
|
||||||
int i = 0;
|
s32 i = 0;
|
||||||
FileListEntry *dir_stat = DataDirStat;
|
FileListEntry *dir_stat = DataDirStat;
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
while(dir_stat->name) {
|
while(dir_stat->name) {
|
||||||
|
|
@ -45,9 +45,9 @@ void HuDataInit(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HuDataReadStatusGet(void)
|
static s32 HuDataReadStatusGet(void)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
||||||
if(ReadDataStat[i].dir_id == -1) {
|
if(ReadDataStat[i].dir_id == -1) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -59,9 +59,9 @@ static int HuDataReadStatusGet(void)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int HuDataReadChk(s32 data_num)
|
s32 HuDataReadChk(s32 data_num)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
data_num >>= 16;
|
data_num >>= 16;
|
||||||
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
||||||
if(ReadDataStat[i].dir_id == data_num && ReadDataStat[i].status != 1) {
|
if(ReadDataStat[i].dir_id == data_num && ReadDataStat[i].status != 1) {
|
||||||
|
|
@ -76,7 +76,7 @@ int HuDataReadChk(s32 data_num)
|
||||||
|
|
||||||
DataReadStat *HuDataGetStatus(void *dir_ptr)
|
DataReadStat *HuDataGetStatus(void *dir_ptr)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
||||||
if(ReadDataStat[i].dir == dir_ptr) {
|
if(ReadDataStat[i].dir == dir_ptr) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -90,7 +90,7 @@ DataReadStat *HuDataGetStatus(void *dir_ptr)
|
||||||
|
|
||||||
void *HuDataGetDirPtr(s32 data_num)
|
void *HuDataGetDirPtr(s32 data_num)
|
||||||
{
|
{
|
||||||
int status = HuDataReadChk(data_num);
|
s32 status = HuDataReadChk(data_num);
|
||||||
if(status < 0) {
|
if(status < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -100,7 +100,7 @@ void *HuDataGetDirPtr(s32 data_num)
|
||||||
DataReadStat *HuDataDirRead(s32 data_num)
|
DataReadStat *HuDataDirRead(s32 data_num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
s32 dir_id;
|
s32 dir_id;
|
||||||
dir_id = data_num >> 16;
|
dir_id = data_num >> 16;
|
||||||
if(DataDirMax <= dir_id) {
|
if(DataDirMax <= dir_id) {
|
||||||
|
|
@ -135,7 +135,7 @@ DataReadStat *HuDataDirRead(s32 data_num)
|
||||||
static DataReadStat *HuDataDirReadNum(s32 data_num, s32 num)
|
static DataReadStat *HuDataDirReadNum(s32 data_num, s32 num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
s32 dir_id;
|
s32 dir_id;
|
||||||
dir_id = data_num >> 16;
|
dir_id = data_num >> 16;
|
||||||
if(DataDirMax <= dir_id) {
|
if(DataDirMax <= dir_id) {
|
||||||
|
|
@ -176,7 +176,7 @@ static DataReadStat *HuDataDirReadNum(s32 data_num, s32 num)
|
||||||
DataReadStat *HuDataDirSet(void *dir_ptr, s32 data_num)
|
DataReadStat *HuDataDirSet(void *dir_ptr, s32 data_num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat = HuDataGetStatus(dir_ptr);
|
DataReadStat *read_stat = HuDataGetStatus(dir_ptr);
|
||||||
int status;
|
s32 status;
|
||||||
if((status = HuDataReadChk(read_stat->dir_id << 16)) >= 0) {
|
if((status = HuDataReadChk(read_stat->dir_id << 16)) >= 0) {
|
||||||
HuDataDirClose(data_num);
|
HuDataDirClose(data_num);
|
||||||
}
|
}
|
||||||
|
|
@ -194,7 +194,7 @@ DataReadStat *HuDataDirSet(void *dir_ptr, s32 data_num)
|
||||||
void HuDataDirReadAsyncCallBack(s32 result, DVDFileInfo* fileInfo)
|
void HuDataDirReadAsyncCallBack(s32 result, DVDFileInfo* fileInfo)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int i;
|
s32 i;
|
||||||
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
||||||
if(ReadDataStat[i].status == 1 && ReadDataStat[i].file_info.startAddr == fileInfo->startAddr) {
|
if(ReadDataStat[i].status == 1 && ReadDataStat[i].file_info.startAddr == fileInfo->startAddr) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -211,7 +211,7 @@ void HuDataDirReadAsyncCallBack(s32 result, DVDFileInfo* fileInfo)
|
||||||
s32 HuDataDirReadAsync(s32 data_num)
|
s32 HuDataDirReadAsync(s32 data_num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
s32 dir_id;
|
s32 dir_id;
|
||||||
dir_id = data_num >> 16;
|
dir_id = data_num >> 16;
|
||||||
if(DataDirMax <= dir_id) {
|
if(DataDirMax <= dir_id) {
|
||||||
|
|
@ -244,7 +244,7 @@ s32 HuDataDirReadAsync(s32 data_num)
|
||||||
s32 HuDataDirReadNumAsync(s32 data_num, s32 num)
|
s32 HuDataDirReadNumAsync(s32 data_num, s32 num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
s32 dir_id;
|
s32 dir_id;
|
||||||
dir_id = data_num >> 16;
|
dir_id = data_num >> 16;
|
||||||
if(DataDirMax <= dir_id) {
|
if(DataDirMax <= dir_id) {
|
||||||
|
|
@ -291,7 +291,7 @@ static void GetFileInfo(DataReadStat *read_stat, s32 file_num)
|
||||||
void *HuDataRead(s32 data_num)
|
void *HuDataRead(s32 data_num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
void *buf;
|
void *buf;
|
||||||
if(!HuDataDirRead(data_num)) {
|
if(!HuDataDirRead(data_num)) {
|
||||||
(void)data_num;
|
(void)data_num;
|
||||||
|
|
@ -312,7 +312,7 @@ void *HuDataRead(s32 data_num)
|
||||||
void *HuDataReadNum(s32 data_num, s32 num)
|
void *HuDataReadNum(s32 data_num, s32 num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
void *buf;
|
void *buf;
|
||||||
if(!HuDataDirReadNum(data_num, num)) {
|
if(!HuDataDirReadNum(data_num, num)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -332,7 +332,7 @@ void *HuDataReadNum(s32 data_num, s32 num)
|
||||||
void *HuDataSelHeapRead(s32 data_num, HeapID heap)
|
void *HuDataSelHeapRead(s32 data_num, HeapID heap)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
void *buf;
|
void *buf;
|
||||||
if(!HuDataDirRead(data_num)) {
|
if(!HuDataDirRead(data_num)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -368,7 +368,7 @@ void *HuDataSelHeapRead(s32 data_num, HeapID heap)
|
||||||
void *HuDataSelHeapReadNum(s32 data_num, s32 num, HeapID heap)
|
void *HuDataSelHeapReadNum(s32 data_num, s32 num, HeapID heap)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
void *buf;
|
void *buf;
|
||||||
if(!HuDataDirReadNum(data_num, num)) {
|
if(!HuDataDirReadNum(data_num, num)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -412,7 +412,7 @@ static void **HuDataReadMultiSub(s32 *data_ids, BOOL use_num, s32 num)
|
||||||
char **paths;
|
char **paths;
|
||||||
void **dir_ptrs;
|
void **dir_ptrs;
|
||||||
void **out_ptrs;
|
void **out_ptrs;
|
||||||
int i, count, total_files;
|
s32 i, count, total_files;
|
||||||
u32 dir_id;
|
u32 dir_id;
|
||||||
for(i=0, count=0; data_ids[i] != -1; i++) {
|
for(i=0, count=0; data_ids[i] != -1; i++) {
|
||||||
dir_id = data_ids[i] >> 16;
|
dir_id = data_ids[i] >> 16;
|
||||||
|
|
@ -433,7 +433,7 @@ static void **HuDataReadMultiSub(s32 *data_ids, BOOL use_num, s32 num)
|
||||||
for(i=0, count=0; data_ids[i] != -1; i++) {
|
for(i=0, count=0; data_ids[i] != -1; i++) {
|
||||||
dir_id = data_ids[i] >> 16;
|
dir_id = data_ids[i] >> 16;
|
||||||
if(HuDataReadChk(data_ids[i]) < 0) {
|
if(HuDataReadChk(data_ids[i]) < 0) {
|
||||||
int j;
|
s32 j;
|
||||||
for(j=0; dir_ids[j] != -1; j++) {
|
for(j=0; dir_ids[j] != -1; j++) {
|
||||||
if(dir_ids[j] == dir_id){
|
if(dir_ids[j] == dir_id){
|
||||||
break;
|
break;
|
||||||
|
|
@ -481,7 +481,7 @@ static void **HuDataReadMultiSub(s32 *data_ids, BOOL use_num, s32 num)
|
||||||
s32 HuDataGetSize(s32 data_num)
|
s32 HuDataGetSize(s32 data_num)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int status;
|
s32 status;
|
||||||
if((status = HuDataReadChk(data_num)) == -1) {
|
if((status = HuDataReadChk(data_num)) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -499,7 +499,7 @@ void HuDataClose(void *ptr)
|
||||||
|
|
||||||
void HuDataCloseMulti(void **ptrs)
|
void HuDataCloseMulti(void **ptrs)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
for(i=0; ptrs[i]; i++) {
|
for(i=0; ptrs[i]; i++) {
|
||||||
void *ptr = ptrs[i];
|
void *ptr = ptrs[i];
|
||||||
if(ptr) {
|
if(ptr) {
|
||||||
|
|
@ -514,7 +514,7 @@ void HuDataCloseMulti(void **ptrs)
|
||||||
void HuDataDirClose(s32 data_id)
|
void HuDataDirClose(s32 data_id)
|
||||||
{
|
{
|
||||||
DataReadStat *read_stat;
|
DataReadStat *read_stat;
|
||||||
int i;
|
s32 i;
|
||||||
s32 dir_id = data_id >> 16;
|
s32 dir_id = data_id >> 16;
|
||||||
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
||||||
if(ReadDataStat[i].dir_id == dir_id) {
|
if(ReadDataStat[i].dir_id == dir_id) {
|
||||||
|
|
@ -537,7 +537,7 @@ void HuDataDirClose(s32 data_id)
|
||||||
|
|
||||||
void HuDataDirCloseNum(s32 num)
|
void HuDataDirCloseNum(s32 num)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
for(i=0; i<DATA_MAX_READSTAT; i++) {
|
||||||
if(ReadDataStat[i].used == TRUE && ReadDataStat[i].num == num) {
|
if(ReadDataStat[i].used == TRUE && ReadDataStat[i].num == num) {
|
||||||
HuDataDirClose(ReadDataStat[i].dir_id << 16);
|
HuDataDirClose(ReadDataStat[i].dir_id << 16);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ static void HuDecodeNone(struct decode_data *decode)
|
||||||
static void HuDecodeLz(struct decode_data *decode)
|
static void HuDecodeLz(struct decode_data *decode)
|
||||||
{
|
{
|
||||||
u16 flag, pos;
|
u16 flag, pos;
|
||||||
int i, j, copy_len;
|
s32 i, j, copy_len;
|
||||||
flag = 0;
|
flag = 0;
|
||||||
pos = 958;
|
pos = 958;
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ static void HuDecodeLz(struct decode_data *decode)
|
||||||
|
|
||||||
static inline void SlideReadHeader(struct decode_data *decode)
|
static inline void SlideReadHeader(struct decode_data *decode)
|
||||||
{
|
{
|
||||||
int size;
|
s32 size;
|
||||||
size = (*decode->src++) << 24;
|
size = (*decode->src++) << 24;
|
||||||
size += (*decode->src++) << 16;
|
size += (*decode->src++) << 16;
|
||||||
size += (*decode->src++) << 8;
|
size += (*decode->src++) << 8;
|
||||||
|
|
@ -78,7 +78,7 @@ static void HuDecodeSlide(struct decode_data *decode)
|
||||||
num_bits = 32;
|
num_bits = 32;
|
||||||
}
|
}
|
||||||
if(flag >> 31) {
|
if(flag >> 31) {
|
||||||
*decode->dst++ = (int)*decode->src++;
|
*decode->dst++ = (s32)*decode->src++;
|
||||||
decode->size--;
|
decode->size--;
|
||||||
} else {
|
} else {
|
||||||
u8 *src;
|
u8 *src;
|
||||||
|
|
@ -125,7 +125,7 @@ static void HuDecodeFslide(struct decode_data *decode)
|
||||||
num_bits = 32;
|
num_bits = 32;
|
||||||
}
|
}
|
||||||
if(flag >> 31) {
|
if(flag >> 31) {
|
||||||
*decode->dst++ = (int)*decode->src++;
|
*decode->dst++ = (s32)*decode->src++;
|
||||||
decode->size--;
|
decode->size--;
|
||||||
} else {
|
} else {
|
||||||
u8 *src;
|
u8 *src;
|
||||||
|
|
@ -155,11 +155,11 @@ static void HuDecodeFslide(struct decode_data *decode)
|
||||||
|
|
||||||
static void HuDecodeRle(struct decode_data *decode)
|
static void HuDecodeRle(struct decode_data *decode)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
while(decode->size) {
|
while(decode->size) {
|
||||||
int size = *decode->src++;
|
s32 size = *decode->src++;
|
||||||
if(size < 128) {
|
if(size < 128) {
|
||||||
int fill = *decode->src++;
|
s32 fill = *decode->src++;
|
||||||
for(i=0; i<size; i++) {
|
for(i=0; i<size; i++) {
|
||||||
*decode->dst++ = fill;
|
*decode->dst++ = fill;
|
||||||
}
|
}
|
||||||
|
|
@ -173,7 +173,7 @@ static void HuDecodeRle(struct decode_data *decode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuDecodeData(void *src, void *dst, u32 size, int decode_type)
|
void HuDecodeData(void *src, void *dst, u32 size, s32 decode_type)
|
||||||
{
|
{
|
||||||
struct decode_data decode;
|
struct decode_data decode;
|
||||||
struct decode_data *decode_ptr = &decode;
|
struct decode_data *decode_ptr = &decode;
|
||||||
|
|
|
||||||
|
|
@ -147,19 +147,19 @@ s32 GWMessDelayGet(void)
|
||||||
return GWSystem.mess_delay;
|
return GWSystem.mess_delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWMGRecordSet(int index, s32 value)
|
void GWMGRecordSet(s32 index, s32 value)
|
||||||
{
|
{
|
||||||
if(!_CheckFlag(FLAG_ID_MAKE(1, 12))) {
|
if(!_CheckFlag(FLAG_ID_MAKE(1, 12))) {
|
||||||
GWGameStat.mg_record[index] = value;
|
GWGameStat.mg_record[index] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 GWMGRecordGet(int index)
|
s32 GWMGRecordGet(s32 index)
|
||||||
{
|
{
|
||||||
return GWGameStat.mg_record[index];
|
return GWGameStat.mg_record[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWCharColorGet(int character, GXColor *color)
|
void GWCharColorGet(s32 character, GXColor *color)
|
||||||
{
|
{
|
||||||
GXColor char_color[] = {
|
GXColor char_color[] = {
|
||||||
{ 227, 67, 67, 255 },
|
{ 227, 67, 67, 255 },
|
||||||
|
|
@ -174,7 +174,7 @@ void GWCharColorGet(int character, GXColor *color)
|
||||||
*color = char_color[character];
|
*color = char_color[character];
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWBoardPlayCountSet(int board, u8 value)
|
void GWBoardPlayCountSet(s32 board, u8 value)
|
||||||
{
|
{
|
||||||
if(value > 99) {
|
if(value > 99) {
|
||||||
value = 99;
|
value = 99;
|
||||||
|
|
@ -182,7 +182,7 @@ void GWBoardPlayCountSet(int board, u8 value)
|
||||||
GWGameStat.board_play_count[board] = value;
|
GWGameStat.board_play_count[board] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWBoardPlayCountAdd(int board, u8 value)
|
void GWBoardPlayCountAdd(s32 board, u8 value)
|
||||||
{
|
{
|
||||||
value += GWGameStat.board_play_count[board];
|
value += GWGameStat.board_play_count[board];
|
||||||
if(value > 99) {
|
if(value > 99) {
|
||||||
|
|
@ -192,34 +192,34 @@ void GWBoardPlayCountAdd(int board, u8 value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
u8 GWBoardPlayCountGet(int board)
|
u8 GWBoardPlayCountGet(s32 board)
|
||||||
{
|
{
|
||||||
return GWGameStat.board_play_count[board];
|
return GWGameStat.board_play_count[board];
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWBoardMaxStarsSet(int board, int value)
|
void GWBoardMaxStarsSet(s32 board, s32 value)
|
||||||
{
|
{
|
||||||
GWGameStat.board_max_stars[board] = value;
|
GWGameStat.board_max_stars[board] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 GWBoardMaxStarsGet(int board)
|
u16 GWBoardMaxStarsGet(s32 board)
|
||||||
{
|
{
|
||||||
return GWGameStat.board_max_stars[board];
|
return GWGameStat.board_max_stars[board];
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWBoardMaxCoinsSet(int board, int value)
|
void GWBoardMaxCoinsSet(s32 board, s32 value)
|
||||||
{
|
{
|
||||||
GWGameStat.board_max_coins[board] = value;
|
GWGameStat.board_max_coins[board] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 GWBoardMaxCoinsGet(int board)
|
u16 GWBoardMaxCoinsGet(s32 board)
|
||||||
{
|
{
|
||||||
return GWGameStat.board_max_coins[board];
|
return GWGameStat.board_max_coins[board];
|
||||||
}
|
}
|
||||||
|
|
||||||
int GWBoardWinCountInc(int character, int board)
|
s32 GWBoardWinCountInc(s32 character, s32 board)
|
||||||
{
|
{
|
||||||
int win_count = GWGameStat.board_win_count[board][character]+1;
|
s32 win_count = GWGameStat.board_win_count[board][character]+1;
|
||||||
if(win_count > 99) {
|
if(win_count > 99) {
|
||||||
win_count = 99;
|
win_count = 99;
|
||||||
}
|
}
|
||||||
|
|
@ -227,20 +227,20 @@ int GWBoardWinCountInc(int character, int board)
|
||||||
return win_count;
|
return win_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GWBoardWinCountGet(int character, int board)
|
s32 GWBoardWinCountGet(s32 character, s32 board)
|
||||||
{
|
{
|
||||||
return GWGameStat.board_win_count[board][character];
|
return GWGameStat.board_win_count[board][character];
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWBoardWinCountSet(int character, int board, int value)
|
void GWBoardWinCountSet(s32 character, s32 board, s32 value)
|
||||||
{
|
{
|
||||||
GWGameStat.board_win_count[board][character] = value;
|
GWGameStat.board_win_count[board][character] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GWMGAvailGet(int id)
|
s32 GWMGAvailGet(s32 id)
|
||||||
{
|
{
|
||||||
int word;
|
s32 word;
|
||||||
int bit;
|
s32 bit;
|
||||||
id -= 401;
|
id -= 401;
|
||||||
word = id >> 5;
|
word = id >> 5;
|
||||||
bit = id % 32;
|
bit = id % 32;
|
||||||
|
|
@ -251,20 +251,20 @@ int GWMGAvailGet(int id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GWMGAvailSet(int id)
|
s32 GWMGAvailSet(s32 id)
|
||||||
{
|
{
|
||||||
int word;
|
s32 word;
|
||||||
int bit;
|
s32 bit;
|
||||||
id -= 401;
|
id -= 401;
|
||||||
word = id >> 5;
|
word = id >> 5;
|
||||||
bit = id % 32;
|
bit = id % 32;
|
||||||
GWGameStat.mg_avail[word] |= (1 << bit);
|
GWGameStat.mg_avail[word] |= (1 << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GWMGCustomGet(int id)
|
s32 GWMGCustomGet(s32 id)
|
||||||
{
|
{
|
||||||
int word;
|
s32 word;
|
||||||
int bit;
|
s32 bit;
|
||||||
id -= 401;
|
id -= 401;
|
||||||
word = id >> 5;
|
word = id >> 5;
|
||||||
bit = id % 32;
|
bit = id % 32;
|
||||||
|
|
@ -275,32 +275,32 @@ int GWMGCustomGet(int id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GWMGCustomSet(int id)
|
s32 GWMGCustomSet(s32 id)
|
||||||
{
|
{
|
||||||
int word;
|
s32 word;
|
||||||
int bit;
|
s32 bit;
|
||||||
id -= 401;
|
id -= 401;
|
||||||
word = id >> 5;
|
word = id >> 5;
|
||||||
bit = id % 32;
|
bit = id % 32;
|
||||||
GWGameStat.mg_custom[word] |= (1 << bit);
|
GWGameStat.mg_custom[word] |= (1 << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GWMGCustomReset(int id)
|
s32 GWMGCustomReset(s32 id)
|
||||||
{
|
{
|
||||||
int word;
|
s32 word;
|
||||||
int bit;
|
s32 bit;
|
||||||
id -= 401;
|
id -= 401;
|
||||||
word = id >> 5;
|
word = id >> 5;
|
||||||
bit = id % 32;
|
bit = id % 32;
|
||||||
GWGameStat.mg_custom[word] &= ~(1 << bit);
|
GWGameStat.mg_custom[word] &= ~(1 << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
s16 GWCoinsGet(int player)
|
s16 GWCoinsGet(s32 player)
|
||||||
{
|
{
|
||||||
return GWPlayer[player].coins;
|
return GWPlayer[player].coins;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWCoinsSet(int player, s16 value)
|
void GWCoinsSet(s32 player, s16 value)
|
||||||
{
|
{
|
||||||
if(!_CheckFlag(FLAG_ID_MAKE(1, 12))) {
|
if(!_CheckFlag(FLAG_ID_MAKE(1, 12))) {
|
||||||
if(value < 0) {
|
if(value < 0) {
|
||||||
|
|
@ -316,12 +316,12 @@ void GWCoinsSet(int player, s16 value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWCoinsAdd(int player, s16 amount)
|
void GWCoinsAdd(s32 player, s16 amount)
|
||||||
{
|
{
|
||||||
GWCoinsSet(player, GWPlayer[player].coins+amount);
|
GWCoinsSet(player, GWPlayer[player].coins+amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWStarsSet(int player, s16 value)
|
void GWStarsSet(s32 player, s16 value)
|
||||||
{
|
{
|
||||||
if(value < 0) {
|
if(value < 0) {
|
||||||
value = 0;
|
value = 0;
|
||||||
|
|
@ -335,12 +335,12 @@ void GWStarsSet(int player, s16 value)
|
||||||
GWPlayer[player].stars = value;
|
GWPlayer[player].stars = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWStarsAdd(int player, s16 amount)
|
void GWStarsAdd(s32 player, s16 amount)
|
||||||
{
|
{
|
||||||
GWStarsSet(player, GWPlayer[player].stars+amount);
|
GWStarsSet(player, GWPlayer[player].stars+amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 GWStarsGet(int player)
|
s32 GWStarsGet(s32 player)
|
||||||
{
|
{
|
||||||
return GWPlayer[player].stars;
|
return GWPlayer[player].stars;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ void HuSysBeforeRender()
|
||||||
|
|
||||||
void HuSysDoneRender(s32 retrace_count)
|
void HuSysDoneRender(s32 retrace_count)
|
||||||
{
|
{
|
||||||
int retrace_dist;
|
s32 retrace_dist;
|
||||||
if(DemoStatEnable) {
|
if(DemoStatEnable) {
|
||||||
GXDrawDone();
|
GXDrawDone();
|
||||||
DEMOUpdateStats(1);
|
DEMOUpdateStats(1);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include "game/jmp.h"
|
#include "game/jmp.h"
|
||||||
|
|
||||||
int gcsetjmp(register jmp_buf *jump) {
|
s32 gcsetjmp(register jmp_buf *jump) {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
asm {
|
asm {
|
||||||
mflr r5
|
mflr r5
|
||||||
|
|
@ -36,7 +36,7 @@ int gcsetjmp(register jmp_buf *jump) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
asm int gclongjmp(register jmp_buf *jump, register int status) {
|
asm s32 gclongjmp(register jmp_buf *jump, register s32 status) {
|
||||||
nofralloc
|
nofralloc
|
||||||
lwz r5, jump->lr
|
lwz r5, jump->lr
|
||||||
lwz r6, jump->cr
|
lwz r6, jump->cr
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ void omDLLDBGOut(void)
|
||||||
|
|
||||||
void omDLLInit(FileListEntry *ovl_list)
|
void omDLLInit(FileListEntry *ovl_list)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
OSReport("DLL DBG OUT\n");
|
OSReport("DLL DBG OUT\n");
|
||||||
for(i=0; i<OM_DLL_MAX; i++) {
|
for(i=0; i<OM_DLL_MAX; i++) {
|
||||||
omDLLinfoTbl[i] = NULL;
|
omDLLinfoTbl[i] = NULL;
|
||||||
|
|
@ -24,9 +24,9 @@ void omDLLInit(FileListEntry *ovl_list)
|
||||||
omDLLFileList = ovl_list;
|
omDLLFileList = ovl_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
int omDLLStart(s16 overlay, s16 flag)
|
s32 omDLLStart(s16 overlay, s16 flag)
|
||||||
{
|
{
|
||||||
int dllno;
|
s32 dllno;
|
||||||
OSReport("DLLStart %d %d\n", overlay, flag);
|
OSReport("DLLStart %d %d\n", overlay, flag);
|
||||||
dllno = omDLLSearch(overlay);
|
dllno = omDLLSearch(overlay);
|
||||||
if(dllno >= 0 && !flag) {
|
if(dllno >= 0 && !flag) {
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,12 @@ omObjData *omDBGSysKeyObj;
|
||||||
Process *omwatchproc;
|
Process *omwatchproc;
|
||||||
OverlayID omnextovl;
|
OverlayID omnextovl;
|
||||||
OverlayID omcurovl;
|
OverlayID omcurovl;
|
||||||
int omcurdll;
|
s32 omcurdll;
|
||||||
int omovlhisidx;
|
s32 omovlhisidx;
|
||||||
int omovlevtno;
|
s32 omovlevtno;
|
||||||
int omnextovlevtno;
|
s32 omnextovlevtno;
|
||||||
int omovlstat;
|
s32 omovlstat;
|
||||||
static int omnextovlstat;
|
static s32 omnextovlstat;
|
||||||
char omUPauseFlag;
|
char omUPauseFlag;
|
||||||
s16 omSysExitReq;
|
s16 omSysExitReq;
|
||||||
s16 omdispinfo;
|
s16 omdispinfo;
|
||||||
|
|
@ -52,7 +52,7 @@ OverlayID omprevovl = OVL_INVALID;
|
||||||
static void omWatchOverlayProc(void);
|
static void omWatchOverlayProc(void);
|
||||||
static void omInsertObj(Process *objman_process, omObjData *object);
|
static void omInsertObj(Process *objman_process, omObjData *object);
|
||||||
|
|
||||||
void omMasterInit(int prio, FileListEntry *ovl_list, int ovl_count, OverlayID start_ovl)
|
void omMasterInit(s32 prio, FileListEntry *ovl_list, s32 ovl_count, OverlayID start_ovl)
|
||||||
{
|
{
|
||||||
omDLLInit(ovl_list);
|
omDLLInit(ovl_list);
|
||||||
omwatchproc = HuPrcCreate(omWatchOverlayProc, prio, 8192, 0);
|
omwatchproc = HuPrcCreate(omWatchOverlayProc, prio, 8192, 0);
|
||||||
|
|
@ -106,7 +106,7 @@ static void omWatchOverlayProc(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void omOvlCallEx(OverlayID overlay, s16 arg2, int event, int stat)
|
void omOvlCallEx(OverlayID overlay, s16 arg2, s32 event, s32 stat)
|
||||||
{
|
{
|
||||||
OSReport("objman>Call New Ovl %d(%d)\n", overlay, arg2);
|
OSReport("objman>Call New Ovl %d(%d)\n", overlay, arg2);
|
||||||
if(omovlhisidx >= OM_OVL_HIS_MAX) {
|
if(omovlhisidx >= OM_OVL_HIS_MAX) {
|
||||||
|
|
@ -119,7 +119,7 @@ void omOvlCallEx(OverlayID overlay, s16 arg2, int event, int stat)
|
||||||
omOvlGotoEx(overlay, arg2, event, stat);
|
omOvlGotoEx(overlay, arg2, event, stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void omOvlGotoEx(OverlayID overlay, s16 arg2, int event, int stat)
|
void omOvlGotoEx(OverlayID overlay, s16 arg2, s32 event, s32 stat)
|
||||||
{
|
{
|
||||||
omprevovl = omcurovl;
|
omprevovl = omcurovl;
|
||||||
if(omcurovl >= 0) {
|
if(omcurovl >= 0) {
|
||||||
|
|
@ -162,7 +162,7 @@ void omOvlKill(s16 arg)
|
||||||
omDBGSysKeyObj = NULL;
|
omDBGSysKeyObj = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void omOvlHisChg(s32 level, OverlayID overlay, int event, int stat)
|
void omOvlHisChg(s32 level, OverlayID overlay, s32 event, s32 stat)
|
||||||
{
|
{
|
||||||
omOvlHisData *history;
|
omOvlHisData *history;
|
||||||
if(omovlhisidx-level < 0 || omovlhisidx-level >= OM_OVL_HIS_MAX) {
|
if(omovlhisidx-level < 0 || omovlhisidx-level >= OM_OVL_HIS_MAX) {
|
||||||
|
|
@ -184,12 +184,12 @@ omOvlHisData *omOvlHisGet(s32 level)
|
||||||
return &omovlhis[omovlhisidx-level];
|
return &omovlhis[omovlhisidx-level];
|
||||||
}
|
}
|
||||||
|
|
||||||
Process *omInitObjMan(s16 max_objs, int prio)
|
Process *omInitObjMan(s16 max_objs, s32 prio)
|
||||||
{
|
{
|
||||||
omObjGroup *group_all;
|
omObjGroup *group_all;
|
||||||
omObjData *obj_all;
|
omObjData *obj_all;
|
||||||
omObjData *obj;
|
omObjData *obj;
|
||||||
int i;
|
s32 i;
|
||||||
omObjMan *objman;
|
omObjMan *objman;
|
||||||
Process *process;
|
Process *process;
|
||||||
OSReport("objman>InitObjMan start\n");
|
OSReport("objman>InitObjMan start\n");
|
||||||
|
|
@ -245,7 +245,7 @@ void omDestroyObjMan(void)
|
||||||
|
|
||||||
omObjData *omAddObjEx(Process *objman_process, s16 prio, u16 mdlcnt, u16 mtncnt, s16 group, void (*func)(omObjData *))
|
omObjData *omAddObjEx(Process *objman_process, s16 prio, u16 mdlcnt, u16 mtncnt, s16 group, void (*func)(omObjData *))
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
omObjData *object;
|
omObjData *object;
|
||||||
s16 next_idx;
|
s16 next_idx;
|
||||||
omObjMan *objman = objman_process->user_data;
|
omObjMan *objman = objman_process->user_data;
|
||||||
|
|
@ -408,7 +408,7 @@ void omDelMember(Process *objman_process, omObjData *object)
|
||||||
|
|
||||||
void omMakeGroupEx(Process *objman_process, u16 group, u16 max_objs)
|
void omMakeGroupEx(Process *objman_process, u16 group, u16 max_objs)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
omObjMan *objman = objman_process->user_data;
|
omObjMan *objman = objman_process->user_data;
|
||||||
omObjGroup *group_ptr = &objman->group[group];
|
omObjGroup *group_ptr = &objman->group[group];
|
||||||
if(group_ptr->obj != NULL) {
|
if(group_ptr->obj != NULL) {
|
||||||
|
|
@ -521,7 +521,7 @@ static void omDumpObj(Process *objman_process)
|
||||||
{
|
{
|
||||||
omObjMan *objman = objman_process->user_data;
|
omObjMan *objman = objman_process->user_data;
|
||||||
omObjData *obj_all = objman->obj;
|
omObjData *obj_all = objman->obj;
|
||||||
int i;
|
s32 i;
|
||||||
OSReport("=================== 現在登録されている OBJECT ==================\n");
|
OSReport("=================== 現在登録されている OBJECT ==================\n");
|
||||||
OSReport("STAT PRI GRPN MEMN PROG (TRA) (ROT) (SCA) mdlcnt mtncnt work[0] work[1] work[2] work[3] *data\n");
|
OSReport("STAT PRI GRPN MEMN PROG (TRA) (ROT) (SCA) mdlcnt mtncnt work[0] work[1] work[2] work[3] *data\n");
|
||||||
for(i=0; i<objman->max_objs; i++) {
|
for(i=0; i<objman->max_objs; i++) {
|
||||||
|
|
@ -540,7 +540,7 @@ void omAllPause(BOOL pause)
|
||||||
{
|
{
|
||||||
Process *objman_process = HuPrcCurrentGet();
|
Process *objman_process = HuPrcCurrentGet();
|
||||||
omObjMan *objman = objman_process->user_data;
|
omObjMan *objman = objman_process->user_data;
|
||||||
int i;
|
s32 i;
|
||||||
if(pause) {
|
if(pause) {
|
||||||
for(i=0; i<objman->max_objs; i++) {
|
for(i=0; i<objman->max_objs; i++) {
|
||||||
if((objman->obj[i].stat & (OM_STAT_DELETED|OM_STAT_NOPAUSE)) == 0) {
|
if((objman->obj[i].stat & (OM_STAT_DELETED|OM_STAT_NOPAUSE)) == 0) {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ void omSystemKeyCheck(omObjData *object)
|
||||||
HuAudSeqPauseAll(0);
|
HuAudSeqPauseAll(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int i;
|
s32 i;
|
||||||
s16 pause = 0;
|
s16 pause = 0;
|
||||||
if(WipeStatGet() || omCurrentOvlGet() == OVL_INVALID || omSysExitReq) {
|
if(WipeStatGet() || omCurrentOvlGet() == OVL_INVALID || omSysExitReq) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#include "game/memory.h"
|
#include "game/memory.h"
|
||||||
#include "dolphin/os.h"
|
#include "dolphin/os.h"
|
||||||
|
|
||||||
#define PROCESS_MEMORY_RETADDR 0xA5A5A5A5
|
#define FAKE_RETADDR 0xA5A5A5A5
|
||||||
|
|
||||||
#define EXEC_NORMAL 0
|
#define EXEC_NORMAL 0
|
||||||
#define EXEC_SLEEP 1
|
#define EXEC_SLEEP 1
|
||||||
|
|
@ -15,7 +15,6 @@ static Process *processcur;
|
||||||
static u16 processcnt;
|
static u16 processcnt;
|
||||||
u32 procfunc;
|
u32 procfunc;
|
||||||
|
|
||||||
|
|
||||||
void HuPrcInit(void)
|
void HuPrcInit(void)
|
||||||
{
|
{
|
||||||
processcnt = 0;
|
processcnt = 0;
|
||||||
|
|
@ -49,12 +48,9 @@ static void UnlinkProcess(Process **root, Process *process) {
|
||||||
if (process->next) {
|
if (process->next) {
|
||||||
process->next->prev = process->prev;
|
process->next->prev = process->prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process->prev) {
|
if (process->prev) {
|
||||||
process->prev->next = process->next;
|
process->prev->next = process->next;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
*root = process->next;
|
*root = process->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -75,13 +71,13 @@ Process *HuPrcCreate(void (*func)(void), u16 prio, u32 stack_size, s32 extra_siz
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
HuMemHeapInit(heap, alloc_size);
|
HuMemHeapInit(heap, alloc_size);
|
||||||
process = HuMemMemoryAlloc(heap, sizeof(Process), PROCESS_MEMORY_RETADDR);
|
process = HuMemMemoryAlloc(heap, sizeof(Process), FAKE_RETADDR);
|
||||||
process->heap = heap;
|
process->heap = heap;
|
||||||
process->exec = EXEC_NORMAL;
|
process->exec = EXEC_NORMAL;
|
||||||
process->stat = 0;
|
process->stat = 0;
|
||||||
process->prio = prio;
|
process->prio = prio;
|
||||||
process->sleep_time = 0;
|
process->sleep_time = 0;
|
||||||
process->base_sp = ((u32)HuMemMemoryAlloc(heap, stack_size, PROCESS_MEMORY_RETADDR))+stack_size-8;
|
process->base_sp = ((u32)HuMemMemoryAlloc(heap, stack_size, FAKE_RETADDR))+stack_size-8;
|
||||||
gcsetjmp(&process->jump);
|
gcsetjmp(&process->jump);
|
||||||
process->jump.lr = (u32)func;
|
process->jump.lr = (u32)func;
|
||||||
process->jump.sp = process->base_sp;
|
process->jump.sp = process->base_sp;
|
||||||
|
|
@ -144,7 +140,7 @@ Process *HuPrcCurrentGet()
|
||||||
return processcur;
|
return processcur;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SetKillStatusProcess(Process *process)
|
static s32 SetKillStatusProcess(Process *process)
|
||||||
{
|
{
|
||||||
if(process->exec != EXEC_KILLED) {
|
if(process->exec != EXEC_KILLED) {
|
||||||
HuPrcWakeup(process);
|
HuPrcWakeup(process);
|
||||||
|
|
@ -155,7 +151,7 @@ static int SetKillStatusProcess(Process *process)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int HuPrcKill(Process *process)
|
s32 HuPrcKill(Process *process)
|
||||||
{
|
{
|
||||||
if(process == NULL) {
|
if(process == NULL) {
|
||||||
process = HuPrcCurrentGet();
|
process = HuPrcCurrentGet();
|
||||||
|
|
@ -196,7 +192,7 @@ void HuPrcEnd()
|
||||||
gcTerminateProcess(process);
|
gcTerminateProcess(process);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuPrcSleep(int time)
|
void HuPrcSleep(s32 time)
|
||||||
{
|
{
|
||||||
Process *process = HuPrcCurrentGet();
|
Process *process = HuPrcCurrentGet();
|
||||||
if(time != 0 && process->exec != EXEC_KILLED) {
|
if(time != 0 && process->exec != EXEC_KILLED) {
|
||||||
|
|
@ -210,10 +206,7 @@ void HuPrcSleep(int time)
|
||||||
|
|
||||||
void HuPrcVSleep()
|
void HuPrcVSleep()
|
||||||
{
|
{
|
||||||
Process *process = HuPrcCurrentGet();
|
HuPrcSleep(0);
|
||||||
if(!gcsetjmp(&process->jump)) {
|
|
||||||
gclongjmp(&processjmpbuf, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuPrcWakeup(Process *process)
|
void HuPrcWakeup(Process *process)
|
||||||
|
|
@ -232,10 +225,10 @@ void HuPrcDestructorSet(void (*func)(void))
|
||||||
process->dtor = func;
|
process->dtor = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuPrcCall(int tick)
|
void HuPrcCall(s32 tick)
|
||||||
{
|
{
|
||||||
Process *process;
|
Process *process;
|
||||||
int ret;
|
s32 ret;
|
||||||
processcur = processtop;
|
processcur = processtop;
|
||||||
ret = gcsetjmp(&processjmpbuf);
|
ret = gcsetjmp(&processjmpbuf);
|
||||||
while(1) {
|
while(1) {
|
||||||
|
|
@ -293,12 +286,12 @@ void HuPrcCall(int tick)
|
||||||
void *HuPrcMemAlloc(s32 size)
|
void *HuPrcMemAlloc(s32 size)
|
||||||
{
|
{
|
||||||
Process *process = HuPrcCurrentGet();
|
Process *process = HuPrcCurrentGet();
|
||||||
return HuMemMemoryAlloc(process->heap, size, PROCESS_MEMORY_RETADDR);
|
return HuMemMemoryAlloc(process->heap, size, FAKE_RETADDR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuPrcMemFree(void *ptr)
|
void HuPrcMemFree(void *ptr)
|
||||||
{
|
{
|
||||||
HuMemMemoryFree(ptr, PROCESS_MEMORY_RETADDR);
|
HuMemMemoryFree(ptr, FAKE_RETADDR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuPrcSetStat(Process *process, u16 value)
|
void HuPrcSetStat(Process *process, u16 value)
|
||||||
|
|
@ -311,7 +304,7 @@ void HuPrcResetStat(Process *process, u16 value)
|
||||||
process->stat &= ~value;
|
process->stat &= ~value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuPrcAllPause(int flag)
|
void HuPrcAllPause(s32 flag)
|
||||||
{
|
{
|
||||||
Process *process = processtop;
|
Process *process = processtop;
|
||||||
if(flag) {
|
if(flag) {
|
||||||
|
|
@ -333,7 +326,7 @@ void HuPrcAllPause(int flag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HuPrcAllUPause(int flag)
|
void HuPrcAllUPause(s32 flag)
|
||||||
{
|
{
|
||||||
Process *process = processtop;
|
Process *process = processtop;
|
||||||
if(flag) {
|
if(flag) {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
s16 HuSysVWaitGet(s16 old);
|
s16 HuSysVWaitGet(s16 old);
|
||||||
|
|
||||||
typedef int (*fadeFunc)(void);
|
typedef s32 (*fadeFunc)(void);
|
||||||
|
|
||||||
WipeState wipeData;
|
WipeState wipeData;
|
||||||
BOOL wipeFadeInF;
|
BOOL wipeFadeInF;
|
||||||
|
|
@ -15,9 +15,9 @@ static void WipeColorFill(GXColor color);
|
||||||
static void WipeFrameStill(GXColor color);
|
static void WipeFrameStill(GXColor color);
|
||||||
|
|
||||||
|
|
||||||
static int WipeNormalFade(void);
|
static s32 WipeNormalFade(void);
|
||||||
static int WipeCrossFade(void);
|
static s32 WipeCrossFade(void);
|
||||||
static int WipeDummyFade(void);
|
static s32 WipeDummyFade(void);
|
||||||
|
|
||||||
static fadeFunc fadeInFunc[3] = { WipeNormalFade, WipeCrossFade, WipeDummyFade };
|
static fadeFunc fadeInFunc[3] = { WipeNormalFade, WipeCrossFade, WipeDummyFade };
|
||||||
static fadeFunc fadeOutFunc[3] = { WipeNormalFade, WipeCrossFade, WipeDummyFade };
|
static fadeFunc fadeOutFunc[3] = { WipeNormalFade, WipeCrossFade, WipeDummyFade };
|
||||||
|
|
@ -25,7 +25,7 @@ static fadeFunc fadeOutFunc[3] = { WipeNormalFade, WipeCrossFade, WipeDummyFade
|
||||||
void WipeInit(GXRenderModeObj *rmode)
|
void WipeInit(GXRenderModeObj *rmode)
|
||||||
{
|
{
|
||||||
WipeState *wipe;
|
WipeState *wipe;
|
||||||
int i;
|
s32 i;
|
||||||
wipe = &wipeData;
|
wipe = &wipeData;
|
||||||
wipe->unk00 = 0;
|
wipe->unk00 = 0;
|
||||||
wipe->unk04 = 0;
|
wipe->unk04 = 0;
|
||||||
|
|
@ -46,7 +46,7 @@ void WipeInit(GXRenderModeObj *rmode)
|
||||||
|
|
||||||
void WipeExecAlways(void)
|
void WipeExecAlways(void)
|
||||||
{
|
{
|
||||||
int i;
|
s32 i;
|
||||||
WipeState *wipe;
|
WipeState *wipe;
|
||||||
wipe = &wipeData;
|
wipe = &wipeData;
|
||||||
switch(wipe->mode) {
|
switch(wipe->mode) {
|
||||||
|
|
@ -151,12 +151,12 @@ u8 WipeStatGet(void)
|
||||||
return wipeData.stat;
|
return wipeData.stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int WipeDummyFade(void)
|
static s32 WipeDummyFade(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int WipeNormalFade(void)
|
static s32 WipeNormalFade(void)
|
||||||
{
|
{
|
||||||
u8 alpha;
|
u8 alpha;
|
||||||
WipeState *wipe = &wipeData;
|
WipeState *wipe = &wipeData;
|
||||||
|
|
@ -192,9 +192,9 @@ static void WipeColorFill(GXColor color)
|
||||||
WipeState *wipe;
|
WipeState *wipe;
|
||||||
u16 ulx, lrx, uly, lry;
|
u16 ulx, lrx, uly, lry;
|
||||||
wipe = &wipeData;
|
wipe = &wipeData;
|
||||||
ulx = (int)wipe->x;
|
ulx = (s32)wipe->x;
|
||||||
lrx = wipe->x+wipe->w;
|
lrx = wipe->x+wipe->w;
|
||||||
uly = (int)wipe->y;
|
uly = (s32)wipe->y;
|
||||||
lry = wipe->x+wipe->h+1;
|
lry = wipe->x+wipe->h+1;
|
||||||
MTXOrtho(proj, uly, lry, ulx, lrx, 0, 10);
|
MTXOrtho(proj, uly, lry, ulx, lrx, 0, 10);
|
||||||
GXSetProjection(proj, GX_ORTHOGRAPHIC);
|
GXSetProjection(proj, GX_ORTHOGRAPHIC);
|
||||||
|
|
@ -227,7 +227,7 @@ static void WipeColorFill(GXColor color)
|
||||||
GXSetChanMatColor(GX_COLOR0A0, colorN);
|
GXSetChanMatColor(GX_COLOR0A0, colorN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int WipeCrossFade(void)
|
static s32 WipeCrossFade(void)
|
||||||
{
|
{
|
||||||
u32 size;
|
u32 size;
|
||||||
u8 alpha;
|
u8 alpha;
|
||||||
|
|
@ -273,9 +273,9 @@ static void WipeFrameStill(GXColor color)
|
||||||
WipeState *wipe;
|
WipeState *wipe;
|
||||||
u16 ulx, lrx, uly, lry;
|
u16 ulx, lrx, uly, lry;
|
||||||
wipe = &wipeData;
|
wipe = &wipeData;
|
||||||
ulx = (int)wipe->x;
|
ulx = (s32)wipe->x;
|
||||||
lrx = wipe->x+wipe->w;
|
lrx = wipe->x+wipe->w;
|
||||||
uly = (int)wipe->y;
|
uly = (s32)wipe->y;
|
||||||
lry = wipe->x+wipe->h+1;
|
lry = wipe->x+wipe->h+1;
|
||||||
MTXOrtho(proj, uly, lry, ulx, lrx, 0, 10);
|
MTXOrtho(proj, uly, lry, ulx, lrx, 0, 10);
|
||||||
GXSetProjection(proj, GX_ORTHOGRAPHIC);
|
GXSetProjection(proj, GX_ORTHOGRAPHIC);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue