mirror of https://github.com/snes9xgit/snes9x.git
Reduce the sync footprint slightly with less indirection.
This commit is contained in:
parent
ebc9b70860
commit
08f5601c5f
|
@ -7,19 +7,6 @@ DSP dsp;
|
|||
|
||||
#include "SPC_DSP.cpp"
|
||||
|
||||
void DSP::step(unsigned clocks) {
|
||||
clock += clocks;
|
||||
}
|
||||
|
||||
void DSP::synchronize_smp() {
|
||||
while(clock >= 0) smp.enter();
|
||||
}
|
||||
|
||||
void DSP::enter() {
|
||||
spc_dsp.run(1);
|
||||
step(24);
|
||||
}
|
||||
|
||||
uint8 DSP::read(uint8 addr) {
|
||||
return spc_dsp.read(addr);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@
|
|||
class DSP : public Processor {
|
||||
public:
|
||||
enum { Threaded = false };
|
||||
alwaysinline void step(unsigned clocks);
|
||||
alwaysinline void synchronize_smp();
|
||||
|
||||
uint8 read(uint8 addr);
|
||||
void write(uint8 addr, uint8 data);
|
||||
|
||||
void enter();
|
||||
void power();
|
||||
void reset();
|
||||
|
||||
|
|
|
@ -5,11 +5,12 @@ void SMP::tick() {
|
|||
|
||||
#ifndef SNES9X
|
||||
clock += cycle_step_cpu;
|
||||
#else
|
||||
clock++;
|
||||
#endif
|
||||
dsp.clock -= 24;
|
||||
synchronize_dsp();
|
||||
#else
|
||||
clock++;
|
||||
dsp.spc_dsp.run(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SMP::op_io() {
|
||||
|
@ -77,11 +78,13 @@ void SMP::op_step() {
|
|||
|
||||
#ifndef SNES9X
|
||||
clock += cycle_table_cpu[opcode];
|
||||
#else
|
||||
clock += cycle_count_table[opcode];
|
||||
#endif
|
||||
dsp.clock -= cycle_table_dsp[opcode];
|
||||
synchronize_dsp();
|
||||
#else
|
||||
clock += cycle_count_table[opcode];
|
||||
dsp.spc_dsp.run(cycle_count_table[opcode]);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -34,11 +34,13 @@ void SMP::synchronize_cpu() {
|
|||
}
|
||||
|
||||
void SMP::synchronize_dsp() {
|
||||
#ifndef SNES9X
|
||||
if(DSP::Threaded == true) {
|
||||
//if(dsp.clock < 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(dsp.thread);
|
||||
} else {
|
||||
while(dsp.clock < 0) dsp.enter();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SMP::enter() {
|
||||
|
|
Loading…
Reference in New Issue