X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=09aed17d9c6b1dd345b9fd51eeeb965fc5f1d77c;hp=bfa7d7632ac57b2d8f001025e230e696a4654091;hb=e541b8e06ff03a7fe7bd75b1bc0ad53f60b2d0de;hpb=689e0447dd52128f79d4f3a6f90456e56cd459c0 diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index bfa7d763..09aed17d 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -26,14 +26,17 @@ #include "ppf.h" #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN #include #include #define strcasecmp _stricmp +#define usleep(x) Sleep((x) / 1000) #else #include #include #include #endif +#include #include unsigned int cdrIsoMultidiskCount; @@ -551,9 +554,9 @@ static int parsecue(const char *isofile) { pregapOffset = -1; // mark to fill track start_offset } else if (!strcmp(token, "FILE")) { - t = sscanf(linebuf, " FILE \"%256[^\"]\"", tmpb); + t = sscanf(linebuf, " FILE \"%255[^\"]\"", tmpb); if (t != 1) - sscanf(linebuf, " FILE %256s", tmpb); + sscanf(linebuf, " FILE %255s", tmpb); // absolute path? ti[numtracks + 1].handle = fopen(tmpb, "rb"); @@ -794,6 +797,8 @@ static int handlepbp(const char *isofile) { if (ext == NULL || (strcmp(ext, ".pbp") != 0 && strcmp(ext, ".PBP") != 0)) return -1; + fseek(cdHandle, 0, SEEK_SET); + numtracks = 0; ret = fread(&pbp_hdr, 1, sizeof(pbp_hdr), cdHandle); @@ -957,6 +962,8 @@ static int handlecbin(const char *isofile) { if (ext == NULL || (strcasecmp(ext + 1, ".cbn") != 0 && strcasecmp(ext, ".cbin") != 0)) return -1; + fseek(cdHandle, 0, SEEK_SET); + ret = fread(&ciso_hdr, 1, sizeof(ciso_hdr), cdHandle); if (ret != sizeof(ciso_hdr)) { SysPrintf("failed to read ciso header\n"); @@ -1222,6 +1229,8 @@ static long CALLBACK ISOopen(void) { cdHandle = fopen(GetIsoFile(), "rb"); if (cdHandle == NULL) { + SysPrintf(_("Could't open '%s' for reading: %s\n"), + GetIsoFile(), strerror(errno)); return -1; }