X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=6853e30ee726a88032208e6e4c20832d9d91a2f3;hb=6f860c2b80233f3721c08d7fb3e5e37423b84149;hp=f6fe19adbca4d4458d48614b22668afddc7b12ce;hpb=6fe8a1d4501485790b5a58f1a4c62130dd70afb4;p=pcsx_rearmed.git diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index f6fe19ad..6853e30e 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -56,10 +56,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 @@ -90,7 +91,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]);