Some more testing for Super Game Boy audio mixing.

This commit is contained in:
byuu 2019-12-09 09:23:33 +09:00
parent f5d40bd1ee
commit 4ec45a7453
2 changed files with 4 additions and 11 deletions

View File

@ -62,7 +62,7 @@ auto ICD::main() -> void {
static uint n = 0;
float x = sin((2 * 3.141592 * n++ * 1000.0) / 44100.0) * 0.1;
apuWrite(x, x);
step(128);
step(256);
return synchronizeCPU();
#endif
@ -149,8 +149,8 @@ auto ICD::power(bool reset) -> void {
//SGB1 uses CPU oscillator; SGB2 uses dedicated oscillator
create(ICD::Enter, frequency);
if(!reset) stream = Emulator::audio.createStream(2, frequency / 128);
dsp.stream->reset();
icd.stream->reset();
//dsp.stream->reset();
//icd.stream->reset();
for(auto& packet : this->packet) packet = {};
packetSize = 0;

View File

@ -35,15 +35,8 @@ auto SMP::waitIdle(maybe<uint16> addr, bool half) -> void {
auto SMP::step(uint clocks) -> void {
clock += clocks * (uint64_t)cpu.frequency;
dsp.clock -= clocks;
synchronizeDSP();
#if defined(DEBUGGER)
synchronizeCPU();
#else
//forcefully sync S-SMP to S-CPU in case chips are not communicating
//sync if S-SMP is more than 24 samples ahead of S-CPU
if(clock > +(768 * 24 * (int64_t)24'000'000)) synchronizeCPU();
#endif
synchronizeDSP();
}
auto SMP::stepIdle(uint clocks) -> void {