fix vram dma

This commit is contained in:
Alex Janka 2023-04-25 10:03:33 +10:00
parent 224c850a7d
commit 59d52ee92f

View file

@ -58,7 +58,7 @@ impl VramDma {
match address.inner() { match address.inner() {
0xFF51 => self.source.set_high(data), 0xFF51 => self.source.set_high(data),
0xFF52 => self.source.set_low(data & 0xF0), 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), 0xFF54 => self.destination.set_low(data & 0xF0),
0xFF55 => { 0xFF55 => {
let num = data & !(0b1 << 7); let num = data & !(0b1 << 7);
@ -123,7 +123,7 @@ where
}; };
if let Some((source, dest, length)) = copy { if let Some((source, dest, length)) = copy {
for i in 0..length { 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() { if self.is_double_speed() {