swap rom endian

This commit is contained in:
Alex Janka 2023-01-22 09:08:33 +11:00
parent 769a587aaa
commit 0e674af1b2

View file

@ -331,3 +331,15 @@ fn cpu_ram_init(cpu: &mut CPU) {
cpu.memory.set(0xFF48, 0xFF); cpu.memory.set(0xFF48, 0xFF);
cpu.memory.set(0xFF49, 0xFF); cpu.memory.set(0xFF49, 0xFF);
} }
#[allow(dead_code)]
fn swap_rom_endian(rom: &ROM) -> ROM {
rom.chunks(2)
.map(|l| {
let mut m = l.to_owned();
m.reverse();
m
})
.flatten()
.collect()
}