[hatari-devel] New DSP trace functions added

Eero Tamminen oak at helsinkinet.fi
Tue Mar 29 22:57:04 CEST 2011


Hi,

On tiistai 29 maaliskuu 2011, Laurent Sallafranque wrote:
> I've added 2 new functions to dsp_disasm :
> 
> dsp_disasm_reg : this shows the state of the concerned register before
> and after the execution of the instruction
> dsp_disasm_mem : this shows the state of the concerned memory address
> before and after the execution of the instruction
> 
> Both of them are working only with dsp_disasm.
> 
> (It would make no sense to display a register or memory change without
> knowing which instruction was executed).
> 
> I've tried to optimize it to have no slowness with the 3 dsp_disasm_xxx
> functions activated when DSP doesn't do anything.

It looks otherwise good, but instead of these:
	if (LogTraceFlags & (TRACE_DSP_DISASM))

You could use the log.h macro for that:
	if (LOG_TRACE_LEVEL(TRACE_DSP_DISASM))

That uses (now) the "unlikely" stuff from main.h which utilizes GCC feature
to tell that this branch is unlikely to be true.

The new write_memory() function could be set inline I think, it has
only couple of lines.



	- Eero



More information about the hatari-devel mailing list