X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=6f595792de2889b2a6ad9611d58ea81ecf262eb6;hb=5ffd1f23eb970679dfe8b540bc3df8e776dc9e17;hp=7555ad2cc54750d796c962b24e539d0099cd1de9;hpb=6e1725abbbe25119c48d9da71b53a6647eeac6cf;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 7555ad2c..6f595792 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -25,6 +25,9 @@ #include "cdriso.h" #include "ppf.h" +#include +#include + #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include @@ -36,8 +39,6 @@ #include #include #endif -#include -#include #define OFF_T_MSB ((off_t)1 << (sizeof(off_t) * 8 - 1)) @@ -564,20 +565,15 @@ static int parsecue(const char *isofile) { if (t != 1) sscanf(linebuf, " FILE %255s", tmpb); - // absolute path? - ti[numtracks + 1].handle = fopen(tmpb, "rb"); - if (ti[numtracks + 1].handle == NULL) { - // relative to .cue? - tmp = strrchr(tmpb, '\\'); - if (tmp == NULL) - tmp = strrchr(tmpb, '/'); - if (tmp != NULL) - tmp++; - else - tmp = tmpb; - strncpy(incue_fname, tmp, incue_max_len); - ti[numtracks + 1].handle = fopen(filepath, "rb"); - } + tmp = strrchr(tmpb, '\\'); + if (tmp == NULL) + tmp = strrchr(tmpb, '/'); + if (tmp != NULL) + tmp++; + else + tmp = tmpb; + strncpy(incue_fname, tmp, incue_max_len); + ti[numtracks + 1].handle = fopen(filepath, "rb"); // update global offset if this is not first file in this .cue if (numtracks + 1 > 1) { @@ -1093,7 +1089,7 @@ static int cdread_sub_mixed(FILE *f, unsigned int base, void *dest, int sector) return ret; } -static int uncomp2(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; @@ -1173,7 +1169,7 @@ static int cdread_compressed(FILE *f, unsigned int base, void *dest, int sector) if (is_compressed) { cdbuffer_size_expect = sizeof(compr_img->buff_raw[0]) << compr_img->block_shift; cdbuffer_size = cdbuffer_size_expect; - ret = uncomp2(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size); + ret = uncompress2_pcsx(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size); if (ret != 0) { SysPrintf("uncompress failed with %d for block %d, sector %d\n", ret, block, sector);