From a21e949c9aea98cb4b3feee48bb98579bbdfba70 Mon Sep 17 00:00:00 2001 From: spicyjpeg Date: Sun, 22 Jan 2023 15:40:14 +0100 Subject: Fix VSync(), assert(), warnings and some examples --- examples/system/childexec/child/child.c | 7 ++++--- examples/system/childexec/parent.c | 22 +++++++++------------- 2 files changed, 13 insertions(+), 16 deletions(-) (limited to 'examples/system') diff --git a/examples/system/childexec/child/child.c b/examples/system/childexec/child/child.c index dcfbfaf..b52dd32 100644 --- a/examples/system/childexec/child/child.c +++ b/examples/system/childexec/child/child.c @@ -238,11 +238,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..79c81f1 100644 --- a/examples/system/childexec/parent.c +++ b/examples/system/childexec/parent.c @@ -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); - } -- cgit v1.2.3