diff options
| author | John Wilbert M. Villamor <lameguy64@gmail.com> | 2021-07-01 11:18:22 +0800 |
|---|---|---|
| committer | John Wilbert M. Villamor <lameguy64@gmail.com> | 2021-07-01 11:18:22 +0800 |
| commit | acc1a959fe3c4bc5d5e91f1f31e182ff967008ca (patch) | |
| tree | 4f08247e6d5768d88202ea91af1806cbece13f55 | |
| parent | 01fe30bd8bae59ab954751b08bcc1d158eff7edb (diff) | |
| download | psn00bsdk-acc1a959fe3c4bc5d5e91f1f31e182ff967008ca.tar.gz | |
Fixed missing type errors when compiling libraries due to the new variable type changes
| -rw-r--r-- | libpsn00b/include/psxgpu.h | 2 | ||||
| -rw-r--r-- | libpsn00b/psxcd/isofs.c | 13 | ||||
| -rw-r--r-- | libpsn00b/psxcd/psxcd.c | 33 | ||||
| -rw-r--r-- | libpsn00b/psxgpu/fntsort.c | 3 | ||||
| -rw-r--r-- | libpsn00b/psxgpu/font.c | 1 | ||||
| -rw-r--r-- | libpsn00b/psxgpu/gettimimage.c | 9 | ||||
| -rw-r--r-- | libpsn00b/psxgpu/setdefdispenv.c | 1 | ||||
| -rw-r--r-- | libpsn00b/psxgpu/setdefdrawenv.c | 1 |
8 files changed, 35 insertions, 28 deletions
diff --git a/libpsn00b/include/psxgpu.h b/libpsn00b/include/psxgpu.h index ac6d98b..ddb4522 100644 --- a/libpsn00b/include/psxgpu.h +++ b/libpsn00b/include/psxgpu.h @@ -615,7 +615,7 @@ DRAWENV *SetDefDrawEnv(DRAWENV *draw, int x, int y, int w, int h); // Debug font functions void FntLoad(int x, int y); -char *FntSort(unsigned int *ot, char *pri, int x, int y, const char *text); +char *FntSort(u_long *ot, char *pri, int x, int y, const char *text); int FntOpen(int x, int y, int w, int h, int isbg, int n); int FntPrint(int id, const char *fmt, ...); char *FntFlush(int id); diff --git a/libpsn00b/psxcd/isofs.c b/libpsn00b/psxcd/isofs.c index 0122609..dc0c5ca 100644 --- a/libpsn00b/psxcd/isofs.c +++ b/libpsn00b/psxcd/isofs.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <stdio.h> #include <malloc.h> #include <string.h> @@ -11,8 +12,8 @@ typedef struct _CdlDIR_INT { - u_int _pos; - u_int _len; + u_long _pos; + u_long _len; u_char* _dir; } CdlDIR_INT; @@ -81,7 +82,7 @@ static int _CdReadIsoDescriptor(int session_offs) printf("psxcd: Read sectors.\n"); #endif // Read volume descriptor - CdRead(1, (u_int*)_cd_iso_descriptor_buff, CdlModeSpeed); + CdRead(1, (u_long*)_cd_iso_descriptor_buff, CdlModeSpeed); if( CdReadSync(0, 0) ) { @@ -127,7 +128,7 @@ static int _CdReadIsoDescriptor(int session_offs) // Read path table CdIntToPos(descriptor->pathTable1Offs, &loc); CdControl(CdlSetloc, (u_char*)&loc, 0); - CdRead(i>>11, (u_int*)_cd_iso_pathtable_buff, CdlModeSpeed); + CdRead(i>>11, (u_long*)_cd_iso_pathtable_buff, CdlModeSpeed); if( CdReadSync(0, 0) ) { #ifdef DEBUG @@ -177,7 +178,7 @@ static int _CdReadIsoDirectory(int lba) // Read first sector of directory record _cd_iso_directory_buff = (u_char*)malloc(2048); - CdRead(1, (u_int*)_cd_iso_directory_buff, CdlModeSpeed); + CdRead(1, (u_long*)_cd_iso_directory_buff, CdlModeSpeed); if( CdReadSync(0, 0) ) { #ifdef DEBUG @@ -213,7 +214,7 @@ static int _CdReadIsoDirectory(int lba) printf("psxcd_dbg: Allocated %d bytes for directory record.\n", i); #endif - CdRead(i>>11, (u_int*)_cd_iso_directory_buff, CdlModeSpeed); + CdRead(i>>11, (u_long*)_cd_iso_directory_buff, CdlModeSpeed); if( CdReadSync(0, 0) ) { #ifdef DEBUG diff --git a/libpsn00b/psxcd/psxcd.c b/libpsn00b/psxcd/psxcd.c index 76a8eba..74c6c1c 100644 --- a/libpsn00b/psxcd/psxcd.c +++ b/libpsn00b/psxcd/psxcd.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <stdio.h> #include <psxgpu.h> #include "psxcd.h" @@ -5,16 +6,16 @@ #define READ_TIMEOUT 600 // 10 seconds for NTSC extern volatile char _cd_ack_wait; -extern volatile unsigned char _cd_last_int; -extern volatile unsigned char _cd_last_mode; -extern volatile unsigned char _cd_status; +extern volatile u_char _cd_last_int; +extern volatile u_char _cd_last_mode; +extern volatile u_char _cd_status; extern volatile CdlCB _cd_callback_int1_data; -volatile unsigned char *_cd_result_ptr; +volatile u_char *_cd_result_ptr; // For read retry volatile CdlLOC _cd_last_setloc; -volatile unsigned int *_cd_last_read_addr; +volatile u_long *_cd_last_read_addr; volatile int _cd_last_sector_count; int _cd_media_changed; @@ -233,11 +234,11 @@ int CdMode(void) // CD data read routines volatile int _cd_sector_count = 0; -volatile unsigned int *_cd_read_addr; -volatile unsigned char _cd_read_result[8]; -volatile unsigned int _cd_read_oldcb; -volatile unsigned int _cd_read_sector_sz; -volatile unsigned int _cd_read_counter; +volatile u_long *_cd_read_addr; +volatile u_char _cd_read_result[8]; +volatile u_long _cd_read_oldcb; +volatile u_long _cd_read_sector_sz; +volatile u_long _cd_read_counter; @@ -278,7 +279,7 @@ static void _CdReadReadyCallback(int status, unsigned char *result) } } -int CdRead(int sectors, unsigned int *buf, int mode) +int CdRead(int sectors, u_long *buf, int mode) { // Set sectors to read count _cd_sector_count = sectors; @@ -306,10 +307,10 @@ int CdRead(int sectors, unsigned int *buf, int mode) _cd_read_oldcb = CdReadyCallback(_CdReadReadyCallback); // Set specified mode - CdControl(CdlSetmode, (unsigned char*)&mode, 0); + CdControl(CdlSetmode, (u_char*)&mode, 0); // Begin reading sectors - CdControl(CdlReadN, 0, (unsigned char*)_cd_read_result); + CdControl(CdlReadN, 0, (u_char*)_cd_read_result); return 0; } @@ -335,10 +336,10 @@ static void CdDoRetry() // Retry read CdControl(CdlSetloc, (void*)&_cd_last_setloc, 0); - CdControl(CdlReadN, 0, (unsigned char*)_cd_read_result); + CdControl(CdlReadN, 0, (u_char*)_cd_read_result); } -int CdReadSync(int mode, unsigned char *result) +int CdReadSync(int mode, u_char *result) { if( (VSync(-1)-_cd_read_counter) > READ_TIMEOUT ) { @@ -370,7 +371,7 @@ int CdReadSync(int mode, unsigned char *result) return 0; } -unsigned int CdReadCallback(CdlCB func) +u_long CdReadCallback(CdlCB func) { unsigned int old_func; diff --git a/libpsn00b/psxgpu/fntsort.c b/libpsn00b/psxgpu/fntsort.c index 3890ebb..9358793 100644 --- a/libpsn00b/psxgpu/fntsort.c +++ b/libpsn00b/psxgpu/fntsort.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <stdio.h> #include <ctype.h> #include <psxgpu.h> @@ -5,7 +6,7 @@ extern unsigned short _font_tpage; extern unsigned short _font_clut; -char *FntSort(unsigned int *ot, char *pri, int x, int y, const char *text) { +char *FntSort(u_long *ot, char *pri, int x, int y, const char *text) { DR_TPAGE *tpage; SPRT_8 *sprt = (SPRT_8*)pri; diff --git a/libpsn00b/psxgpu/font.c b/libpsn00b/psxgpu/font.c index cd4acab..8be04a3 100644 --- a/libpsn00b/psxgpu/font.c +++ b/libpsn00b/psxgpu/font.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <stdio.h> #include <string.h> #include <malloc.h> diff --git a/libpsn00b/psxgpu/gettimimage.c b/libpsn00b/psxgpu/gettimimage.c index 49ce8e9..d9cf1bf 100644 --- a/libpsn00b/psxgpu/gettimimage.c +++ b/libpsn00b/psxgpu/gettimimage.c @@ -1,8 +1,9 @@ +#include <sys/types.h> #include <psxgpu.h> -int GetTimInfo(unsigned int *tim, TIM_IMAGE *timimg) { +int GetTimInfo(u_long *tim, TIM_IMAGE *timimg) { - unsigned int *rtim; + u_long *rtim; // Check ID if( ( tim[0]&0xff ) != 0x10 ) { @@ -21,7 +22,7 @@ int GetTimInfo(unsigned int *tim, TIM_IMAGE *timimg) { if( timimg->mode & 0x8 ) { timimg->crect = (RECT*)(rtim+1); - timimg->caddr = (unsigned int*)(rtim+3); + timimg->caddr = (u_long*)(rtim+3); rtim += rtim[0]>>2; @@ -32,7 +33,7 @@ int GetTimInfo(unsigned int *tim, TIM_IMAGE *timimg) { } timimg->prect = (RECT*)(rtim+1); - timimg->paddr = (unsigned int*)(rtim+3); + timimg->paddr = (u_long*)(rtim+3); return 0; diff --git a/libpsn00b/psxgpu/setdefdispenv.c b/libpsn00b/psxgpu/setdefdispenv.c index 6dec49c..2d7b2b4 100644 --- a/libpsn00b/psxgpu/setdefdispenv.c +++ b/libpsn00b/psxgpu/setdefdispenv.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <psxgpu.h> DISPENV *SetDefDispEnv(DISPENV *disp, int x, int y, int w, int h) { diff --git a/libpsn00b/psxgpu/setdefdrawenv.c b/libpsn00b/psxgpu/setdefdrawenv.c index bcd93ca..6fd6086 100644 --- a/libpsn00b/psxgpu/setdefdrawenv.c +++ b/libpsn00b/psxgpu/setdefdrawenv.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <psxgpu.h> DRAWENV *SetDefDrawEnv(DRAWENV *draw, int x, int y, int w, int h) { |
