aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--changelog.txt15
-rw-r--r--doc/LibPSn00b Reference.odtbin141928 -> 150699 bytes
-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
-rw-r--r--libpsn00b/include/psxcd.h20
-rw-r--r--libpsn00b/include/psxgpu.h504
-rw-r--r--libpsn00b/include/sys/types.h20
30 files changed, 446 insertions, 331 deletions
diff --git a/changelog.txt b/changelog.txt
index b7cac11..666e3c5 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -2,6 +2,21 @@ PSn00bSDK changelog
Items that are lower in the log are more recently implemented.
+07-01-2021 by Lameguy64:
+
+* Libpsn00b: Added int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
+ uint32_t and uint64_t variable types in sys/types.h.
+
+* psxgte: Replaced unsigned int variable types with u_long to further
+ improve compatibility with code written for the official Sony SDK and
+ to make my tutorial examples easier to compile on PSn00bSDK. Example
+ programs have been updated to account for this change.
+
+* psxcd: Changed type of 2nd argument of CdRead() from u_int to u_long,
+ as well as changing the type of the size element in CdlFILE from u_int
+ to u_long.
+
+
02-17-2021 by Lameguy64:
* Improved build instructions in readme file and fixed some typos.
diff --git a/doc/LibPSn00b Reference.odt b/doc/LibPSn00b Reference.odt
index 1110a1e..b7fa52c 100644
--- a/doc/LibPSn00b Reference.odt
+++ b/doc/LibPSn00b Reference.odt
Binary files differ
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>
diff --git a/libpsn00b/include/psxcd.h b/libpsn00b/include/psxcd.h
index 6616b53..ffbe86b 100644
--- a/libpsn00b/include/psxcd.h
+++ b/libpsn00b/include/psxcd.h
@@ -105,7 +105,7 @@ typedef struct _CdlATV
typedef struct _CdlFILE
{
CdlLOC pos;
- u_int size;
+ u_long size;
char name[16];
} CdlFILE;
@@ -120,7 +120,7 @@ typedef struct _CdlFILTER
typedef void* CdlDIR;
/* Data callback */
-typedef void (*CdlCB)(int, unsigned char *);
+typedef void (*CdlCB)(int, u_char *);
#ifdef __cplusplus
extern "C" {
@@ -132,20 +132,20 @@ CdlLOC* CdIntToPos(int i, CdlLOC *p);
int CdPosToInt(CdlLOC *p);
int CdGetToc(CdlLOC *toc);
-int CdControl(unsigned char com, unsigned char *param, unsigned char *result);
-int CdControlB(unsigned char com, unsigned char *param, unsigned char *result);
-int CdControlF(unsigned char com, unsigned char *param);
-int CdSync(int mode, unsigned char *result);
-unsigned int CdSyncCallback(CdlCB func);
+int CdControl(u_char com, u_char *param, u_char *result);
+int CdControlB(u_char com, u_char *param, u_char *result);
+int CdControlF(u_char com, u_char *param);
+int CdSync(int mode, u_char *result);
+u_long CdSyncCallback(CdlCB func);
long CdReadyCallback(CdlCB func);
int CdGetSector(void *madr, int size);
CdlFILE* CdSearchFile(CdlFILE *loc, const char *filename);
-int CdRead(int sectors, unsigned int *buf, int mode);
-int CdReadSync(int mode, unsigned char *result);
-unsigned int CdReadCallback(CdlCB func);
+int CdRead(int sectors, u_long *buf, int mode);
+int CdReadSync(int mode, u_char *result);
+u_long CdReadCallback(CdlCB func);
int CdStatus(void);
int CdMode(void);
diff --git a/libpsn00b/include/psxgpu.h b/libpsn00b/include/psxgpu.h
index 89fa338..ac6d98b 100644
--- a/libpsn00b/include/psxgpu.h
+++ b/libpsn00b/include/psxgpu.h
@@ -206,303 +206,337 @@
/*
* Primitive definitions
*/
-typedef struct _P_TAG {
- unsigned int addr:24;
- unsigned int len:8;
- unsigned char r,g,b;
- unsigned char code;
+typedef struct _P_TAG
+{
+ unsigned addr:24;
+ unsigned len:8;
+ u_char r,g,b,code;
} P_TAG;
/*
* Polygon primitive definitions
*/
-typedef struct _POLY_F3 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short x1,y1;
- short x2,y2;
+typedef struct _POLY_F3
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short x1,y1;
+ short x2,y2;
} POLY_F3;
-typedef struct _POLY_F4 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short x1,y1;
- short x2,y2;
- short x3,y3;
+typedef struct _POLY_F4
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short x1,y1;
+ short x2,y2;
+ short x3,y3;
} POLY_F4;
-typedef struct _POLY_FT3 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char u0,v0;
- unsigned short clut;
- short x1,y1;
- unsigned char u1,v1;
- unsigned short tpage;
- short x2,y2;
- unsigned char u2,v2;
- unsigned short pad;
+typedef struct _POLY_FT3
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char u0,v0;
+ u_short clut;
+ short x1,y1;
+ u_char u1,v1;
+ u_short tpage;
+ short x2,y2;
+ u_char u2,v2;
+ u_short pad;
} POLY_FT3;
-typedef struct _POLY_FT4 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char u0,v0;
- unsigned short clut;
- short x1,y1;
- unsigned char u1,v1;
- unsigned short tpage;
- short x2,y2;
- unsigned char u2,v2;
- unsigned short pad0;
- short x3,y3;
- unsigned char u3,v3;
- unsigned short pad1;
+typedef struct _POLY_FT4
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ u_short x0,y0;
+ u_char u0,v0;
+ u_short clut;
+ short x1,y1;
+ u_char u1,v1;
+ u_short tpage;
+ short x2,y2;
+ u_char u2,v2;
+ u_short pad0;
+ short x3,y3;
+ u_char u3,v3;
+ u_short pad1;
} POLY_FT4;
-typedef struct _POLY_G3 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char r1,g1,b1,pad0;
- short x1,y1;
- unsigned char r2,g2,b2,pad1;
- short x2,y2;
+typedef struct _POLY_G3
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char r1,g1,b1,pad0;
+ short x1,y1;
+ u_char r2,g2,b2,pad1;
+ short x2,y2;
} POLY_G3;
-typedef struct _POLY_G4 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char r1,g1,b1,pad0;
- short x1,y1;
- unsigned char r2,g2,b2,pad1;
- short x2,y2;
- unsigned char r3,g3,b3,pad2;
- short x3,y3;
+typedef struct _POLY_G4
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char r1,g1,b1,pad0;
+ short x1,y1;
+ u_char r2,g2,b2,pad1;
+ short x2,y2;
+ u_char r3,g3,b3,pad2;
+ short x3,y3;
} POLY_G4;
-typedef struct _POLY_GT3 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char u0,v0;
- unsigned short clut;
- unsigned char r1,g1,b1,pad0;
- short x1,y1;
- unsigned char u1,v1;
- unsigned short tpage;
- unsigned char r2,g2,b2,pad1;
- short x2,y2;
- unsigned char u2,v2;
- unsigned short pad2;
+typedef struct _POLY_GT3
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char u0,v0;
+ u_short clut;
+ u_char r1,g1,b1,pad0;
+ short x1,y1;
+ u_char u1,v1;
+ u_short tpage;
+ u_char r2,g2,b2,pad1;
+ short x2,y2;
+ u_char u2,v2;
+ u_short pad2;
} POLY_GT3;
-typedef struct _POLY_GT4 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char u0,v0;
- unsigned short clut;
- unsigned char r1,g1,b1,pad0;
- short x1,y1;
- unsigned char u1,v1;
- unsigned short tpage;
- unsigned char r2,g2,b2,pad1;
- short x2,y2;
- unsigned char u2,v2;
- unsigned short pad2;
- unsigned char r3,g3,b3,pad3;
- short x3,y3;
- unsigned char u3,v3;
- unsigned short pad4;
+typedef struct _POLY_GT4
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char u0,v0;
+ u_short clut;
+ u_char r1,g1,b1,pad0;
+ short x1,y1;
+ u_char u1,v1;
+ u_short tpage;
+ u_char r2,g2,b2,pad1;
+ short x2,y2;
+ u_char u2,v2;
+ u_short pad2;
+ u_char r3,g3,b3,pad3;
+ short x3,y3;
+ u_char u3,v3;
+ u_short pad4;
} POLY_GT4;
/*
* Line primitive definitions
*/
-typedef struct _LINE_F2 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short x1,y1;
+typedef struct _LINE_F2
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short x1,y1;
} LINE_F2;
-typedef struct _LINE_G2 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char r1,g1,b1,p1;
- short x1,y1;
+typedef struct _LINE_G2
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char r1,g1,b1,p1;
+ short x1,y1;
} LINE_G2;
-typedef struct _LINE_F3 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short x1,y1;
- short x2,y2;
- unsigned int pad;
+typedef struct _LINE_F3
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short x1,y1;
+ short x2,y2;
+ u_long pad; /* actually a terminator for line loops */
} LINE_F3;
-typedef struct _LINE_G3 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char r1,g1,b1,p1;
- short x1,y1;
- unsigned char r2,g2,b2,p2;
- short x2,y2;
- unsigned int pad;
+typedef struct _LINE_G3
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char r1,g1,b1,p1;
+ short x1,y1;
+ u_char r2,g2,b2,p2;
+ short x2,y2;
+ u_long pad; /* actually a terminator for line loops */
} LINE_G3;
-typedef struct _LINE_F4 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short x1,y1;
- short x2,y2;
- short x3,y3;
- unsigned int pad;
+typedef struct _LINE_F4
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short x1,y1;
+ short x2,y2;
+ short x3,y3;
+ u_long pad;
} LINE_F4;
-typedef struct _LINE_G4 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char r1,g1,b1,p1;
- short x1,y1;
- unsigned char r2,g2,b2,p2;
- short x2,y2;
- unsigned char r3,g3,b3,p3;
- short x3,y3;
- unsigned int pad;
+typedef struct _LINE_G4
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char r1,g1,b1,p1;
+ short x1,y1;
+ u_char r2,g2,b2,p2;
+ short x2,y2;
+ u_char r3,g3,b3,p3;
+ short x3,y3;
+ u_long pad;
} LINE_G4;
/*
* Tile and sprite primitive definitions
*/
-typedef struct _TILE {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- short w,h;
+typedef struct _TILE
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ short w,h;
} TILE;
-typedef struct _TILE_1 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
+typedef struct _TILE_1
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
} TILE_1;
-typedef struct _TILE_8 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
+typedef struct _TILE_8
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
} TILE_8;
-typedef struct _TILE_16 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
+typedef struct _TILE_16
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
} TILE_16;
/*
* Sprite primitive definitions
*/
-typedef struct _SPRT {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char u0,v0;
- unsigned short clut;
- unsigned short w,h;
+typedef struct _SPRT
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char u0,v0;
+ u_short clut;
+ u_short w,h;
} SPRT;
-typedef struct _SPRT_8 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char u0,v0;
- unsigned short clut;
+typedef struct _SPRT_8
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char u0,v0;
+ u_short clut;
} SPRT_8;
-typedef struct _SPRT_16 {
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- short x0,y0;
- unsigned char u0,v0;
- unsigned short clut;
+typedef struct _SPRT_16
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ short x0,y0;
+ u_char u0,v0;
+ u_short clut;
} SPRT_16;
/*
* VRAM fill and transfer primitive definitions
*/
-typedef struct _DR_ENV {
- unsigned int tag;
- unsigned int code[15];
+typedef struct _DR_ENV
+{
+ u_long tag;
+ u_long code[15];
} DR_ENV;
-typedef struct _DR_AREA {
- unsigned int tag;
- unsigned int code[2];
+typedef struct _DR_AREA
+{
+ u_long tag;
+ u_long code[2];
} DR_AREA;
-typedef struct _DR_OFFSET {
- unsigned int tag;
- unsigned int code[1];
+typedef struct _DR_OFFSET
+{
+ u_long tag;
+ u_long code[1];
} DR_OFFSET;
-typedef struct _DR_TWIN {
- unsigned int tag;
- unsigned int code[2];
+typedef struct _DR_TWIN
+{
+ u_long tag;
+ u_long code[2];
} DR_TWIN;
-typedef struct _DR_TPAGE {
- unsigned int tag;
- unsigned int code[1];
+typedef struct _DR_TPAGE
+{
+ u_long tag;
+ u_long code[1];
} DR_TPAGE;
-typedef struct _DR_MASK { /* ORIGINAL */
- unsigned int tag;
- unsigned int code[1];
+typedef struct _DR_MASK /* ORIGINAL */
+{
+ u_long tag;
+ u_long code[1];
} DR_MASK;
-typedef struct _FILL { /* ORIGINAL */
- unsigned int tag;
- unsigned char r0,g0,b0,code;
- unsigned short x0,y0; // Note: coordinates must be in 16 pixel steps
- unsigned short w,h;
+typedef struct _FILL /* ORIGINAL */
+{
+ u_long tag;
+ u_char r0,g0,b0,code;
+ u_short x0,y0; // Note: coordinates must be in 16 pixel steps
+ u_short w,h;
} FILL;
-typedef struct _VRAM2VRAM { /* ORIGINAL */
- unsigned int tag;
- unsigned char p0,p1,p2,code;
- unsigned short x0,y0;
- unsigned short x1,y1;
- unsigned short w,h;
- unsigned int nop[4];
+typedef struct _VRAM2VRAM /* ORIGINAL */
+{
+ u_long tag;
+ u_char p0,p1,p2,code;
+ u_short x0,y0;
+ u_short x1,y1;
+ u_short w,h;
+ u_long nop[4];
} VRAM2VRAM;
-// General structs
+/*
+ * General structs
+ */
-typedef struct _RECT {
+typedef struct _RECT
+{
short x,y;
short w,h;
} RECT;
-typedef struct _DISPENV_RAW {
+typedef struct _DISPENV_RAW /* obsolete */
+{
unsigned int vid_mode; // Video mode
short vid_xpos,vid_ypos; // Video position (not framebuffer)
short fb_x,fb_y; // Framebuffer display position
} DISPENV_RAW;
-typedef struct _DISPENV {
+typedef struct _DISPENV
+{
RECT disp;
RECT screen;
char isinter;
@@ -511,24 +545,26 @@ typedef struct _DISPENV {
char pad;
} DISPENV;
-typedef struct _DRAWENV {
- RECT clip; // Drawing area
- short ofs[2]; // GPU draw offset (relative to draw area)
- RECT tw; // Texture window (doesn't do anything atm)
- unsigned short tpage; // Initial tpage value
- unsigned char dtd; // Dither processing flag (simply OR'ed to tpage)
- unsigned char dfe; // Drawing to display area blocked/allowed (simply OR'ed to tpage)
- unsigned char isbg; // Clear draw area if non-zero
- unsigned char r0,g0,b0; // Draw area clear color (if isbg iz nonzero)
- DR_ENV dr_env; // Draw mode packet area (used by PutDrawEnv)
+typedef struct _DRAWENV
+{
+ RECT clip; // Drawing area
+ short ofs[2]; // GPU draw offset (relative to draw area)
+ RECT tw; // Texture window (doesn't do anything atm)
+ u_short tpage; // Initial tpage value
+ u_char dtd; // Dither processing flag (simply OR'ed to tpage)
+ u_char dfe; // Drawing to display area blocked/allowed (simply OR'ed to tpage)
+ u_char isbg; // Clear draw area if non-zero
+ u_char r0,g0,b0; // Draw area clear color (if isbg iz nonzero)
+ DR_ENV dr_env; // Draw mode packet area (used by PutDrawEnv)
} DRAWENV;
-typedef struct _TIM_IMAGE {
- unsigned int mode;
- RECT *crect;
- unsigned int *caddr;
- RECT *prect;
- unsigned int *paddr;
+typedef struct _TIM_IMAGE
+{
+ u_long mode;
+ RECT *crect;
+ u_long *caddr;
+ RECT *prect;
+ u_long *paddr;
} TIM_IMAGE;
@@ -545,7 +581,7 @@ void SetVideoMode(int mode);
int GetODE(void);
-void PutDispEnvRaw(DISPENV_RAW *disp);
+void PutDispEnvRaw(DISPENV_RAW *disp); /* obsolete */
void PutDispEnv(DISPENV *disp);
void PutDrawEnv(DRAWENV *draw);
@@ -560,18 +596,18 @@ void WaitGPUdma(void);
void *VSyncCallback(void (*func)(void));
void *DrawSyncCallback(void (*func)(void));
-void LoadImage(RECT *rect, unsigned int *data);
-void StoreImage(RECT *rect, unsigned int *data);
+void LoadImage(RECT *rect, u_long *data);
+void StoreImage(RECT *rect, u_long *data);
-void ClearOTagR(unsigned int* ot, int n);
-void DrawOTag(unsigned int* ot);
+void ClearOTagR(u_long* ot, int n);
+void DrawOTag(u_long* ot);
void DrawPrim(void *pri);
-void AddPrim(unsigned int* ot, void* pri);
+void AddPrim(u_long* ot, void* pri);
// Function definitions (C)
-int GetTimInfo(unsigned int *tim, TIM_IMAGE *timimg);
+int GetTimInfo(u_long *tim, TIM_IMAGE *timimg); /* ORIGINAL */
DISPENV *SetDefDispEnv(DISPENV *disp, int x, int y, int w, int h);
DRAWENV *SetDefDrawEnv(DRAWENV *draw, int x, int y, int w, int h);
diff --git a/libpsn00b/include/sys/types.h b/libpsn00b/include/sys/types.h
index c412700..aee197e 100644
--- a/libpsn00b/include/sys/types.h
+++ b/libpsn00b/include/sys/types.h
@@ -1,11 +1,21 @@
#ifndef _TYPES_H
#define _TYPES_H
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-typedef unsigned int u_int;
-typedef unsigned long u_long;
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
-typedef unsigned int size_t;
+typedef unsigned int size_t;
+
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
#endif // _TYPES_H \ No newline at end of file