fox32+fox32rom: Change the IO port base to 0x80000000
This commit is contained in:
parent
7a507fd768
commit
5c07305a5f
14
src/bus.rs
14
src/bus.rs
|
@ -17,7 +17,7 @@ pub struct Bus {
|
||||||
impl Bus {
|
impl Bus {
|
||||||
pub fn read_io(&mut self, port: u32) -> u32 {
|
pub fn read_io(&mut self, port: u32) -> u32 {
|
||||||
match port {
|
match port {
|
||||||
0x02000000..=0x0200031F => { // overlay port
|
0x80000000..=0x8000031F => { // overlay port
|
||||||
let overlay_lock = self.memory.overlays.lock().unwrap();
|
let overlay_lock = self.memory.overlays.lock().unwrap();
|
||||||
let overlay_number = (port & 0x000000FF) as usize;
|
let overlay_number = (port & 0x000000FF) as usize;
|
||||||
let setting = (port & 0x0000FF00) >> 8;
|
let setting = (port & 0x0000FF00) >> 8;
|
||||||
|
@ -46,7 +46,7 @@ impl Bus {
|
||||||
_ => panic!("invalid overlay control port"),
|
_ => panic!("invalid overlay control port"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
0x02000400..=0x02000401 => { // mouse port
|
0x80000400..=0x80000401 => { // mouse port
|
||||||
let setting = (port & 0x000000FF) as u8;
|
let setting = (port & 0x000000FF) as u8;
|
||||||
match setting {
|
match setting {
|
||||||
0x00 => {
|
0x00 => {
|
||||||
|
@ -83,7 +83,7 @@ impl Bus {
|
||||||
print!("{}", word as u8 as char);
|
print!("{}", word as u8 as char);
|
||||||
stdout().flush().expect("could not flush stdout");
|
stdout().flush().expect("could not flush stdout");
|
||||||
}
|
}
|
||||||
0x02000000..=0x0200031F => { // overlay port
|
0x80000000..=0x8000031F => { // overlay port
|
||||||
let mut overlay_lock = self.memory.overlays.lock().unwrap();
|
let mut overlay_lock = self.memory.overlays.lock().unwrap();
|
||||||
let overlay_number = (port & 0x000000FF) as usize;
|
let overlay_number = (port & 0x000000FF) as usize;
|
||||||
let setting = (port & 0x0000FF00) >> 8;
|
let setting = (port & 0x0000FF00) >> 8;
|
||||||
|
@ -105,7 +105,7 @@ impl Bus {
|
||||||
}
|
}
|
||||||
0x02 => {
|
0x02 => {
|
||||||
// we're setting the framebuffer pointer of this overlay
|
// we're setting the framebuffer pointer of this overlay
|
||||||
if word < 0x02000000 {
|
if word < 0x80000000 {
|
||||||
panic!("overlay framebuffer must be within shared memory");
|
panic!("overlay framebuffer must be within shared memory");
|
||||||
}
|
}
|
||||||
overlay_lock[overlay_number].framebuffer_pointer = word - 0x80000000;
|
overlay_lock[overlay_number].framebuffer_pointer = word - 0x80000000;
|
||||||
|
@ -117,8 +117,8 @@ impl Bus {
|
||||||
_ => panic!("invalid overlay control port"),
|
_ => panic!("invalid overlay control port"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
0x02000320 => { // audio port
|
0x80000320 => { // audio port
|
||||||
if word < 0x02000000 {
|
if word < 0x80000000 {
|
||||||
panic!("audio buffer must be within shared memory");
|
panic!("audio buffer must be within shared memory");
|
||||||
}
|
}
|
||||||
let address = word as usize - 0x80000000;
|
let address = word as usize - 0x80000000;
|
||||||
|
@ -140,7 +140,7 @@ impl Bus {
|
||||||
}
|
}
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
}
|
}
|
||||||
0x02000400..=0x02000401 => { // mouse port
|
0x80000400..=0x80000401 => { // mouse port
|
||||||
let setting = (port & 0x000000FF) as u8;
|
let setting = (port & 0x000000FF) as u8;
|
||||||
match setting {
|
match setting {
|
||||||
0x00 => {
|
0x00 => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user