Skip to content

Commit

Permalink
Fix framerate on loadstate (#195)
Browse files Browse the repository at this point in the history
* Fix fra timing when loading state

---------

Co-authored-by: negativeExponent <negativeExponent@users.noreply.github.com>
  • Loading branch information
negativeExponent and negativeExponent authored Sep 15, 2024
1 parent 3f62694 commit b3308b5
Showing 1 changed file with 17 additions and 1 deletion.
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

0 comments on commit b3308b5

Please sign in to comment.