diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-10-13 23:21:32 +0200 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-10-13 23:21:32 +0200 |
| commit | b458ea70700739bf8a64217af369c7ace08fc954 (patch) | |
| tree | 77281ebd18e5049fcb1c86718854ff3ce91e54c2 /examples/system/childexec/parent.c | |
| parent | 8e92156bc6a977651771d2cf91ac5800a0e9a913 (diff) | |
| download | psn00bsdk-b458ea70700739bf8a64217af369c7ace08fc954.tar.gz | |
Fix dropped IRQs, clean up psxcd and psxetc logging
Diffstat (limited to 'examples/system/childexec/parent.c')
| -rw-r--r-- | examples/system/childexec/parent.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/examples/system/childexec/parent.c b/examples/system/childexec/parent.c index 3e7d218..83d964c 100644 --- a/examples/system/childexec/parent.c +++ b/examples/system/childexec/parent.c @@ -67,12 +67,12 @@ extern const uint32_t ball16c[]; TIM_IMAGE tim; -void run_child(); +void run_child(void); char pad_buff[2][34]; -void init() { +void init(void) { int i; @@ -270,10 +270,7 @@ typedef struct { // Child program address extern char child_exe[]; -// Manually defined as its not defined in psxapi by default -void SetDefaultExitFromException(); - -void run_child() { +void run_child(void) { // Arguments for the child program char *args[] = @@ -289,29 +286,23 @@ void run_child() { // Copy child executable to its intended adddress memcpy((void*)exe->param.t_addr, child_exe+2048, exe->param.t_size); - // Enter critical section to prepare for program execution - EnterCriticalSection(); + // Prepare for program execution and disable interrupts + //EnterCriticalSection(); + StopCallback(); // Stop pads, enable auto acknowledge StopPAD(); ChangeClearPAD(1); ChangeClearRCnt(3, 1); - - // Set default exception handler just in case - //SetDefaultExitFromException(); - - // Last three function calls could be relegated to - // a StopCallback() function in the future. - + // Execute child printf("Child exec!\n"); Exec(&exe->param, 3, args); // Restore interrupts for this PS-EXE - EnterCriticalSection(); RestartCallback(); - ExitCriticalSection(); - + //ExitCriticalSection(); + // Re-init and re-enable pads InitPAD(pad_buff[0], 34, pad_buff[1], 34); StartPAD(); |
