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
try to cleanup the mess in the input code
[pcsx_rearmed.git]
/
frontend
/
libretro.c
diff --git
a/frontend/libretro.c
b/frontend/libretro.c
index
519aa1b
..
8d6b5cc
100644
(file)
--- a/
frontend/libretro.c
+++ b/
frontend/libretro.c
@@
-29,7
+29,6
@@
#include "../libpcsxcore/r3000a.h"
#include "../plugins/dfsound/out.h"
#include "../plugins/dfsound/spu_config.h"
#include "../libpcsxcore/r3000a.h"
#include "../plugins/dfsound/out.h"
#include "../plugins/dfsound/spu_config.h"
-#include "../plugins/dfinput/externals.h"
#include "cspace.h"
#include "main.h"
#include "menu.h"
#include "cspace.h"
#include "main.h"
#include "menu.h"
@@
-514,7
+513,7
@@
void plat_trigger_vibrate(int pad, int low, int high)
}
}
}
}
-void pl_
update_gun(int *xn, int *yn, int *xres, int *yres, int *in
)
+void pl_
gun_byte2(int port, unsigned char byte
)
{
}
{
}
@@
-991,12
+990,13
@@
void retro_cheat_reset(void)
void retro_cheat_set(unsigned index, bool enabled, const char *code)
{
void retro_cheat_set(unsigned index, bool enabled, const char *code)
{
-
char buf[256]
;
-
int ret
;
+
int ret = -1
;
+
char *buf
;
- // cheat funcs are destructive, need a copy..
- strncpy(buf, code, sizeof(buf));
- buf[sizeof(buf) - 1] = 0;
+ // cheat funcs are destructive, need a copy...
+ buf = strdup(code);
+ if (buf == NULL)
+ goto finish;
//Prepare buffered cheat for PCSX's AddCheat fucntion.
int cursor = 0;
//Prepare buffered cheat for PCSX's AddCheat fucntion.
int cursor = 0;
@@
-1022,10
+1022,12
@@
void retro_cheat_set(unsigned index, bool enabled, const char *code)
else
ret = AddCheat("", buf);
else
ret = AddCheat("", buf);
+finish:
if (ret != 0)
SysPrintf("Failed to set cheat %#u\n", index);
else if (index < NumCheats)
Cheats[index].Enabled = enabled;
if (ret != 0)
SysPrintf("Failed to set cheat %#u\n", index);
else if (index < NumCheats)
Cheats[index].Enabled = enabled;
+ free(buf);
}
// just in case, maybe a win-rt port in the future?
}
// just in case, maybe a win-rt port in the future?
@@
-1948,18
+1950,13
@@
static void update_variables(bool in_flight)
{
R3000Acpu *prev_cpu = psxCpu;
{
R3000Acpu *prev_cpu = psxCpu;
-#if defined(LIGHTREC)
- bool can_use_dynarec = found_bios;
-#else
- bool can_use_dynarec = 1;
-#endif
#ifdef _3DS
if (!__ctr_svchax)
Config.Cpu = CPU_INTERPRETER;
else
#endif
#ifdef _3DS
if (!__ctr_svchax)
Config.Cpu = CPU_INTERPRETER;
else
#endif
- if (strcmp(var.value, "disabled") == 0
|| !can_use_dynarec
)
+ if (strcmp(var.value, "disabled") == 0)
Config.Cpu = CPU_INTERPRETER;
else if (strcmp(var.value, "enabled") == 0)
Config.Cpu = CPU_DYNAREC;
Config.Cpu = CPU_INTERPRETER;
else if (strcmp(var.value, "enabled") == 0)
Config.Cpu = CPU_DYNAREC;