Re: [hatari-devel] Getting cycles used by previous or next instruction without modifying CPU state?

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


On 22/02/2012 21:40, Eero Tamminen wrote:
Hi,

On keskiviikko 22 helmikuu 2012, Nicolas Pomarède wrote:
Only the current instruction cycles are available.

   From where?

Well, it's almost everywhere in the traces I added in various parts :)
->  CurrentInstrCycles

Should nWaitStateCycles be added to that?

Yes, it is added in Cycles_GetCounterOnReadAccess / Cycles_GetCounterOnWriteAccess, but nWaitStateCycles is not 68000 related, it depends on other componnents of the ST, so it is not counted directly in CurrentInstrCycles.



This is for the profiler.  If it cannot get the cycles either for
previous or next instruction without modifying/invalidating CPU state,

Profiler callback is called after the instruction has been executed,
that's why I used term "previous".

Is CurrentInstrCycles about the instruction that was just executed?
If yes, then it's perfect. :-)

In the case of read/write access to IO register, CurrentInstrCycles is the number of cycles of the current instruction that is actually accessing the IO. Have a look at m68k_run, that's were it's handled, you should be able to see if it fits your need.

Nicolas



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