diff options
Diffstat (limited to 'examples/system/childexec')
| -rw-r--r-- | examples/system/childexec/child/child.c | 8 | ||||
| -rw-r--r-- | examples/system/childexec/parent.c | 24 |
2 files changed, 15 insertions, 17 deletions
diff --git a/examples/system/childexec/child/child.c b/examples/system/childexec/child/child.c index dcfbfaf..e5e16b9 100644 --- a/examples/system/childexec/child/child.c +++ b/examples/system/childexec/child/child.c @@ -1,5 +1,6 @@ #include <stdint.h> #include <stdio.h> +#include <psxetc.h> #include <psxapi.h> #include <psxgpu.h> #include <psxgte.h> @@ -238,11 +239,12 @@ int main(int argc, const char *argv[]) { display(); } - + + DrawSync(0); StopPAD(); - + StopCallback(); + return 0; - } void init(void) { diff --git a/examples/system/childexec/parent.c b/examples/system/childexec/parent.c index 83d964c..cfed11c 100644 --- a/examples/system/childexec/parent.c +++ b/examples/system/childexec/parent.c @@ -273,7 +273,7 @@ extern char child_exe[]; void run_child(void) { // Arguments for the child program - char *args[] = + const char *args[] = { "SAMPLE=0", "SESSION=1", @@ -285,31 +285,27 @@ void run_child(void) { // Copy child executable to its intended adddress memcpy((void*)exe->param.t_addr, child_exe+2048, exe->param.t_size); - - // Prepare for program execution and disable interrupts - //EnterCriticalSection(); - StopCallback(); - // Stop pads, enable auto acknowledge + // Prepare for program execution and disable interrupts + DrawSync(0); StopPAD(); - ChangeClearPAD(1); - ChangeClearRCnt(3, 1); + StopCallback(); + FlushCache(); // Execute child - printf("Child exec!\n"); + printf("Executing child...\n"); Exec(&exe->param, 3, args); - + // Restore interrupts for this PS-EXE RestartCallback(); - //ExitCriticalSection(); - + printf("Child returned\n"); + // Re-init and re-enable pads InitPAD(pad_buff[0], 34, pad_buff[1], 34); StartPAD(); ChangeClearPAD(0); - + // Set this program's display mode SetDispMask(0); PutDispEnv(&disp); - } |
