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
Fix reporting for connected or unconnected inputs
[pcsx_rearmed.git]
/
libpcsxcore
/
sio.c
diff --git
a/libpcsxcore/sio.c
b/libpcsxcore/sio.c
index
4a0a73c
..
ae3e634
100644
(file)
--- a/
libpcsxcore/sio.c
+++ b/
libpcsxcore/sio.c
@@
-17,6
+17,8
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
***************************************************************************/
* 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
***************************************************************************/
+#include <compat/fopen_utf8.h>
+
/*
* SIO functions.
*/
/*
* SIO functions.
*/
@@
-117,6
+119,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;
@@
-386,8
+402,10
@@
void sioInterrupt() {
PAD_LOG("Sio Interrupt (CP0.Status = %x)\n", psxRegs.CP0.n.Status);
#endif
// SysPrintf("Sio Interrupt\n");
PAD_LOG("Sio Interrupt (CP0.Status = %x)\n", psxRegs.CP0.n.Status);
#endif
// SysPrintf("Sio Interrupt\n");
- StatReg |= IRQ;
- psxHu32ref(0x1070) |= SWAPu32(0x80);
+ if (!(StatReg & IRQ)) {
+ StatReg |= IRQ;
+ psxHu32ref(0x1070) |= SWAPu32(0x80);
+ }
}
void LoadMcd(int mcd, char *str) {
}
void LoadMcd(int mcd, char *str) {
@@
-407,15
+425,24
@@
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;
}
- f = fopen(str, "rb");
+ if (*str == 0)
+ return;
+
+ f = fopen_utf8(str, "rb");
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
CreateMcd(str);
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
CreateMcd(str);
- f = fopen(str, "rb");
+ f = fopen
_utf8
(str, "rb");
if (f != NULL) {
struct stat buf;
if (f != NULL) {
struct stat buf;
@@
-453,7
+480,10
@@
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;
- f = fopen(mcd, "r+b");
+ if (mcd == NULL || *mcd == 0 || strcmp(mcd, "none") == 0)
+ return;
+
+ f = fopen_utf8(mcd, "r+b");
if (f != NULL) {
struct stat buf;
if (f != NULL) {
struct stat buf;
@@
-490,7
+520,7
@@
void CreateMcd(char *mcd) {
int s = MCD_SIZE;
int i = 0, j;
int s = MCD_SIZE;
int i = 0, j;
- f = fopen(mcd, "wb");
+ f = fopen
_utf8
(mcd, "wb");
if (f == NULL)
return;
if (f == NULL)
return;
@@
-804,7
+834,7
@@
void GetMcdBlockInfo(int mcd, int block, McdBlock *Info) {
strncpy(Info->Name, ptr, 16);
}
strncpy(Info->Name, ptr, 16);
}
-int sioFreeze(
gzFile
f, int Mode) {
+int sioFreeze(
void *
f, int Mode) {
gzfreeze(buf, sizeof(buf));
gzfreeze(&StatReg, sizeof(StatReg));
gzfreeze(&ModeReg, sizeof(ModeReg));
gzfreeze(buf, sizeof(buf));
gzfreeze(&StatReg, sizeof(StatReg));
gzfreeze(&ModeReg, sizeof(ModeReg));