notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
17ce04c
)
fix some crashes when loading bad state
author
notaz
<notasas@gmail.com>
Thu, 18 Nov 2021 22:33:04 +0000
(
00:33
+0200)
committer
notaz
<notasas@gmail.com>
Thu, 18 Nov 2021 22:33:04 +0000
(
00:33
+0200)
libpcsxcore/psxcounters.c
patch
|
blob
|
blame
|
history
diff --git
a/libpcsxcore/psxcounters.c
b/libpcsxcore/psxcounters.c
index
bd0f09b
..
b2cc07b
100644
(file)
--- a/
libpcsxcore/psxcounters.c
+++ b/
libpcsxcore/psxcounters.c
@@
-502,13
+502,16
@@
s32 psxRcntFreeze( void *f, s32 Mode )
if (Mode == 0)
{
// don't trust things from a savestate
if (Mode == 0)
{
// don't trust things from a savestate
+ rcnts[3].rate = 1;
for( i = 0; i < CounterQuantity; ++i )
{
_psxRcntWmode( i, rcnts[i].mode );
count = (psxRegs.cycle - rcnts[i].cycleStart) / rcnts[i].rate;
_psxRcntWcount( i, count );
}
for( i = 0; i < CounterQuantity; ++i )
{
_psxRcntWmode( i, rcnts[i].mode );
count = (psxRegs.cycle - rcnts[i].cycleStart) / rcnts[i].rate;
_psxRcntWcount( i, count );
}
- hsync_steps = (psxRegs.cycle - rcnts[3].cycleStart) / rcnts[3].target;
+ hsync_steps = 0;
+ if (rcnts[3].target)
+ hsync_steps = (psxRegs.cycle - rcnts[3].cycleStart) / rcnts[3].target;
psxRcntSet();
base_cycle = 0;
psxRcntSet();
base_cycle = 0;