fn increment_vram_addr_y(&mut self) {
        if self.current_vram_addr.get_fine_y() == 0b111 {
            // clear fine y bits if fine y bits = max
            self.current_vram_addr.set_fine_y(0);

            if self.current_vram_addr.get_coarse_y() == 29 {
                // if carry from fine y bits = 1 and coarse y bits
                // = 29 (there are 29 rows of tiles in a frame),
                // clear all coarse y bits and overflow into bit
                // 11 to move to next nametable vertically
                self.current_vram_addr.set_coarse_y(0);
                self.current_vram_addr.inner ^= 0b100000000000;
            } else if self.current_vram_addr.get_coarse_y() == 0b11111 {
                // if coarse y = maximum, wrap the value without overflowing into
                // bit 11 and switching nametables (unintended behavior afaik)
                self.current_vram_addr.set_coarse_y(0);
            } else {
                // increment coarse y bits of 'current_vram_addr'
                self.current_vram_addr.inner += 1 << 5;
            }
        } else {
            // increment fine y bits normally
            self.current_vram_addr.inner += 1 << 12;
        }
    }
// increments the fine y scroll bits in 'current_vram_addr',
// potentially overflowing into the coarse y scroll bits
increments the fine y scroll bits in 'current_vram_addr',
potentially overflowing into the coarse y scroll bits
increments the fine y scroll bits in ' current_vram_addr ' potentially overflowing into the coarse y scroll bits
fn increment_vram_addr_y(&mut self) {
        if self.current_vram_addr.get_fine_y() == 0b111 {
            // clear fine y bits if fine y bits = max
            self.current_vram_addr.set_fine_y(0);
            if self.current_vram_addr.get_coarse_y() == 29 {
                // if carry from fine y bits = 1 and coarse y bits
                // = 29 (there are 29 rows of tiles in a frame),
                // clear all coarse y bits and overflow into bit
                // 11 to move to next nametable vertically
                self.current_vram_addr.set_coarse_y(0);
                self.current_vram_addr.inner ^= 0b100000000000;
            } else if self.current_vram_addr.get_coarse_y() == 0b11111 {
                // if coarse y = maximum, wrap the value without overflowing into
                // bit 11 and switching nametables (unintended behavior afaik)
                self.current_vram_addr.set_coarse_y(0);
            } else {
                // increment coarse y bits of 'current_vram_addr'
                self.current_vram_addr.inner += 1 << 5;
            }
        } else {
            // increment fine y bits normally
            self.current_vram_addr.inner += 1 << 12;
        }
    }
fn increment_vram_addr_y ( & mut self ) { if self . current_vram_addr . get_fine_y ( ) == 0b111 { // clear fine y bits if fine y bits = max self . current_vram_addr . set_fine_y ( 0 ) ; if self . current_vram_addr . get_coarse_y ( ) == 29 { // if carry from fine y bits = 1 and coarse y bits // = 29 (there are 29 rows of tiles in a frame), // clear all coarse y bits and overflow into bit // 11 to move to next nametable vertically self . current_vram_addr . set_coarse_y ( 0 ) ; self . current_vram_addr . inner ^= 0b100000000000 ; } else if self . current_vram_addr . get_coarse_y ( ) == 0b11111 { // if coarse y = maximum, wrap the value without overflowing into // bit 11 and switching nametables (unintended behavior afaik) self . current_vram_addr . set_coarse_y ( 0 ) ; } else { // increment coarse y bits of 'current_vram_addr' self . current_vram_addr . inner += 1 << 5 ; } } else { // increment fine y bits normally self . current_vram_addr . inner += 1 << 12 ; } }
increments the fine y scroll bits in 'current_vram_addr',
potentially overflowing into the coarse y scroll bits
increments the fine y scroll bits in ' current_vram_addr ' potentially overflowing into the coarse y scroll bits
&mut self
&mut self