X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=b3dfdf5334682cef98b250a5b7ea7ae6f7cf1698;hb=415213c97e0e35ea392114c71d8a10371c64d6fd;hp=7aa4fef24b91a55b06b2d6f5aa65d9e8c6c0881d;hpb=96c6ec7055ecef55b3dd221c86b796512bf52107;p=pcsx_rearmed.git diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 7aa4fef2..b3dfdf53 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -55,10 +55,11 @@ struct iso_directory_record { char name [1]; }; -void mmssdd( char *b, char *p ) +static void mmssdd( char *b, char *p ) { int m, s, d; - int block = SWAP32(*((uint32_t*) b)); + unsigned char *ub = (void *)b; + int block = (ub[3] << 24) | (ub[2] << 16) | (ub[1] << 8) | ub[0]; block += 150; m = block / 4500; // minutes @@ -89,7 +90,7 @@ void mmssdd( char *b, char *p ) time[0] = itob(time[0]); time[1] = itob(time[1]); time[2] = itob(time[2]); #define READTRACK() \ - if (CDR_readTrack(time) == -1) return -1; \ + if (!CDR_readTrack(time)) return -1; \ buf = (void *)CDR_getBuffer(); \ if (buf == NULL) return -1; \ else CheckPPFCache((u8 *)buf, time[0], time[1], time[2]);