[hatari-devel] Latest Hatari HG version gets stuck sometimes
Eero Tamminen
eerot at users.berlios.de
Wed Jul 8 23:58:35 CEST 2009
Hi,
On Thursday 09 July 2009, Thomas Huth wrote:
> > Saving memory state from a freshly booted & idle GEM and then
> > restoring it with the --memstate option is 100% sure way to trigger
> > the issue for me.
>
> OK, I can reproduce the problem this way. However, I currently don't
> have a clue how to fix it...
> The only trace I've found so far: When I enable --trace all, I see some
> lines like this:
What if you put assert to restoring the interrupt values? Maybe it somehow
gets corrupted already when restore happens in Hatari startup?
Can what the MemorySnapShot_Restore() and Reset_ST() somehow conflict
if it's done while Hatari's still starting?
Does e.g. calling m68k_run_1() change some state that is not saved
(when using --memstate, that's called only after restore)?
> cpu video_cyc= 0 -160256 at 312 : 00fcaa62: 3e15 426d 0004 426d 0008
> MOVE.W (A5),D7
>
> Seems like the "LineCycles" have been calculated wrong...
Btw. I noticed that int.c does (Sint64) casts for the values it gives to
INT_CONVERT_TO_INTERNAL macro (why its not an inline?).
mfp.c calls to that macro don't do casts to 64-bit. "gcc -E" gives
following expanded output on them:
------------
...
int AddCurCycles = ( 1 == 1 ? (CurrentInstrCycles + nWaitStateCycles -
4)*9600 : (CurrentInstrCycles + nWaitStateCycles - 4)*31333 );
if (bFirstTimer)
Int_AddRelativeInterruptWithOffset(TimerClockCycles, 2, Handler,
AddCurCycles);
else
{
int TimerClockCyclesInternal = ( 2 == 1 ? (TimerClockCycles)*9600 :
(TimerClockCycles)*31333 );
if ( PendingCyclesOver > TimerClockCyclesInternal )
PendingCyclesOver = PendingCyclesOver % TimerClockCyclesInternal;
Int_AddRelativeInterruptWithOffset(TimerClockCycles, 2,
Handler, -PendingCyclesOver);
}
...
------------
Can above things overflow?
And on random observation on the code, MFP_ActiveEdge_WriteByte() does
something with INTERRUPT_VIDEO_ENDLINE, not just video.c.
- Eero
More information about the hatari-devel
mailing list