mirror of https://github.com/stella-emu/stella.git
parent
de5677b4e4
commit
af45bdaa3a
|
@ -717,6 +717,12 @@
|
||||||
<td>F9</td>
|
<td>F9</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Save all states</td>
|
||||||
|
<td>Alt + F9</td>
|
||||||
|
<td>Cmd + F9</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Change current state slot</td>
|
<td>Change current state slot</td>
|
||||||
<td>F10</td>
|
<td>F10</td>
|
||||||
|
@ -729,6 +735,12 @@
|
||||||
<td>F11</td>
|
<td>F11</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Load all states</td>
|
||||||
|
<td>Alt + F11</td>
|
||||||
|
<td>Cmd + F1</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Save PNG snapshot</td>
|
<td>Save PNG snapshot</td>
|
||||||
<td>F12</td>
|
<td>F12</td>
|
||||||
|
@ -1819,6 +1831,8 @@
|
||||||
<tr><td>'Rewind One' button</td><td>Navigates back by one state</td></tr>
|
<tr><td>'Rewind One' button</td><td>Navigates back by one state</td></tr>
|
||||||
<tr><td>'Unwind One' button</td><td>Navigates forward by one state</td></tr>
|
<tr><td>'Unwind One' button</td><td>Navigates forward by one state</td></tr>
|
||||||
<tr><td>'Unwind All' button</td><td>Navigates forward to the end of the timeline</td></tr>
|
<tr><td>'Unwind All' button</td><td>Navigates forward to the end of the timeline</td></tr>
|
||||||
|
<tr><td>'Save All' button</td><td>Saves all states to disk</td></tr>
|
||||||
|
<tr><td>'Load All' button</td><td>Loades all states from disk</td></tr>
|
||||||
<tr><td>Navigation info</td><td>Informs about the interval of the user's last
|
<tr><td>Navigation info</td><td>Informs about the interval of the user's last
|
||||||
Time Machine navigation. The interval can vary if the timeline is compressed.</td></tr>
|
Time Machine navigation. The interval can vary if the timeline is compressed.</td></tr>
|
||||||
<tr><td>Total time</td><td>Shows the total time covered by the save states
|
<tr><td>Total time</td><td>Shows the total time covered by the save states
|
||||||
|
|
|
@ -237,7 +237,10 @@ string RewindManager::saveAllStates()
|
||||||
if (!out)
|
if (!out)
|
||||||
return "Can't save to all states file";
|
return "Can't save to all states file";
|
||||||
|
|
||||||
int numStates = rewindStates(1000) + 1;
|
uInt32 curIdx = getCurrentIdx();
|
||||||
|
rewindStates(1000);
|
||||||
|
uInt32 numStates = uInt32(cyclesList().size());
|
||||||
|
|
||||||
// Save header
|
// Save header
|
||||||
buf.str("");
|
buf.str("");
|
||||||
out.putString(STATE_HEADER);
|
out.putString(STATE_HEADER);
|
||||||
|
@ -245,7 +248,7 @@ string RewindManager::saveAllStates()
|
||||||
out.putInt(myStateSize);
|
out.putInt(myStateSize);
|
||||||
|
|
||||||
unique_ptr<uInt8[]> buffer = make_unique<uInt8[]>(myStateSize);
|
unique_ptr<uInt8[]> buffer = make_unique<uInt8[]>(myStateSize);
|
||||||
for (int i = 0; i < numStates; i++)
|
for (uInt32 i = 0; i < numStates; i++)
|
||||||
{
|
{
|
||||||
RewindState& state = myStateList.current();
|
RewindState& state = myStateList.current();
|
||||||
Serializer& s = state.data;
|
Serializer& s = state.data;
|
||||||
|
@ -260,6 +263,8 @@ string RewindManager::saveAllStates()
|
||||||
if (i < numStates)
|
if (i < numStates)
|
||||||
unwindStates(1);
|
unwindStates(1);
|
||||||
}
|
}
|
||||||
|
// restore old state position
|
||||||
|
rewindStates(numStates - curIdx);
|
||||||
|
|
||||||
buf.str("");
|
buf.str("");
|
||||||
buf << "Saved " << numStates << " states";
|
buf << "Saved " << numStates << " states";
|
||||||
|
@ -287,7 +292,7 @@ string RewindManager::loadAllStates()
|
||||||
return "Can't load from all states file";
|
return "Can't load from all states file";
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
int numStates;
|
uInt32 numStates;
|
||||||
|
|
||||||
// Load header
|
// Load header
|
||||||
buf.str("");
|
buf.str("");
|
||||||
|
@ -298,7 +303,7 @@ string RewindManager::loadAllStates()
|
||||||
myStateSize = in.getInt();
|
myStateSize = in.getInt();
|
||||||
|
|
||||||
unique_ptr<uInt8[]> buffer = make_unique<uInt8[]>(myStateSize);
|
unique_ptr<uInt8[]> buffer = make_unique<uInt8[]>(myStateSize);
|
||||||
for (int i = 0; i < numStates; i++)
|
for (uInt32 i = 0; i < numStates; i++)
|
||||||
{
|
{
|
||||||
if (myStateList.full())
|
if (myStateList.full())
|
||||||
compressStates();
|
compressStates();
|
||||||
|
|
Loading…
Reference in New Issue