summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/m6502
diff options
context:
space:
mode:
author Alex W. Jackson <alex.w.jackson@gmail.com>2014-07-01 19:30:52 +0000
committer Alex W. Jackson <alex.w.jackson@gmail.com>2014-07-01 19:30:52 +0000
commit3968a42ccb38436bb94b7119370f7dc6ed04f296 (patch)
treed7d33a8604ae04f861eb6c313cb5a69de7ce72a5 /src/emu/cpu/m6502
parent020a35290ec4a6e0d418cdfbe07e19a2af6f7e22 (diff)
m6502: remove expensive and unused attotime precalculation at start of each timeslice [Alex Jackson]
(nw) This precalculation seems to be part of OG's "CPU core template", as all CPU cores written by him do it. It's used to optimize things like onboard serial ports and high-frequency timers; however, the m6502 and its derivatives have neither onboard serial ports nor high-frequency timers, and the precalculation is simply a boat anchor on drivers with 6502-family CPUs and tight interleaving. mess c64 benchmarks (3.4 GHz Sandy Bridge i5; 64-bit Linux GCC 4.8 build) before: [awj@localhost trunk]$ ./mess64 -window -bench 60 c64 Average speed: 238.17% (59 seconds) [awj@localhost trunk]$ ./mess64 -window -bench 60 c64 Average speed: 236.36% (59 seconds) after: [awj@localhost trunk]$ ./mess64 -window -bench 60 c64 Average speed: 279.93% (59 seconds) [awj@localhost trunk]$ ./mess64 -window -bench 60 c64 Average speed: 279.30% (59 seconds)
Diffstat (limited to 'src/emu/cpu/m6502')
-rw-r--r--src/emu/cpu/m6502/m6502.c9
-rw-r--r--src/emu/cpu/m6502/m6502.h2
-rw-r--r--src/emu/cpu/m6502/m740.c1
3 files changed, 0 insertions, 12 deletions
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c
index 9327d2618c1..062560cdbc8 100644
--- a/src/emu/cpu/m6502/m6502.c
+++ b/src/emu/cpu/m6502/m6502.c
@@ -129,7 +129,6 @@ void m6502_device::init()
inst_substate = 0;
inst_state_base = 0;
sync = false;
- end_cycles = 0;
inhibit_interrupts = false;
}
@@ -143,7 +142,6 @@ 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;
@@ -400,14 +398,8 @@ 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()
{
- end_cycles = machine().time().as_ticks(clock()) + icount;
if(inst_substate)
do_exec_partial();
@@ -420,7 +412,6 @@ void m6502_device::execute_run()
}
do_exec_full();
}
- end_cycles = 0;
}
void m6502_device::execute_set_input(int inputnum, int state)
diff --git a/src/emu/cpu/m6502/m6502.h b/src/emu/cpu/m6502/m6502.h
index b433c72f9e5..f77a33f6ae8 100644
--- a/src/emu/cpu/m6502/m6502.h
+++ b/src/emu/cpu/m6502/m6502.h
@@ -61,7 +61,6 @@ 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; }
@@ -201,7 +200,6 @@ 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];
diff --git a/src/emu/cpu/m6502/m740.c b/src/emu/cpu/m6502/m740.c
index 230ff737ecd..fb1662b49ef 100644
--- a/src/emu/cpu/m6502/m740.c
+++ b/src/emu/cpu/m6502/m740.c
@@ -77,7 +77,6 @@ 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;