Fixed channel 3 counter behavior, verified with new tests. The DIV register ticks the APU at 512Hz.
This commit is contained in:
parent
a19ee1e5e0
commit
2936f7fa57
@ -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. */
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user