mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-04 19:27:30 +02:00
Some more testing for Super Game Boy audio mixing.
This commit is contained in:
@@ -62,7 +62,7 @@ auto ICD::main() -> void {
|
|||||||
static uint n = 0;
|
static uint n = 0;
|
||||||
float x = sin((2 * 3.141592 * n++ * 1000.0) / 44100.0) * 0.1;
|
float x = sin((2 * 3.141592 * n++ * 1000.0) / 44100.0) * 0.1;
|
||||||
apuWrite(x, x);
|
apuWrite(x, x);
|
||||||
step(128);
|
step(256);
|
||||||
return synchronizeCPU();
|
return synchronizeCPU();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -149,8 +149,8 @@ auto ICD::power(bool reset) -> void {
|
|||||||
//SGB1 uses CPU oscillator; SGB2 uses dedicated oscillator
|
//SGB1 uses CPU oscillator; SGB2 uses dedicated oscillator
|
||||||
create(ICD::Enter, frequency);
|
create(ICD::Enter, frequency);
|
||||||
if(!reset) stream = Emulator::audio.createStream(2, frequency / 128);
|
if(!reset) stream = Emulator::audio.createStream(2, frequency / 128);
|
||||||
dsp.stream->reset();
|
//dsp.stream->reset();
|
||||||
icd.stream->reset();
|
//icd.stream->reset();
|
||||||
|
|
||||||
for(auto& packet : this->packet) packet = {};
|
for(auto& packet : this->packet) packet = {};
|
||||||
packetSize = 0;
|
packetSize = 0;
|
||||||
|
@@ -35,15 +35,8 @@ auto SMP::waitIdle(maybe<uint16> addr, bool half) -> void {
|
|||||||
auto SMP::step(uint clocks) -> void {
|
auto SMP::step(uint clocks) -> void {
|
||||||
clock += clocks * (uint64_t)cpu.frequency;
|
clock += clocks * (uint64_t)cpu.frequency;
|
||||||
dsp.clock -= clocks;
|
dsp.clock -= clocks;
|
||||||
synchronizeDSP();
|
|
||||||
|
|
||||||
#if defined(DEBUGGER)
|
|
||||||
synchronizeCPU();
|
synchronizeCPU();
|
||||||
#else
|
synchronizeDSP();
|
||||||
//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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto SMP::stepIdle(uint clocks) -> void {
|
auto SMP::stepIdle(uint clocks) -> void {
|
||||||
|
Reference in New Issue
Block a user