oam dma transfers
This commit is contained in:
parent
ad8d001f0c
commit
3cd888d991
|
@ -6,6 +6,8 @@ use crate::{
|
|||
use minifb::Key;
|
||||
use std::io::{stdout, Write};
|
||||
|
||||
use super::SplitRegister;
|
||||
|
||||
pub(crate) mod rom;
|
||||
|
||||
pub(crate) type Address = u16;
|
||||
|
@ -260,6 +262,17 @@ impl Memory {
|
|||
// read-only addresses
|
||||
println!("BANNED write: {:#X} to {:#X}", data, address);
|
||||
}
|
||||
0xFF46 => {
|
||||
if data > 0xDF {
|
||||
panic!("dma transfer out of bounds: {:#X}", data);
|
||||
}
|
||||
let mut addr: u16 = 0x0;
|
||||
addr.set_high(data);
|
||||
for l in 0x0..0xA0 {
|
||||
addr.set_low(l);
|
||||
self.oam[l as usize] = self.get(addr);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
self.io[addr_l] = data;
|
||||
// panic!("passed non-io address to io handler!");
|
||||
|
|
Loading…
Reference in a new issue