swap rom endian
This commit is contained in:
parent
769a587aaa
commit
0e674af1b2
1 changed files with 12 additions and 0 deletions
12
src/main.rs
12
src/main.rs
|
@ -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()
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue