diff --git a/lib/src/processor/memory/mmio/cgb/vram_dma.rs b/lib/src/processor/memory/mmio/cgb/vram_dma.rs index c098261..7c9bcab 100644 --- a/lib/src/processor/memory/mmio/cgb/vram_dma.rs +++ b/lib/src/processor/memory/mmio/cgb/vram_dma.rs @@ -58,7 +58,7 @@ impl VramDma { match address.inner() { 0xFF51 => self.source.set_high(data), 0xFF52 => self.source.set_low(data & 0xF0), - 0xFF53 => self.destination.set_high((data & 0b11111) | (0b1 << 7)), + 0xFF53 => self.destination.set_high((data & 0x1F) | 0x80), 0xFF54 => self.destination.set_low(data & 0xF0), 0xFF55 => { let num = data & !(0b1 << 7); @@ -123,7 +123,7 @@ where }; if let Some((source, dest, length)) = copy { for i in 0..length { - self.set(source + i, self.get(dest + i)); + self.set(dest + i, self.get(source + i)); } } if self.is_double_speed() {