m6502: put back get_cycle() since OG says it'll be needed in future, but compile-time disable the slow precalculation/caching (nw)

This commit is contained in:
Alex W. Jackson 2014-07-02 06:36:51 +00:00
parent eea3dca4ad
commit 9ac4a5762d
3 changed files with 16 additions and 0 deletions

View File

@ -129,6 +129,7 @@ void m6502_device::init()
inst_substate = 0;
inst_state_base = 0;
sync = false;
end_cycles = 0;
inhibit_interrupts = false;
}
@ -142,6 +143,7 @@ void m6502_device::device_reset()
apu_irq_state = false;
irq_taken = false;
v_state = false;
end_cycles = 0;
sync = false;
sync_w(CLEAR_LINE);
inhibit_interrupts = false;
@ -398,8 +400,18 @@ UINT8 m6502_device::do_asr(UINT8 v)
return v;
}
UINT64 m6502_device::get_cycle()
{
return end_cycles == 0 || icount <= 0 ? machine().time().as_ticks(clock()) : end_cycles - icount;
}
void m6502_device::execute_run()
{
// get_cycle() is currently unused, and this precalculation
// enormously slows down drivers with high interleave
#if 0
end_cycles = machine().time().as_ticks(clock()) + icount;
#endif
if(inst_substate)
do_exec_partial();
@ -412,6 +424,7 @@ void m6502_device::execute_run()
}
do_exec_full();
}
end_cycles = 0;
}
void m6502_device::execute_set_input(int inputnum, int state)

View File

@ -61,6 +61,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( irq_line );
DECLARE_WRITE_LINE_MEMBER( nmi_line );
UINT64 get_cycle();
bool get_sync() const { return sync; }
void disable_direct() { direct_disabled = true; }
@ -200,6 +201,7 @@ protected:
int icount;
bool nmi_state, irq_state, apu_irq_state, v_state;
bool irq_taken, sync, direct_disabled, inhibit_interrupts;
UINT64 end_cycles;
static const disasm_entry disasm_entries[0x100];

View File

@ -77,6 +77,7 @@ void m740_device::device_reset()
apu_irq_state = false;
irq_taken = false;
v_state = false;
end_cycles = 0;
sync = false;
inhibit_interrupts = false;
SP = 0x00ff;