summaryrefslogtreecommitdiff
path: root/plugins/dfinput
diff options
context:
space:
mode:
authorSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-01-24 13:59:46 +0000
committerSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-01-24 13:59:46 +0000
commite1108dba69ad14fed7bc64f996ea09342c900a81 (patch)
treea3798c4031cce49eeb5964ec9ae49a9627bc5a91 /plugins/dfinput
parent47b0777b946e413500bc0420d91298aa4e8f8301 (diff)
downloadpcsxr-e1108dba69ad14fed7bc64f996ea09342c900a81.tar.gz
Added rewind feature. Currently only supported via GTK and needs SHM. Rewind save state depth is configured via RewindCount config param. Recommended value is 200 or so -> uses less than 1G of memory
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@88433 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfinput')
-rwxr-xr-xplugins/dfinput/cfg-gtk.c5
-rwxr-xr-xplugins/dfinput/cfg.c9
-rwxr-xr-xplugins/dfinput/pad.h1
3 files changed, 13 insertions, 2 deletions
diff --git a/plugins/dfinput/cfg-gtk.c b/plugins/dfinput/cfg-gtk.c
index 7b5df6c2..80443f3a 100755
--- a/plugins/dfinput/cfg-gtk.c
+++ b/plugins/dfinput/cfg-gtk.c
@@ -60,7 +60,8 @@ const char *EmuKeyText[EMU_TOTAL] = {
N_("Load state"),
N_("Save state"),
N_("Screenshot"),
- N_("Escape")
+ N_("Escape"),
+ N_("Rewind")
};
const char *DPadText[DKEY_TOTAL] = {
@@ -403,7 +404,7 @@ static void ReadDKeyEvent(int padnum, int key) {
for (i = 0; i < numAxes; i++) {
axis = SDL_JoystickGetAxis(js, i);
- if (abs(axis) > 16383 && (abs(axis - InitAxisPos[i]) > 4096 || abs(axis - PrevAxisPos[i]) > 4096)) {
+ if (abs(axis) > 16383 && (abs(axis - InitAxisPos[i]) > 4096 || abs(axis - PrevAxisPos[i]) > 4096) && (abs(axis) < 32768)) {
keydef->JoyEvType = AXIS;
keydef->J.Axis = (i + 1) * (axis > 0 ? 1 : -1);
goto end;
diff --git a/plugins/dfinput/cfg.c b/plugins/dfinput/cfg.c
index 6e45a122..2757bd74 100755
--- a/plugins/dfinput/cfg.c
+++ b/plugins/dfinput/cfg.c
@@ -125,6 +125,7 @@ static void SetDefaultConfig() {
g.cfg.E.EmuDef[EMU_INCREMENTSTATE].EmuKeyEvent = XK_F2;
g.cfg.E.EmuDef[EMU_SCREENSHOT].EmuKeyEvent = XK_F8;
g.cfg.E.EmuDef[EMU_ESCAPE].EmuKeyEvent = XK_Escape;
+ g.cfg.E.EmuDef[EMU_REWIND].EmuKeyEvent = XK_BackSpace;
}
void LoadPADConfig() {
@@ -193,6 +194,11 @@ void LoadPADConfig() {
g.cfg.E.EmuDef[EMU_ESCAPE].Mapping.Key = a;
g.cfg.E.EmuDef[EMU_ESCAPE].Mapping.JoyEvType = b;
g.cfg.E.EmuDef[EMU_ESCAPE].Mapping.J.d = c;
+ } else if (strncmp(buf, "EMU_REWIND=", 11) == 0) {
+ sscanf(buf, "EMU_REWIND=%d,%d,%d", &a, &b, &c);
+ g.cfg.E.EmuDef[EMU_REWIND].Mapping.Key = a;
+ g.cfg.E.EmuDef[EMU_REWIND].Mapping.JoyEvType = b;
+ g.cfg.E.EmuDef[EMU_REWIND].Mapping.J.d = c;
} else if (strncmp(buf, "Select=", 7) == 0) {
sscanf(buf, "Select=%d,%d,%d", &a, &b, &c);
g.cfg.PadDef[current].KeyDef[DKEY_SELECT].Key = a;
@@ -428,5 +434,8 @@ void SavePADConfig() {
fprintf(fp, "EMU_ESCAPE=%d,%d,%d\n", g.cfg.E.EmuDef[EMU_ESCAPE].Mapping.Key,
g.cfg.E.EmuDef[EMU_ESCAPE].Mapping.JoyEvType,
g.cfg.E.EmuDef[EMU_ESCAPE].Mapping.J.d);
+ fprintf(fp, "EMU_REWIND=%d,%d,%d\n", g.cfg.E.EmuDef[EMU_REWIND].Mapping.Key,
+ g.cfg.E.EmuDef[EMU_REWIND].Mapping.JoyEvType,
+ g.cfg.E.EmuDef[EMU_REWIND].Mapping.J.d);
fclose(fp);
}
diff --git a/plugins/dfinput/pad.h b/plugins/dfinput/pad.h
index 9e72bf88..205bae41 100755
--- a/plugins/dfinput/pad.h
+++ b/plugins/dfinput/pad.h
@@ -119,6 +119,7 @@ enum {
EMU_SAVESTATE,
EMU_SCREENSHOT,
EMU_ESCAPE,
+ EMU_REWIND,
EMU_TOTAL
};