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