we no longer do tight decrement loop to artifically throttle emulation speed.

instead call into a timing function to properly throttle the speed to the target MHz
This commit is contained in:
Aaron Culliney 2013-07-02 01:04:55 -07:00
parent 6c500cad0b
commit c51018a2bb

View File

@ -86,16 +86,12 @@
* is zero, and is inserted into Continue */
#define ZeroOp mov %al, SN(cpu65_debug)+3;
/* The OR actually functions as a move, but we
* want to set the flags and we know %ah is zero */
#define Continue movl SN(cpu65_delay), %eax; \
0: decl %eax; \
jnz 0b; \
orb SN(cpu65__signal), %ah; \
// NOTE: the orb functions as a move, but we want to
// set the flags and we know %ah is zero
#define Continue xorl %eax, %eax; \
orb SN(cpu65__signal), %ah; \
jnz exception; \
ZeroOp \
GetFromPC_B \
jmp *cpu65__opcodes(,%eax,4);
jmp continue;
#define SaveState movw EffectiveAddr, SN(cpu65_debug); \
movw PC_Reg, SN(cpu65_current); \
@ -2460,6 +2456,16 @@ op_XMA_imm:
DoXMA
Continue
/* cpu throttling and continue */
continue: SaveState
pushal
call SN(timing_throttle)
popal
ReplaceState
xorb %ah, %ah
ZeroOp
GetFromPC_B
jmp *cpu65__opcodes(,%eax,4)
/* Exception handler */