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
gpu_neon: fix another abi violation
[pcsx_rearmed.git]
/
libpcsxcore
/
sio.c
diff --git
a/libpcsxcore/sio.c
b/libpcsxcore/sio.c
index
ea96e95
..
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
@@
-117,6
+121,20
@@
void sioWrite8(unsigned char value) {
break;
}
}
break;
}
}
+ // NegCon - Wipeout 3
+ if( buf[parp] == 0x23 ) {
+ switch (value) {
+ // enter config mode
+ case 0x43:
+ buf[1] = 0x79;
+ break;
+
+ // get status
+ case 0x45:
+ buf[1] = 0xf3;
+ break;
+ }
+ }
}
else padst = 0;
return;
}
else padst = 0;
return;
@@
-409,10
+427,19
@@
void LoadMcd(int mcd, char *str) {
}
McdDisable[mcd - 1] = 0;
}
McdDisable[mcd - 1] = 0;
- if (str == NULL || *str == 0) {
+#ifdef HAVE_LIBRETRO
+ // memcard1 is handled by libretro
+ if (mcd == 1)
+ return;
+#endif
+
+ if (str == NULL || strcmp(str, "none") == 0) {
McdDisable[mcd - 1] = 1;
return;
}
McdDisable[mcd - 1] = 1;
return;
}
+ if (*str == 0)
+ return;
+
f = fopen(str, "rb");
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
f = fopen(str, "rb");
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
@@
-427,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
@@
-442,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);
}
}
@@
-455,6
+492,9
@@
void LoadMcds(char *mcd1, char *mcd2) {
void SaveMcd(char *mcd, char *data, uint32_t adr, int size) {
FILE *f;
void SaveMcd(char *mcd, char *data, uint32_t adr, int size) {
FILE *f;
+ if (mcd == NULL || *mcd == 0 || strcmp(mcd, "none") == 0)
+ return;
+
f = fopen(mcd, "r+b");
if (f != NULL) {
struct stat buf;
f = fopen(mcd, "r+b");
if (f != NULL) {
struct stat buf;