diff options
| author | John Wilbert M. Villamor <lameguy64@gmail.com> | 2021-07-01 08:45:46 +0800 |
|---|---|---|
| committer | John Wilbert M. Villamor <lameguy64@gmail.com> | 2021-07-01 08:45:46 +0800 |
| commit | 01fe30bd8bae59ab954751b08bcc1d158eff7edb (patch) | |
| tree | aa83e37f4e59207ec41b3d47796875755462c63f /examples/system | |
| parent | da79082d2c5e0dcbc899a359f6f49ec8cca90d66 (diff) | |
| download | psn00bsdk-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')
| -rw-r--r-- | examples/system/childexec/child.c | 3 | ||||
| -rw-r--r-- | examples/system/childexec/parent.c | 11 | ||||
| -rw-r--r-- | examples/system/console/main.c | 13 | ||||
| -rw-r--r-- | examples/system/timer/main.c | 1 | ||||
| -rw-r--r-- | examples/system/tty/main.c | 9 |
5 files changed, 25 insertions, 12 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 ) { diff --git a/examples/system/console/main.c b/examples/system/console/main.c index 405f0d6..92df0a8 100644 --- a/examples/system/console/main.c +++ b/examples/system/console/main.c @@ -2,7 +2,7 @@ * LibPSn00b Example Programs * * Text Console Example - * 2020 Meido-Tek Productions / PSn00bSDK Project + * 2020 - 2021 Meido-Tek Productions / PSn00bSDK Project * * This example demonstrates a tty text console implementation for gameplay * sections, or sections with continuously updating graphics. The console is @@ -15,10 +15,13 @@ * * Changelog: * - * April 23, 2020 - Initial version. + * May 10, 2021 - Variable types updated for psxgpu.h changes. + * + * April 23, 2020 - Initial version. * */ - + +#include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -48,7 +51,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 */ @@ -101,7 +104,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 ) { diff --git a/examples/system/timer/main.c b/examples/system/timer/main.c index 7d9f7b3..8153581 100644 --- a/examples/system/timer/main.c +++ b/examples/system/timer/main.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <stdio.h> #include <psxgpu.h> #include <psxapi.h> diff --git a/examples/system/tty/main.c b/examples/system/tty/main.c index 8333746..dfffdc4 100644 --- a/examples/system/tty/main.c +++ b/examples/system/tty/main.c @@ -2,7 +2,7 @@ * LibPSn00b Example Programs * * Teletype Example - * 2020 Meido-Tek Productions / PSn00bSDK Project + * 2020 - 2021 Meido-Tek Productions / PSn00bSDK Project * * This example showcases the uses of tty through stdio facilities. If you've * written text console applications before, this one is not too dissimilar to @@ -14,10 +14,13 @@ * * Changelog: * - * April 23, 2020 - Initial version. + * May 10, 2021 - Variable types updated for psxgpu.h changes. + * + * April 23, 2020 - Initial version. * */ - + +#include <sys/types.h> #include <stdio.h> #include <ctype.h> #include <psxgpu.h> |
