aboutsummaryrefslogtreecommitdiff
path: root/examples
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
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')
-rw-r--r--examples/beginner/cppdemo/main.cpp15
-rw-r--r--examples/cdrom/cdbrowse/main.c9
-rw-r--r--examples/cdrom/cdxa/main.c11
-rw-r--r--examples/demos/n00bdemo/disp.c3
-rw-r--r--examples/demos/n00bdemo/disp.h3
-rw-r--r--examples/demos/n00bdemo/lightdemo.c1
-rw-r--r--examples/demos/n00bdemo/logo.c33
-rw-r--r--examples/demos/n00bdemo/main.c17
-rw-r--r--examples/demos/n00bdemo/smd.h4
-rw-r--r--examples/graphics/balls/main.c17
-rw-r--r--examples/graphics/billboard/billboard.c13
-rw-r--r--examples/graphics/fpscam/clip.h1
-rw-r--r--examples/graphics/fpscam/lookat.h1
-rw-r--r--examples/graphics/fpscam/main.c5
-rw-r--r--examples/graphics/gte/main.c9
-rw-r--r--examples/graphics/hdtv/clip.h1
-rw-r--r--examples/graphics/hdtv/lookat.h1
-rw-r--r--examples/graphics/hdtv/main.c9
-rw-r--r--examples/graphics/render2tex/main.c21
-rw-r--r--examples/graphics/rgb24/main.c7
-rw-r--r--examples/system/childexec/child.c3
-rw-r--r--examples/system/childexec/parent.c11
-rw-r--r--examples/system/console/main.c13
-rw-r--r--examples/system/timer/main.c1
-rw-r--r--examples/system/tty/main.c9
25 files changed, 136 insertions, 82 deletions
diff --git a/examples/beginner/cppdemo/main.cpp b/examples/beginner/cppdemo/main.cpp
index 1a98cac..58bfcda 100644
--- a/examples/beginner/cppdemo/main.cpp
+++ b/examples/beginner/cppdemo/main.cpp
@@ -3,7 +3,12 @@
* Basically a quick little example that showcases C++ classes are
* functioning in PSn00bSDK. - Lameguy64
*
- * Written in December ‎18, ‎2020.
+ * First written in December ‎18, ‎2020.
+ *
+ * Changelog:
+ *
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
*/
#include <sys/types.h>
@@ -14,7 +19,7 @@
class GraphClass
{
- u_int *_ot[2];
+ u_long *_ot[2];
u_char *_pri[2];
u_char *_nextpri;
@@ -28,8 +33,8 @@ public:
GraphClass( int ot_len = 8, int pri_len = 8192 )
{
- _ot[0] = (u_int*)malloc( sizeof(u_int)*ot_len );
- _ot[1] = (u_int*)malloc( sizeof(u_int)*ot_len );
+ _ot[0] = (u_long*)malloc( sizeof(u_long)*ot_len );
+ _ot[1] = (u_long*)malloc( sizeof(u_long)*ot_len );
_db = 0;
_ot_count = ot_len;
@@ -96,7 +101,7 @@ public:
} /* GetNextPri */
- u_int *GetOt( void )
+ u_long *GetOt( void )
{
return( _ot[_db] );
diff --git a/examples/cdrom/cdbrowse/main.c b/examples/cdrom/cdbrowse/main.c
index 772ddc1..ead2df0 100644
--- a/examples/cdrom/cdbrowse/main.c
+++ b/examples/cdrom/cdbrowse/main.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* CD File Browser Example
- * 2020 Meido-Tek Productions / PSn00bSDK Project
+ * 2020 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* Demonstrates listing and browsing directory contents of a CD-ROM containing
* an ISO9660 file system, using the directory query functions of the libpsxcd
@@ -47,11 +47,14 @@
*
* Changelog:
*
+ * May 10, 2021: Variable types updated for psxgpu.h changes.
+ *
* February 25, 2020: Initial version.
*
* July 12, 2020: Updated CD-ROM directory query logic on disc change slightly.
*/
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -85,7 +88,7 @@ DISPENV disp[2];
DRAWENV draw[2];
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 */
@@ -190,7 +193,7 @@ void init()
/* Upload the ball 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/cdrom/cdxa/main.c b/examples/cdrom/cdxa/main.c
index 0112437..16f1c82 100644
--- a/examples/cdrom/cdxa/main.c
+++ b/examples/cdrom/cdxa/main.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* CD-XA Audio Example
- * 2019 Meido-Tek Productions / PSn00bSDK Project
+ * 2019 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* Demonstrates playback and looping of CD-XA audio using the
* new libpsxcd library.
@@ -110,10 +110,13 @@
*
* Changelog:
*
- * November 22, 2019 - Initial version
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
+ * November 22, 2019 - Initial version
*
*/
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -148,7 +151,7 @@ DISPENV disp[2];
DRAWENV draw[2];
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 */
@@ -274,7 +277,7 @@ void init()
/* Upload the ball 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/demos/n00bdemo/disp.c b/examples/demos/n00bdemo/disp.c
index d798ee9..c134163 100644
--- a/examples/demos/n00bdemo/disp.c
+++ b/examples/demos/n00bdemo/disp.c
@@ -1,3 +1,4 @@
+#include <sys/types.h>
#include <stdio.h>
#include <psxgpu.h>
#include <psxgte.h>
@@ -9,7 +10,7 @@ DISPENV disp;
DRAWENV draw;
char pribuff[2][131072];
-unsigned int ot[2][OT_LEN];
+u_long ot[2][OT_LEN];
char *nextpri;
int db = 0;
diff --git a/examples/demos/n00bdemo/disp.h b/examples/demos/n00bdemo/disp.h
index ecf6dcf..2c76270 100644
--- a/examples/demos/n00bdemo/disp.h
+++ b/examples/demos/n00bdemo/disp.h
@@ -1,6 +1,7 @@
#ifndef _DISP_H
#define _DISP_H
+#include <sys/types.h>
#include <psxgte.h>
#define SCENE_TIME 60*15
@@ -13,7 +14,7 @@
void initDisplay();
void display();
-extern unsigned int ot[2][OT_LEN];
+extern u_long ot[2][OT_LEN];
extern char *nextpri;
extern int db;
diff --git a/examples/demos/n00bdemo/lightdemo.c b/examples/demos/n00bdemo/lightdemo.c
index ff858c0..5afd5c8 100644
--- a/examples/demos/n00bdemo/lightdemo.c
+++ b/examples/demos/n00bdemo/lightdemo.c
@@ -1,3 +1,4 @@
+#include <sys/types.h>
#include <string.h>
#include <psxgte.h>
#include <psxgpu.h>
diff --git a/examples/demos/n00bdemo/logo.c b/examples/demos/n00bdemo/logo.c
index 3fdef5e..2cebf6b 100644
--- a/examples/demos/n00bdemo/logo.c
+++ b/examples/demos/n00bdemo/logo.c
@@ -1,3 +1,4 @@
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <psxetc.h>
@@ -22,23 +23,23 @@ typedef struct {
} PARTICLE;
typedef struct {
- unsigned int tag;
- unsigned int tpage;
- unsigned int mask1;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short x1,y1;
- short x2,y2;
- short x3,y3;
- unsigned int mask2;
+ u_long tag;
+ u_long tpage;
+ u_long mask1;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short x1,y1;
+ short x2,y2;
+ short x3,y3;
+ u_long mask2;
} MASKP_F4;
typedef struct {
- unsigned int tag;
- unsigned int tpage;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short w,h;
+ u_long tag;
+ u_long tpage;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short w,h;
} FADERECT;
@@ -46,8 +47,8 @@ SMD *o_psn00b, *o_n00blogo;
typedef struct {
- unsigned int *prev;
- unsigned int *next;
+ u_long *prev;
+ u_long *next;
int size;
} NODE;
diff --git a/examples/demos/n00bdemo/main.c b/examples/demos/n00bdemo/main.c
index a6eb57e..623d8cc 100644
--- a/examples/demos/n00bdemo/main.c
+++ b/examples/demos/n00bdemo/main.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* n00bDEMO Source Code
- * 2019 Meido-Tek Productions / PSn00bSDK Project
+ * 2019 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* To build, simply run make. Make sure you have the lzpack tool accessible
* through your PATH environment variable.
@@ -11,12 +11,15 @@
*
* Changelog:
*
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
* Apr 4, 2019 - Some code clean-up and added more comments.
*
* Mar 20, 2019 - Initial completed version.
*
*/
+#include <sys/types.h>
#include <sys/fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -92,7 +95,7 @@ void loadTextures() {
for( j=0; j<qlpFileCount( tex_buff )-4; j++ ) {
- if( !GetTimInfo( (unsigned int*)qlpFileAddr( j, tex_buff ), &tim ) ) {
+ if( !GetTimInfo( (u_long*)qlpFileAddr( j, tex_buff ), &tim ) ) {
UploadTIM( &tim );
@@ -101,7 +104,7 @@ void loadTextures() {
}
- GetTimInfo( (unsigned int*)qlpFileAddr(
+ GetTimInfo( (u_long*)qlpFileAddr(
qlpFindFile( "n00blogo", tex_buff ), tex_buff ), &tim );
UploadTIM( &tim );
@@ -114,7 +117,7 @@ void loadTextures() {
setRGB0( &psn00b_sprite, 128, 128, 128 );
- GetTimInfo( (unsigned int*)qlpFileAddr(
+ GetTimInfo( (u_long*)qlpFileAddr(
qlpFindFile( "lamelotl", tex_buff ), tex_buff ), &tim );
UploadTIM( &tim );
@@ -127,7 +130,7 @@ void loadTextures() {
setRGB0( &llotl_sprite, 128, 128, 128 );
- GetTimInfo( (unsigned int*)qlpFileAddr(
+ GetTimInfo( (u_long*)qlpFileAddr(
qlpFindFile( "celmap", tex_buff ), tex_buff ), &tim );
UploadTIM( &tim );
@@ -137,7 +140,7 @@ void loadTextures() {
smdSetCelParam( 3, 3, 0x4f4f4f );
- GetTimInfo( (unsigned int*)qlpFileAddr(
+ GetTimInfo( (u_long*)qlpFileAddr(
qlpFindFile( "font", tex_buff ), tex_buff ), &tim );
UploadTIM( &tim );
@@ -545,7 +548,7 @@ void hatkidstuff() {
// Plasma stuff
void genPlasma(char *out, int count);
-char *sortPlasma(int *ot, char *pri, char *map);
+char *sortPlasma(u_long *ot, char *pri, char *map);
void plasmastuff() {
diff --git a/examples/demos/n00bdemo/smd.h b/examples/demos/n00bdemo/smd.h
index 29c2812..4306534 100644
--- a/examples/demos/n00bdemo/smd.h
+++ b/examples/demos/n00bdemo/smd.h
@@ -2,7 +2,7 @@
#define _SMD_H
typedef struct {
- int *ot;
+ u_long *ot;
short otlen;
unsigned char zdiv,zoff;
} SC_OT;
@@ -59,7 +59,7 @@ SMD *smdInitData(void *data);
void smdSetBaseTPage(unsigned short tpage);
char *smdSortModel(SC_OT *ot, char* pribuff, SMD *smd);
-char *smdSortModelFlat(unsigned int *ot, char* pribuff, SMD *smd);
+char *smdSortModelFlat(u_long *ot, char* pribuff, SMD *smd);
void smdSetCelTex(unsigned short tpage, unsigned short clut);
void smdSetCelParam(int udiv, int vdiv, unsigned int col);
diff --git a/examples/graphics/balls/main.c b/examples/graphics/balls/main.c
index 89c8063..e429a4b 100644
--- a/examples/graphics/balls/main.c
+++ b/examples/graphics/balls/main.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* Balls Example
- * 2019 Meido-Tek Productions / PSn00bSDK Project
+ * 2019 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* Draws a bunch of ball sprites that bounce around the screen,
* along with a ball snake that might be difficult to see.
@@ -12,10 +12,13 @@
*
* Changelog:
*
- * November 20, 2018 - Initial version.
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
+ * November 20, 2018 - Initial version.
*
*/
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <psxetc.h>
@@ -39,10 +42,10 @@
DISPENV disp;
DRAWENV draw;
-char pribuff[2][65536]; /* Primitive packet buffers */
-unsigned int ot[2][OT_LEN]; /* Ordering tables */
-char *nextpri; /* Pointer to next packet buffer offset */
-int db = 0; /* Double buffer index */
+char pribuff[2][65536]; /* Primitive packet buffers */
+u_long ot[2][OT_LEN]; /* Ordering tables */
+char *nextpri; /* Pointer to next packet buffer offset */
+int db = 0; /* Double buffer index */
/* Ball struct and array */
@@ -93,7 +96,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/graphics/billboard/billboard.c b/examples/graphics/billboard/billboard.c
index bba5dda..ea98b28 100644
--- a/examples/graphics/billboard/billboard.c
+++ b/examples/graphics/billboard/billboard.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* GTE Billboarding Sprites Example
- * 2019 Meido-Tek Productions / PSn00bSDK Project
+ * 2019 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* Displays a bunch of sprites placed on the screen using 3D coordinates
* that scale according to the distance from the screen. This is a quick
@@ -16,10 +16,13 @@
*
* Changelog:
*
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
* Sep 24, 2019 - Initial version.
*
*/
+#include <sys/types.h>
#include <stdio.h>
#include <psxgpu.h>
#include <psxgte.h>
@@ -42,7 +45,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;
@@ -51,8 +54,8 @@ DB db[2];
int db_active = 0;
char *db_nextpri;
-extern int tim_image[];
-TIM_IMAGE tim;
+extern u_long tim_image[];
+TIM_IMAGE tim;
/* For easier handling of vertex indices */
typedef struct {
@@ -224,7 +227,7 @@ void init() {
/* Set screen depth (basically FOV control, W/2 works best) */
gte_SetGeomScreen( CENTERX );
- GetTimInfo(tim_image, &tim);
+ GetTimInfo( tim_image, &tim);
LoadImage(tim.prect, tim.paddr);
DrawSync(0);
diff --git a/examples/graphics/fpscam/clip.h b/examples/graphics/fpscam/clip.h
index 3b428bb..4daf47a 100644
--- a/examples/graphics/fpscam/clip.h
+++ b/examples/graphics/fpscam/clip.h
@@ -1,6 +1,7 @@
#ifndef _CLIP_H
#define _CLIP_H
+#include <sys/types.h>
#include <psxgte.h>
#include <psxgpu.h>
diff --git a/examples/graphics/fpscam/lookat.h b/examples/graphics/fpscam/lookat.h
index c57e50a..4b10596 100644
--- a/examples/graphics/fpscam/lookat.h
+++ b/examples/graphics/fpscam/lookat.h
@@ -1,6 +1,7 @@
#ifndef _LOOKAT_H
#define _LOOKAT_H
+#include <sys/types.h>
#include <psxgte.h>
#include <psxgpu.h>
diff --git a/examples/graphics/fpscam/main.c b/examples/graphics/fpscam/main.c
index 9dedf06..a009a65 100644
--- a/examples/graphics/fpscam/main.c
+++ b/examples/graphics/fpscam/main.c
@@ -33,7 +33,8 @@
* Sep 24, 2019 - Added camera position display and _boot() exit.
*
*/
-
+
+#include <sys/types.h>
#include <stdio.h>
#include <psxgpu.h>
#include <psxgte.h>
@@ -62,7 +63,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/graphics/gte/main.c b/examples/graphics/gte/main.c
index 432ef95..a7ddb6b 100644
--- a/examples/graphics/gte/main.c
+++ b/examples/graphics/gte/main.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* GTE Graphics Example
- * 2019 Meido-Tek Productions / PSn00bSDK Project
+ * 2019 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* Renders a spinning 3D cube with light source calculation
* using GTE macros.
@@ -12,10 +12,13 @@
*
* Changelog:
*
- * Jan 26, 2019 - Initial version.
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
+ * Jan 26, 2019 - Initial version.
*
*/
+#include <sys/types.h>
#include <stdio.h>
#include <psxgpu.h>
#include <psxgte.h>
@@ -38,7 +41,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/graphics/hdtv/clip.h b/examples/graphics/hdtv/clip.h
index 3b428bb..4daf47a 100644
--- a/examples/graphics/hdtv/clip.h
+++ b/examples/graphics/hdtv/clip.h
@@ -1,6 +1,7 @@
#ifndef _CLIP_H
#define _CLIP_H
+#include <sys/types.h>
#include <psxgte.h>
#include <psxgpu.h>
diff --git a/examples/graphics/hdtv/lookat.h b/examples/graphics/hdtv/lookat.h
index c57e50a..4b10596 100644
--- a/examples/graphics/hdtv/lookat.h
+++ b/examples/graphics/hdtv/lookat.h
@@ -1,6 +1,7 @@
#ifndef _LOOKAT_H
#define _LOOKAT_H
+#include <sys/types.h>
#include <psxgte.h>
#include <psxgpu.h>
diff --git a/examples/graphics/hdtv/main.c b/examples/graphics/hdtv/main.c
index 82911d5..a4dcd79 100644
--- a/examples/graphics/hdtv/main.c
+++ b/examples/graphics/hdtv/main.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* Full-resolution, Anamorphic Widescreen 3D Example
- * 2020 Meido-Tek Productions / PSn00bSDK Project
+ * 2020 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* This example is a modification of the fpscam example demonstrating
* a method for taking advantage of widescreen HDTVs by means of a
@@ -51,10 +51,13 @@
*
* Changelog:
*
- * November 27, 2020 - Initial version.
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
+ * November 27, 2020 - Initial version.
*
*/
+#include <sys/types.h>
#include <stdio.h>
#include <psxgpu.h>
#include <psxgte.h>
@@ -83,7 +86,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/graphics/render2tex/main.c b/examples/graphics/render2tex/main.c
index 6ae450a..37b50d7 100644
--- a/examples/graphics/render2tex/main.c
+++ b/examples/graphics/render2tex/main.c
@@ -2,7 +2,7 @@
* LibPSn00b Example Programs
*
* Off-screen Render to Texture Example
- * 2019 Meido-Tek Productions / PSn00bSDK Project
+ * 2019 - 2021 Meido-Tek Productions / PSn00bSDK Project
*
* Demonstrates quick render to texture for multi-texture style effects,
* view screens and more. This example also shows how to use multiple
@@ -13,10 +13,13 @@
*
* Changelog:
*
- * Oct 26, 2019 - Initial version.
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
+ * Oct 26, 2019 - Initial version.
*
*/
+#include <sys/types.h>
#include <stdio.h>
#include <psxgpu.h>
#include <psxgte.h>
@@ -44,8 +47,8 @@ typedef struct DB
{
DISPENV disp; /* Display environment */
DRAWENV draw; /* Drawing environment */
- int ot[OT_LEN]; /* Main ordering table */
- int sub_ot[2][4]; /* Second ordering table for r2t stuff */
+ u_long ot[OT_LEN]; /* Main ordering table */
+ u_long sub_ot[2][4]; /* Second ordering table for r2t stuff */
char p[PACKET_LEN]; /* Packet buffer */
} DB;
@@ -113,7 +116,7 @@ MATRIX light_mtx = {
/* Reference texture data */
-extern int tim_blendpattern[];
+extern u_long tim_blendpattern[];
/* TPage and CLUT values */
@@ -128,8 +131,8 @@ void display();
/* This function sorts a cube that is drawn
* to an offscreen area specified by *area */
-void sort_cube(int *ot, RECT *area);
-void sort_multitex(int *ot, RECT *area, int count);
+void sort_cube(u_long *ot, RECT *area);
+void sort_multitex(u_long *ot, RECT *area, int count);
/* Main function */
int main() {
@@ -393,7 +396,7 @@ void display() {
}
-void sort_multitex(int *ot, RECT *area, int count)
+void sort_multitex(u_long *ot, RECT *area, int count)
{
DR_TPAGE *ptpage;
FILL *pfill;
@@ -526,7 +529,7 @@ void sort_multitex(int *ot, RECT *area, int count)
}
-void sort_cube(int *ot, RECT *area)
+void sort_cube(u_long *ot, RECT *area)
{
int i,p;
POLY_FT4* pol4;
diff --git a/examples/graphics/rgb24/main.c b/examples/graphics/rgb24/main.c
index 9f1a647..3c0bebf 100644
--- a/examples/graphics/rgb24/main.c
+++ b/examples/graphics/rgb24/main.c
@@ -12,16 +12,19 @@
*
* Changelog:
*
- * 05-03-2019 - Initial version.
+ * May 10, 2021 - Variable types updated for psxgpu.h changes.
+ *
+ * May 3, 2019 - Initial version.
*
*/
+#include <sys/types.h>
#include <stdio.h>
#include <psxgte.h>
#include <psxgpu.h>
// So data from tim.s can be accessed
-extern unsigned int tim_image[];
+extern u_long tim_image[];
int main() {
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>