emu-rs / rustual-boy

Rustual Boy - A Virtual Boy emulator.
https://rustualboy.com/
Apache License 2.0
232 stars 30 forks source link

bad bitmask on envelope direction #1

Closed jwestfall69 closed 7 years ago

jwestfall69 commented 7 years ago
impl Envelope {
...
    fn write_data_reg(&mut self, value: u8) {
        self.reg_data_reload = (value >> 4) as _;
        self.reg_data_direction = (value & 0x80) != 0; 
        self.reg_data_step_interval = (value & 0x07) as _;

The docs say the direction is the 4th bit, so the mask should be 0x08.

yupferris commented 7 years ago

Haha oh man, I must be blind!! This is def the final piece of the puzzle. Thanks!