Skip to content

Rewinding on two keys in Rewinder.lua and disabling unnecessary output #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions output/luaScripts/Rewinder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

--Which key you would like to function as the "rewind key"

local rewindKey = 'select'
local firstRewindKey = 'left'
local secondRewindKey = 'start'


--How much rewind power would you like? (The higher the number the further back in time you can go, but more computer memory is used up)
Expand All @@ -37,7 +38,7 @@ while (true) do
savePreventBuffer = 1;
end;
joyput = joypad.read(1);
if joyput[rewindKey] then
if (joyput[firstRewindKey] and joyput[secondRewindKey]) then
savePreventBuffer = 5;
if rewindCount==0 then
--makes sure you can't go back too far could also include other things in here, left empty for now.
Expand All @@ -51,7 +52,7 @@ while (true) do
end;
end;
if savePreventBuffer==1 then
gui.text(80,15,"");
--gui.text(80,15,"");
saveCount=saveCount+1;
if saveCount==saveMax then
saveCount = 1;
Expand All @@ -64,8 +65,8 @@ while (true) do
savestate.save(save);
saveArray[saveCount] = save;
end;
local HUDMATH = (math.ceil((100/saveMax)*rewindCount));--Making the rewind time a percentage.
local HUDTEXT = "REWIND POWER: ".. HUDMATH .."%";
gui.text(80,5,HUDTEXT);--Displaying the time onscreen.
--local HUDMATH = (math.ceil((100/saveMax)*rewindCount));--Making the rewind time a percentage.
--local HUDTEXT = "REWIND POWER: ".. HUDMATH .."%";
--gui.text(80,5,HUDTEXT);--Displaying the time onscreen.
FCEU.frameadvance();
end;