X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fcdrcimg%2Fcdrcimg.c;h=047357ac3519854e994e844c025e1ece2ccee6f0;hb=78de2879b23476890019dd434178b463b649da17;hp=e327500114cde624c9f2b9524b59179aa81de420;hpb=c979c3ee0d0bc6bece799a6f4013993d7cb2d5f3;p=pcsx_rearmed.git diff --git a/plugins/cdrcimg/cdrcimg.c b/plugins/cdrcimg/cdrcimg.c index e3275001..047357ac 100644 --- a/plugins/cdrcimg/cdrcimg.c +++ b/plugins/cdrcimg/cdrcimg.c @@ -12,11 +12,15 @@ #include #include #include -#include +#if !defined(_WIN32) && !defined(NO_DYLIB) #include +#endif #include "cdrcimg.h" +#undef CALLBACK +#define CALLBACK + #define PFX "cdrcimg: " #define err(f, ...) fprintf(stderr, PFX f, ##__VA_ARGS__) @@ -45,12 +49,12 @@ static struct { static int current_block, current_sect_in_blk; struct CdrStat; -extern long CDR__getStatus(struct CdrStat *stat); +extern long CALLBACK CDR__getStatus(struct CdrStat *stat); struct CdrStat { - unsigned long Type; - unsigned long Status; + unsigned int Type; + unsigned int Status; unsigned char Time[3]; // current playing time }; @@ -93,7 +97,7 @@ static long CDRgetTD(unsigned char track, unsigned char *buffer) return 0; } -int uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size) +static int uncompress2_pcsx(void *out, unsigned long *out_size, void *in, unsigned long in_size) { static z_stream z; int ret = 0; @@ -194,7 +198,7 @@ static long CDRreadTrack(unsigned char *time) ret = uncompress(cdbuffer->raw[0], &cdbuffer_size, cdbuffer->compressed, size); break; case CDRC_ZLIB2: - ret = uncompress2(cdbuffer->raw[0], &cdbuffer_size, cdbuffer->compressed, size); + ret = uncompress2_pcsx(cdbuffer->raw[0], &cdbuffer_size, cdbuffer->compressed, size); break; case CDRC_BZ: ret = pBZ2_bzBuffToBuffDecompress((char *)cdbuffer->raw, (unsigned int *)&cdbuffer_size, @@ -280,6 +284,7 @@ static long CDRinit(void) return -1; } } +#if !defined(_WIN32) && !defined(NO_DYLIB) if (pBZ2_bzBuffToBuffDecompress == NULL) { void *h = dlopen("/usr/lib/libbz2.so.1", RTLD_LAZY); if (h == NULL) @@ -292,6 +297,7 @@ static long CDRinit(void) } } } +#endif return 0; } @@ -408,6 +414,8 @@ static long CDRopen(void) char *ext; FILE *f = NULL; + printf("%s cd_file=%d\n", __func__, cd_file == NULL ? 0 : 1); + if (cd_file != NULL) return 0; // it's already open