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/demos | |
| 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/demos')
| -rw-r--r-- | examples/demos/n00bdemo/disp.c | 3 | ||||
| -rw-r--r-- | examples/demos/n00bdemo/disp.h | 3 | ||||
| -rw-r--r-- | examples/demos/n00bdemo/lightdemo.c | 1 | ||||
| -rw-r--r-- | examples/demos/n00bdemo/logo.c | 33 | ||||
| -rw-r--r-- | examples/demos/n00bdemo/main.c | 17 | ||||
| -rw-r--r-- | examples/demos/n00bdemo/smd.h | 4 |
6 files changed, 34 insertions, 27 deletions
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); |
