Previous 199869 Revisions Next

r31157 Tuesday 1st July, 2014 at 19:30:52 UTC by Alex Jackson
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)
[src/emu/cpu/m6502]m6502.c m6502.h m740.c

trunk/src/emu/cpu/m6502/m6502.c
r31156r31157
129129   inst_substate = 0;
130130   inst_state_base = 0;
131131   sync = false;
132   end_cycles = 0;
133132   inhibit_interrupts = false;
134133}
135134
r31156r31157
143142   apu_irq_state = false;
144143   irq_taken = false;
145144   v_state = false;
146   end_cycles = 0;
147145   sync = false;
148146   sync_w(CLEAR_LINE);
149147   inhibit_interrupts = false;
r31156r31157
400398   return v;
401399}
402400
403UINT64 m6502_device::get_cycle()
404{
405   return end_cycles == 0 || icount <= 0 ? machine().time().as_ticks(clock()) : end_cycles - icount;
406}
407
408401void m6502_device::execute_run()
409402{
410   end_cycles = machine().time().as_ticks(clock()) + icount;
411403   if(inst_substate)
412404      do_exec_partial();
413405
r31156r31157
420412      }
421413      do_exec_full();
422414   }
423   end_cycles = 0;
424415}
425416
426417void m6502_device::execute_set_input(int inputnum, int state)
trunk/src/emu/cpu/m6502/m6502.h
r31156r31157
6161   DECLARE_WRITE_LINE_MEMBER( irq_line );
6262   DECLARE_WRITE_LINE_MEMBER( nmi_line );
6363
64   UINT64 get_cycle();
6564   bool get_sync() const { return sync; }
6665   void disable_direct() { direct_disabled = true; }
6766
r31156r31157
201200   int icount;
202201   bool nmi_state, irq_state, apu_irq_state, v_state;
203202   bool irq_taken, sync, direct_disabled, inhibit_interrupts;
204   UINT64 end_cycles;
205203
206204   static const disasm_entry disasm_entries[0x100];
207205
trunk/src/emu/cpu/m6502/m740.c
r31156r31157
7777   apu_irq_state = false;
7878   irq_taken = false;
7979   v_state = false;
80   end_cycles = 0;
8180   sync = false;
8281   inhibit_interrupts = false;
8382   SP = 0x00ff;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team