-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add Frame Advance #8939
Add Frame Advance #8939
Changes from 1 commit
842a29b
e208eff
4ab71eb
c726691
f090551
8c96e92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,10 +70,22 @@ | |
#include "Windows/MainWindow.h" | ||
#endif | ||
|
||
bool frameStep_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should -[Unknown] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just decided to always reset it without making it part of EmuScreen. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, but in that case they should be -[Unknown] |
||
|
||
static void __EmuScreenVblank() | ||
{ | ||
if (frameStep_) | ||
{ | ||
frameStep_ = false; | ||
Core_EnableStepping(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, in This will be once per displayed frame though, so importantly:
-[Unknown] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't get it to update the screen properly while frame advancing. |
||
} | ||
} | ||
|
||
EmuScreen::EmuScreen(const std::string &filename) | ||
: bootPending_(true), gamePath_(filename), invalid_(true), quit_(false), pauseTrigger_(false), saveStatePreviewShownTime_(0.0), saveStatePreview_(nullptr) { | ||
memset(axisState_, 0, sizeof(axisState_)); | ||
saveStateSlot_ = SaveState::GetCurrentSlot(); | ||
__DisplayListenVblank(__EmuScreenVblank); | ||
} | ||
|
||
void EmuScreen::bootGame(const std::string &filename) { | ||
|
@@ -174,7 +186,7 @@ void EmuScreen::bootComplete() { | |
NOTICE_LOG(BOOT, "Loading %s...", PSP_CoreParameter().fileToStart.c_str()); | ||
autoLoad(); | ||
|
||
I18NCategory *sc = GetI18NCategory("Screen"); | ||
I18NCategory *sc = GetI18NCategory("Screen"); | ||
|
||
#ifndef MOBILE_DEVICE | ||
if (g_Config.bFirstRun) { | ||
|
@@ -341,7 +353,7 @@ bool EmuScreen::touch(const TouchInput &touch) { | |
} | ||
|
||
void EmuScreen::onVKeyDown(int virtualKeyCode) { | ||
I18NCategory *sc = GetI18NCategory("Screen"); | ||
I18NCategory *sc = GetI18NCategory("Screen"); | ||
|
||
switch (virtualKeyCode) { | ||
case VIRTKEY_UNTHROTTLE: | ||
|
@@ -363,6 +375,19 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) { | |
pauseTrigger_ = true; | ||
break; | ||
|
||
case VIRTKEY_FRAME_ADVANCE: | ||
// If game is running, pause emulation immediately. Otherwise, advance a single frame. | ||
if (Core_IsStepping()) | ||
{ | ||
frameStep_ = true; | ||
Core_EnableStepping(false); | ||
} | ||
else if (!frameStep_) | ||
{ | ||
Core_EnableStepping(true); | ||
} | ||
break; | ||
|
||
case VIRTKEY_AXIS_SWAP: | ||
KeyMap::SwapAxis(); | ||
break; | ||
|
@@ -778,7 +803,7 @@ void EmuScreen::update(InputState &input) { | |
} | ||
|
||
float delta_y = tiltInputCurve(normalized_input_y * 2.0 * (g_Config.iTiltSensitivityY)) ; | ||
|
||
if (g_Config.bInvertTiltY) { | ||
delta_y *= -1; | ||
} | ||
|
@@ -787,7 +812,7 @@ void EmuScreen::update(InputState &input) { | |
leftstick_x += clamp1(delta_x); | ||
__CtrlSetAnalogX(clamp1(leftstick_x), CTRL_STICK_LEFT); | ||
|
||
|
||
leftstick_y += clamp1(delta_y); | ||
__CtrlSetAnalogY(clamp1(leftstick_y), CTRL_STICK_LEFT); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Right now it looks like once you start advancing, you're "trapped" into advancing. In fact, if
frameStep_
isn't a member of EmuScreen, restarting the game won't even help. That sounds dangerous, and doubly dangerous if we have a default key shortcut for the feature.Maybe we should only have it enabled if you configure a key for it?
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get out of advancing, you can use F8 to resume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best just remove default mapping, it's not a feature that most users will ever care about and does not need a default key. Even worse in place where most people would set their controls when using keyboards which many does even through gamepads are cheap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, I thought it kept the flag set that it was advancing frame by frame for some reason. But good to remove the default still, indeed.
-[Unknown]