diff --git a/Core/apu.c b/Core/apu.c index 4ff7664d..6a54518d 100755 --- a/Core/apu.c +++ b/Core/apu.c @@ -283,7 +283,7 @@ void GB_apu_write(GB_gameboy_t *gb, uint8_t reg, uint8_t value) } } gb->apu.is_active[GB_WAVE] = true; - gb->apu.wave_channel.pulse_length = ~gb->io_registers[GB_IO_NR31]; + gb->apu.wave_channel.pulse_length = (~gb->io_registers[GB_IO_NR31]) * 2; gb->apu.wave_channel.sample_countdown = gb->apu.wave_channel.sample_length + 3; gb->apu.wave_channel.current_sample_index = 0; /* Note that we don't change the sample just yet! This was verified on hardware. */ diff --git a/Core/apu.h b/Core/apu.h index 6690a588..88117fb9 100644 --- a/Core/apu.h +++ b/Core/apu.h @@ -11,8 +11,8 @@ #define CH_STEP (MAX_CH_AMP/0xF/7) #endif -/* Lengths are in either DIV ticks (256Hz, triggered by the DIV register) or - APU ticks (2MHz, triggered by an internal APU clock)*/ +/* Lengths are in either DIV ticks (512Hz, triggered by the DIV register) or + APU ticks (2MHz, triggered by an internal APU clock) */ typedef struct {