aboutsummaryrefslogtreecommitdiff
path: root/examples/system/childexec
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2021-07-01 08:45:46 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2021-07-01 08:45:46 +0800
commit01fe30bd8bae59ab954751b08bcc1d158eff7edb (patch)
treeaa83e37f4e59207ec41b3d47796875755462c63f /examples/system/childexec
parentda79082d2c5e0dcbc899a359f6f49ec8cca90d66 (diff)
downloadpsn00bsdk-01fe30bd8bae59ab954751b08bcc1d158eff7edb.tar.gz
Added int*_t and uint*_t variable types and updated type definitions in psxgpu and psxcd, to improve compatibility with code written for the official SDK.
Diffstat (limited to 'examples/system/childexec')
-rw-r--r--examples/system/childexec/child.c3
-rw-r--r--examples/system/childexec/parent.c11
2 files changed, 10 insertions, 4 deletions
diff --git a/examples/system/childexec/child.c b/examples/system/childexec/child.c
index 2ed656b..2ddfa73 100644
--- a/examples/system/childexec/child.c
+++ b/examples/system/childexec/child.c
@@ -1,3 +1,4 @@
+#include <sys/types.h>
#include <stdio.h>
#include <psxapi.h>
#include <psxgpu.h>
@@ -22,7 +23,7 @@
typedef struct {
DISPENV disp; /* Display environment */
DRAWENV draw; /* Drawing environment */
- int ot[OT_LEN]; /* Ordering table */
+ u_long ot[OT_LEN]; /* Ordering table */
char p[PACKET_LEN]; /* Packet buffer */
} DB;
diff --git a/examples/system/childexec/parent.c b/examples/system/childexec/parent.c
index ed5710a..58f03f7 100644
--- a/examples/system/childexec/parent.c
+++ b/examples/system/childexec/parent.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* Child Program Execution Example
- * 2020 Meido-Tek Productions / PSn00bSDK Project
+ * 2020 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* This example demonstrates how to execute a child PS-EXE from a parent
* PS-EXE using the Exec() function, and transferring execution back from
@@ -14,8 +14,13 @@
*
* Example by Lameguy64
*
+ * Changelog:
+ *
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
*/
+#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -43,7 +48,7 @@ DISPENV disp;
DRAWENV draw;
char pribuff[2][65536]; /* Primitive packet buffers */
-unsigned int ot[2][OT_LEN]; /* Ordering tables */
+u_long ot[2][OT_LEN]; /* Ordering tables */
char *nextpri; /* Pointer to next packet buffer offset */
int db = 0; /* Double buffer index */
@@ -98,7 +103,7 @@ void init() {
/* Upload the ball texture */
printf("Upload texture... ");
- GetTimInfo( (unsigned int*)ball16c, &tim ); /* Get TIM parameters */
+ GetTimInfo( (u_long*)ball16c, &tim ); /* Get TIM parameters */
LoadImage( tim.prect, tim.paddr ); /* Upload texture to VRAM */
if( tim.mode & 0x8 ) {