[hatari-devel] Lower emulation ressources in 68000 cycle exact mode |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi
I just pushed some changes to do_cycles_ce() to require a little less
cpu ressource. This function is called after every cpu instruction is
emulated, so even small optimisations can have positive effects.
In the case of the Amiga and WinUAE, emulation needs to update other
components (blitter, video, audio, ...) every 2 cycles during the
emulation of each cpu instruction.
In the case of Hatari when emulating STF/STE machines, this is not
required. So we can replace this loop :
while ( <n times> )
do_cycles ( 1 * CYCLE_UNIT );
with :
do_cycles ( n * CYCLE_UNIT);
From a quick benchmark when running some demos, I go from ~134 emulated
VBL/s to 143.3 VBL/s, which gives 7% increase in emulation speed.
It's only when running in STE mode and blitter is enabled that we use
the slower "sub cycle" version to emulate that part of the last cpu
instruction can run in parallel with the blitter.
Nicolas