aboutsummaryrefslogtreecommitdiff
path: root/examples/system
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2023-01-22 15:40:14 +0100
committerspicyjpeg <thatspicyjpeg@gmail.com>2023-01-22 15:40:14 +0100
commita21e949c9aea98cb4b3feee48bb98579bbdfba70 (patch)
tree5fad8655bc674bebdbecb385d3e4878acbac3597 /examples/system
parent3095b4571dabc8d6cee90673d679f3e77b21b164 (diff)
downloadpsn00bsdk-a21e949c9aea98cb4b3feee48bb98579bbdfba70.tar.gz
Fix VSync(), assert(), warnings and some examples
Diffstat (limited to 'examples/system')
-rw-r--r--examples/system/childexec/child/child.c7
-rw-r--r--examples/system/childexec/parent.c22
2 files changed, 13 insertions, 16 deletions
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);
-
}