mirror of https://github.com/snes9xgit/snes9x.git
Loosen SMP<->DSP synchronization.
This commit is contained in:
parent
02a3b83c87
commit
91e69af029
|
@ -560,6 +560,7 @@ void S9xAPUExecute (void)
|
||||||
void S9xAPUEndScanline (void)
|
void S9xAPUEndScanline (void)
|
||||||
{
|
{
|
||||||
S9xAPUExecute();
|
S9xAPUExecute();
|
||||||
|
SNES::dsp.synchronize();
|
||||||
|
|
||||||
if (SNES::dsp.spc_dsp.sample_count() >= APU_MINIMUM_SAMPLE_BLOCK || !spc::sound_in_sync)
|
if (SNES::dsp.spc_dsp.sample_count() >= APU_MINIMUM_SAMPLE_BLOCK || !spc::sound_in_sync)
|
||||||
S9xLandSamples();
|
S9xLandSamples();
|
||||||
|
|
|
@ -1,12 +1,22 @@
|
||||||
#include "SPC_DSP.h"
|
#include "SPC_DSP.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
class DSP : public Processor {
|
class DSP : public Processor {
|
||||||
public:
|
public:
|
||||||
inline uint8 read(uint8 addr) {
|
inline uint8 read(uint8 addr) {
|
||||||
|
synchronize ();
|
||||||
return spc_dsp.read(addr);
|
return spc_dsp.read(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void synchronize (void) {
|
||||||
|
if (clock) {
|
||||||
|
spc_dsp.run (clock);
|
||||||
|
clock = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline void write(uint8 addr, uint8 data) {
|
inline void write(uint8 addr, uint8 data) {
|
||||||
|
synchronize ();
|
||||||
spc_dsp.write(addr, data);
|
spc_dsp.write(addr, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ void SMP::tick() {
|
||||||
synchronize_dsp();
|
synchronize_dsp();
|
||||||
#else
|
#else
|
||||||
clock++;
|
clock++;
|
||||||
dsp.spc_dsp.run(1);
|
dsp.clock++;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ void SMP::op_step() {
|
||||||
synchronize_dsp();
|
synchronize_dsp();
|
||||||
#else
|
#else
|
||||||
clock += cycle_count_table[opcode];
|
clock += cycle_count_table[opcode];
|
||||||
dsp.spc_dsp.run(cycle_count_table[opcode]);
|
dsp.clock += cycle_count_table[opcode];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue