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

Fix framerate on loadstate #195

Merged
merged 2 commits into from
Sep 15, 2024
Merged
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
18 changes: 17 additions & 1 deletion x68k/crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern int VID_MODE, CHANGEAV_TIMING;

int CRTC_StateAction(StateMem *sm, int load, int data_only)
{
int vidmode, ret;
SFORMAT StateRegs[] =
{
SFARRAY(CRTC_Regs, 48),
Expand Down Expand Up @@ -68,10 +69,25 @@ int CRTC_StateAction(StateMem *sm, int load, int data_only)
SFARRAY(VCReg1, 2),
SFARRAY(VCReg2, 2),

SFVAR(vidmode),

SFEND
};

int ret = PX68KSS_StateAction(sm, load, data_only, StateRegs, "X68K_CRTC_VCTRL", false);
if (!load)
vidmode = VID_MODE;

ret = PX68KSS_StateAction(sm, load, data_only, StateRegs, "X68K_CRTC_VCTRL", false);

if (load)
{
if (VID_MODE != vidmode)
{
CHANGEAV_TIMING = 1;
VID_MODE = vidmode;

}
}

return ret;
}
Expand Down