By adding the follwing line, everything seems to work fine :
static void m68k_run_3p(void)
{
struct regstruct *r = ®s;
bool exit = false;
int cycles;
printf ( "run_3p\n" );
retry:
TRY(prb) {
for (;;) {
#ifdef WINUAE_FOR_HATARI
//m68k_dumpstate_file(stderr, NULL);
if (LOG_TRACE_LEVEL(TRACE_CPU_DISASM))
{
int FrameCycles, HblCounterVideo, LineCycles;
Video_GetPosition ( &FrameCycles , &HblCounterVideo
, &LineCycles );
LOG_TRACE_PRINT ( "cpu video_cyc=%6d %3d@%3d : " ,
FrameCycles, LineCycles, HblCounterVideo );
m68k_disasm_file(stderr, m68k_getpc (), NULL, 1);
}
BusErrorPC = m68k_getpc();
currcycle = 0; <-- THIS LINE HERE
#endif
r->instruction_pc = m68k_getpc();
r->opcode = get_iword_cache_040(0);
// "prefetch"
if (regs.cacr & 0x8000)
fill_icache040(r->instruction_pc + 16);
Maybe it should also be added into run_3ce
Nicolas, I let you accept this or not (it may noit be the correct fix).
If it's OK, you can fix it.
Regards
Laurent
Le 28/12/2014 23:13, Laurent Sallafranque a écrit :
I've added the following line into m68k_run_3p() and m68k_run_3ce()
#ifdef WINUAE_FOR_HATARI
/* Run DSP 56k code if necessary */
if (bDspEnabled) {
fprintf(stderr, "currcycle = %d\n", currcycle); <--
this one ;)
DSP_Run(2 * currcycle * 2 / CYCLE_UNIT);
}
#endif
I get a huge value for currcycle, which explain why the DSP runs
all the time.
Currcycle increase all the time to a huge value.
[...]
currcycle = 159398400
currcycle = 159398912
currcycle = 159399424
currcycle = 159399936
currcycle = 159400448
currcycle = 159400960
currcycle = 159401472
currcycle = 159401984
currcycle = 159402496
currcycle = 159403008
currcycle = 159403520
currcycle = 159404032
currcycle = 159404544
currcycle = 159405056
currcycle = 159405568
currcycle = 159406080
currcycle = 159406592
currcycle = 159407104
currcycle = 159407616
currcycle = 159408128
[...]
Maybe it is not reseted or something like that.
Laurent
Le 28/12/2014 22:42, Eero Tamminen a écrit :
Hi,
On perjantai 26 joulukuu 2014, Laurent Sallafranque wrote:
Le 26/12/2014 21:43, Laurent Sallafranque a écrit :
While testing, I've encountered another problem :
I was in Falcon mode, 68030, and I tried to switch to 68060
and hatari got freezed (no more F12, no more reset, ...)
This is fully reproducable even directly from GEM desktop.
If one disables sound (separate SDL thread for it),
this is where Hatari spends its time afterwards:
49.01% 23187 hatari [.] dsp56k_execute_instruction
13.92% 6573 hatari [.] dsp_jclr_pp
13.45% 6361 hatari [.] read_memory
2.91% 1376 hatari [.] DSP_Run
0.00% 1 hatari [.] get_word_cache_040
0.00% 1 hatari [.] do_specialties.isra.34
0.00% 1 hatari [.] do_specialties_interrupt.isra.32
0.00% 1 hatari [.] m68k_run_3p
I.e. Hatari is stuck in DSP emulation.
If I disable DSP emulation at same time I select 060,
CPU switch works fine.
You don't even need to switch CPU, just starting 060+DSP freezes:
$ hatari --tos tos404.img --machine falcon --cpulevel 6
I.e. to use 060, you need to disable DSP:
$ hatari --tos tos404.img --machine falcon --cpulevel 6 --dsp none
- Eero