aboutsummaryrefslogtreecommitdiff
path: root/examples/system
diff options
context:
space:
mode:
Diffstat (limited to 'examples/system')
-rw-r--r--examples/system/childexec/child/child.c8
-rw-r--r--examples/system/childexec/parent.c24
-rw-r--r--examples/system/console/main.c2
-rw-r--r--examples/system/dynlink/CMakeLists.txt2
-rw-r--r--examples/system/dynlink/iso.xml5
5 files changed, 18 insertions, 23 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);
-
}
diff --git a/examples/system/console/main.c b/examples/system/console/main.c
index b4f91b4..845ca95 100644
--- a/examples/system/console/main.c
+++ b/examples/system/console/main.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ioctl.h>
+#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <psxapi.h>
#include <psxetc.h>
diff --git a/examples/system/dynlink/CMakeLists.txt b/examples/system/dynlink/CMakeLists.txt
index e750fd1..a1fd24e 100644
--- a/examples/system/dynlink/CMakeLists.txt
+++ b/examples/system/dynlink/CMakeLists.txt
@@ -17,7 +17,7 @@ psn00bsdk_add_library (dynlink_cube SHARED library/cube.c)
psn00bsdk_add_library (dynlink_balls SHARED library/balls.c)
psn00bsdk_add_cd_image(
dynlink_iso dynlink iso.xml
- DEPENDS dynlink_main dynlink_cube dynlink_balls
+ DEPENDS dynlink_main dynlink_cube dynlink_balls system.cnf
)
psn00bsdk_target_incbin(dynlink_balls PRIVATE ball16c library/ball16c.tim)
diff --git a/examples/system/dynlink/iso.xml b/examples/system/dynlink/iso.xml
index 8f40510..93cb948 100644
--- a/examples/system/dynlink/iso.xml
+++ b/examples/system/dynlink/iso.xml
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<iso_project
- image_name="${CD_IMAGE_NAME}.bin"
- cue_sheet="${CD_IMAGE_NAME}.cue"
->
+<iso_project>
<track type="data">
<identifiers
system ="PLAYSTATION"