Re: [hatari-devel] WinUAE core freeze with ST emulation

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


OK, I've finaly found it : it's in m68000.c

/**
 * Reset CPU 68000 variables
 */
void M68000_Reset(bool bCold)
{
    /* Clear registers */
    if (bCold)
    {
        memset(&regs, 0, sizeof(regs));
    }


The memset clears the regs (and spcflags is into this structure).

It's because we come from change.c which calls Reset_Cold();

Should I change the reset cold by a reset warm or add some ifs to avoid the problem ? (This may complexify the understanding of the code).

Laurent





Le 16/01/2012 22:00, Thomas Huth a écrit :
Am Mon, 16 Jan 2012 00:18:43 +0100
schrieb Laurent Sallafranque<laurent.sallafranque@xxxxxxx>:

If I boot with "--machine falcon --tos etos512k.img" and in
the settings select ST / 68000 / 8Mhz / TOS 1.02, them the old TOS
boots up fine too without saving settings, even with prefetch
enabled.
It's only by luck, as the wrong CPU is running after the reboot.

As I explained before, changing of CPU in the GUI makes the code run
into newcpu.c:check_prefs_changed_cpu (void)
and at the end of the function, it goes to

      if (changed)
          set_special (SPCFLAG_BRK);


But when the code returns to the running CPU (like m68k_run_1 (void),
m68k_run_2 (void), ...) the value of SPCFLAG_BRK is back to 0 and the
program doesn't return to m68k_go (that's where the change of CPU
occurs).

I haven't managed to find this problem, and it's quite annoying. Some
help would be appreciate on this one.
I remember having some similar problems a couple of years ago with the
uae-cpu core. Some quick observations:

1)
- check_prefs_changed_cpu() in uae-cpu/hatari-glue.c sets SPCFLAG_MODE_CHANGE
- check_prefs_changed_cpu() in cpu/newcpu.c sets SPCFLAG_BRK

2)
- uae-cpu/newcpu.c m68k_reset() does:
   regs.spcflags&= ( SPCFLAG_MODE_CHANGE | SPCFLAG_DEBUGGER );
- cpu/newcpu.c m68k_reset() does:
   regs.spcflags = 0;

==>  I guess one of your problems is that m68k_reset() (which is
certainly called when changing the CPU level) clears SPCFLAG_BREAK so
that the m68k_run-loop is never left.

  Thomas







Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/