diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2023-05-11 23:42:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-11 23:42:43 +0200 |
| commit | 04d7728350cbd04dd86cd894e906c98673e3f9a7 (patch) | |
| tree | 08e8c7dd495d1c4c6fcf5f7ba6b4b10693dc42f6 /examples/system | |
| parent | eaec942f56ceec9c14de5c4185a02602abadd50a (diff) | |
| parent | 58a8306d24fe29d965aa8b40ddc37c3163c0a2f9 (diff) | |
| download | psn00bsdk-04d7728350cbd04dd86cd894e906c98673e3f9a7.tar.gz | |
Merge pull request #70 from Lameguy64/v0.23-wip
Header cleanups, PCDRV, more safety checks, libc and mkpsxiso fixes (v0.23)
Diffstat (limited to 'examples/system')
| -rw-r--r-- | examples/system/childexec/child/child.c | 8 | ||||
| -rw-r--r-- | examples/system/childexec/parent.c | 24 | ||||
| -rw-r--r-- | examples/system/console/main.c | 2 | ||||
| -rw-r--r-- | examples/system/dynlink/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/system/dynlink/iso.xml | 5 |
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" |
