This commit is contained in:
@@ -312,3 +312,23 @@ fn dmc_playback_updates_output_level_from_sample_bits() {
|
||||
|
||||
assert!(bus.apu.dmc_output_level < initial);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pulse_channel_outputs_become_audible_after_setup() {
|
||||
let mut bus = NativeBus::new(Box::new(StubMapper));
|
||||
bus.write(0x4015, 0x01); // enable pulse1
|
||||
bus.write(0x4000, 0b0101_1111); // 25% duty, constant volume=15
|
||||
bus.write(0x4002, 0x08); // low timer period, not sweep-muted
|
||||
bus.write(0x4003, 0x00); // reload length + reset duty sequencer
|
||||
|
||||
let mut saw_non_zero = false;
|
||||
for _ in 0..64u32 {
|
||||
bus.clock_cpu(1);
|
||||
if bus.apu_channel_outputs().pulse1 > 0 {
|
||||
saw_non_zero = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert!(saw_non_zero, "pulse1 never produced audible output");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user