Some process work

This commit is contained in:
dbalatoni13 2025-04-03 14:01:35 +02:00
parent 6e53c813fc
commit 39549e415e
6 changed files with 18 additions and 21 deletions

1
extern/aurora vendored

@ -1 +0,0 @@
Subproject commit 6f6861215150abc4fa00197de43754525cac07a6

View file

@ -1,9 +1,12 @@
#ifndef _GAME_JMP_H
#define _GAME_JMP_H
#ifdef TARGET_PC
#include <setjmp.h>
#else
#include "dolphin.h"
typedef struct JMPBUF {
typedef struct jmp_buf {
u32 lr;
u32 cr;
u32 sp;
@ -11,9 +14,10 @@ typedef struct JMPBUF {
u32 pad;
u32 regs[19];
double flt_regs[19];
} JMPBUF;
} jmp_buf;
s32 gcsetjmp(JMPBUF *jump);
s32 gclongjmp(JMPBUF *jump, s32 status);
s32 gcsetjmp(jmp_buf *jump);
s32 gclongjmp(jmp_buf *jump, s32 status);
#endif
#endif

View file

@ -3,12 +3,7 @@
#include "dolphin/types.h"
#ifdef TARGET_PC
#include <setjmp.h>
typedef int JMPBUF;
#else
#include "game/jmp.h"
#endif
#define PROCESS_STAT_PAUSE 0x1
#define PROCESS_STAT_UPAUSE 0x2
@ -28,7 +23,7 @@ typedef struct process {
u16 prio;
s32 sleep_time;
u32 base_sp;
JMPBUF jump;
jmp_buf jump;
void (*dtor)(void);
void *user_data;
} Process;

View file

@ -5,7 +5,6 @@
#include "game/frand.h"
#include "game/gamework_data.h"
#include "game/hsfman.h"
#include "game/jmp.h"
#include "game/minigame_seq.h"
#include "game/window.h"
#include "game/wipe.h"

View file

@ -108,7 +108,7 @@ void main(void)
#else
HuSysInit(&GXPal528IntDf);
#endif
//HuPrcInit();
HuPrcInit();
// HuPadInit();
// GWInit();
// pfInit();
@ -168,10 +168,10 @@ void main(void)
HuPerfBegin(0);
Hu3DPreProc();
HuPadRead();
pfClsScr();
pfClsScr();*/
HuPrcCall(1);
MGSeqMain();
/* MGSeqMain();
HuPerfBegin(1);
Hu3DExec();
HuDvdErrorWatch();

View file

@ -14,7 +14,7 @@
#define EXEC_CHILDWATCH 2
#define EXEC_KILLED 3
static JMPBUF processjmpbuf;
static jmp_buf processjmpbuf;
static Process *processtop;
static Process *processcur;
static u16 processcnt;
@ -142,7 +142,7 @@ void HuPrcChildWatch()
curr->exec = EXEC_CHILDWATCH;
#ifdef TARGET_PC
#else
if (!gcsetjmp(&curr->jump)) {
if (gcsetjmp(&curr->jump) == 0) {
gclongjmp(&processjmpbuf, 1);
}
#endif
@ -219,7 +219,7 @@ void HuPrcSleep(s32 time)
}
#ifdef TARGET_PC
#else
if (!gcsetjmp(&process->jump)) {
if (gcsetjmp(&process->jump) == 0) {
gclongjmp(&processjmpbuf, 1);
}
#endif
@ -274,8 +274,8 @@ void HuPrcCall(s32 tick)
if (!process) {
return;
}
#ifdef TARGET_PC
#else
#ifdef __MWERKS__
// unused
procfunc = process->jump.lr;
#endif
if ((process->stat & (PROCESS_STAT_PAUSE | PROCESS_STAT_UPAUSE)) && process->exec != EXEC_KILLED) {
@ -296,7 +296,7 @@ void HuPrcCall(s32 tick)
case EXEC_CHILDWATCH:
if (process->child) {
ret = 1;
ret = 1;
}
else {
process->exec = EXEC_NORMAL;