notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #545 from gameblabla/icache_emulation
[pcsx_rearmed.git]
/
libpcsxcore
/
sio.c
diff --git
a/libpcsxcore/sio.c
b/libpcsxcore/sio.c
index
c2390bf
..
8392fd8
100644
(file)
--- a/
libpcsxcore/sio.c
+++ b/
libpcsxcore/sio.c
@@
-24,6
+24,10
@@
#include "sio.h"
#include <sys/stat.h>
#include "sio.h"
#include <sys/stat.h>
+#ifdef USE_LIBRETRO_VFS
+#include <streams/file_stream_transforms.h>
+#endif
+
// Status Flags
#define TX_RDY 0x0001
#define RX_RDY 0x0002
// Status Flags
#define TX_RDY 0x0001
#define RX_RDY 0x0002
@@
-450,7
+454,12
@@
void LoadMcd(int mcd, char *str) {
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
- fread(data, 1, MCD_SIZE, f);
+ if (fread(data, 1, MCD_SIZE, f) != MCD_SIZE) {
+#ifndef NDEBUG
+ SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__);
+#endif
+ memset(data, 0x00, MCD_SIZE);
+ }
fclose(f);
}
else
fclose(f);
}
else
@@
-465,7
+474,12
@@
void LoadMcd(int mcd, char *str) {
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
- fread(data, 1, MCD_SIZE, f);
+ if (fread(data, 1, MCD_SIZE, f) != MCD_SIZE) {
+#ifndef NDEBUG
+ SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__);
+#endif
+ memset(data, 0x00, MCD_SIZE);
+ }
fclose(f);
}
}
fclose(f);
}
}