Skip to content
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

Savestates/rsx/IO: Resume emulation on long START press, enable "Start Paused" by defaut #12881

Merged
merged 5 commits into from Oct 29, 2022

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Oct 24, 2022

  • Start emulation but pause on the first frame when loading the savestate.
  • Unpause emulation on long START press on the controller - after holding the start START button for about 1 second, a message appears on the screen that emulation is going to be resumed and you have 2 seconds to release the start button after that so it won't be recognized by the game and adjust the placement of fingers.
FPS_.29.57._.Vulkan._.0.0.24-64201fe4.Alpha._.patch-6._.local_build._.Persona.5.NPUB31848.2022-10-29.15-50-56.mp4

Implements part of #12539

@elad335 elad335 marked this pull request as draft October 24, 2022 23:51
@Megamouse Megamouse added the Savestates Anything that involves savestates label Oct 25, 2022
@elad335 elad335 changed the title Savestates: Enable "Start Paused" by default Savestates/rsx/IO: Enable "Start Paused" by default, unpause emulation on long START press Oct 29, 2022
@elad335
Copy link
Contributor Author

elad335 commented Oct 29, 2022

Implemented emulation unpausing using the START button, implementing part of #12539. This works very well with the new savestate pause state by default.

@elad335 elad335 marked this pull request as ready for review October 29, 2022 04:59
rpcs3/Input/pad_thread.cpp Show resolved Hide resolved
rpcs3/Input/pad_thread.cpp Show resolved Hide resolved
rpcs3/Input/pad_thread.cpp Outdated Show resolved Hide resolved
@elad335 elad335 force-pushed the patch-6 branch 2 times, most recently from 0e9907c to 8620355 Compare October 29, 2022 07:53
@elad335 elad335 changed the title Savestates/rsx/IO: Enable "Start Paused" by default, unpause emulation on long START press Savestates/rsx/IO: Unpause emulation on long START press, enable "Start Paused" by defaut Oct 29, 2022
@Megamouse Megamouse requested a review from kd-11 October 29, 2022 10:45
@elad335 elad335 force-pushed the patch-6 branch 3 times, most recently from 7e9ff9c to 1d5563e Compare October 29, 2022 11:57
rpcs3/Input/pad_thread.cpp Outdated Show resolved Hide resolved
rpcs3/Emu/System.cpp Outdated Show resolved Hide resolved
@elad335 elad335 force-pushed the patch-6 branch 8 times, most recently from 463c2f8 to 33ba25a Compare October 29, 2022 12:53
@elad335 elad335 changed the title Savestates/rsx/IO: Unpause emulation on long START press, enable "Start Paused" by defaut Savestates/rsx/IO: Resume emulation on long START press, enable "Start Paused" by defaut Oct 29, 2022
Comment on lines +442 to +456
rsx::overlays::queue_message(localized_string_id::EMULATION_RESUMING, 2'000'000);

m_resume_emulation_flag = true;

for (u32 i = 0; i < 40; i++)
{
if (!Emu.IsPaused())
{
// Abort if emulation has been resumed by other means
m_resume_emulation_flag = false;
break;
}

thread_ctrl::wait_for(50'000);
rsx::set_native_ui_flip();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these 3 magic numbers should be calculated from a single variable.

@Megamouse Megamouse merged commit c214f45 into RPCS3:master Oct 29, 2022
@elad335 elad335 deleted the patch-6 branch October 30, 2022 06:00
@brian218
Copy link
Contributor

The message "Press and hold the START button to resume" shows up even when the emulator is frozen by a log.fatal() assertion. (e.g. SIG: Thread terminated due to fatal error: Attempting to dealloc rsx memory when the context is still being used)
Is this an expected behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Overlay Savestates Anything that involves savestates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants