nesfuzz/src/apu/square.rs

57 lines
806 B
Rust
Raw Normal View History

2019-11-27 01:11:51 +00:00
impl super::Square {
pub fn new() -> Self {
super::Square {
duty_cycle: 0,
length_counter_halt: false,
constant_volume_flag: false,
timer: 0,
length_counter: 0,
envelope: 0,
sweep: 0,
2019-12-05 02:57:05 +00:00
sample: 0,
2019-12-15 00:15:06 +00:00
enabled: false,
2019-11-27 01:11:51 +00:00
}
}
2019-12-05 02:57:05 +00:00
pub fn clock(&mut self) {
}
pub fn duty(&mut self, value: u8) {
2019-12-07 23:09:28 +00:00
self.duty_cycle = value >> 6;
2019-12-15 00:15:06 +00:00
// self.length_counter_halt =
2019-12-05 02:57:05 +00:00
}
pub fn sweep(&mut self, value: u8) {
}
pub fn timer_low(&mut self, value: u8) {
}
pub fn timer_high(&mut self, value: u8) {
}
2019-12-10 03:22:53 +00:00
}
struct EnvelopeGenerator {
}
struct SweepUnit {
}
struct Timer {
}
struct Sequencer {
}
struct LengthCounter {
}