-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve HiROM space masking, add DSPx coprocessor skeleton
- Loading branch information
Showing
4 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::snes::bus::{Address, BusMember}; | ||
|
||
/// DSP-x co-processor | ||
#[derive(Serialize, Deserialize)] | ||
pub struct DSPx {} | ||
|
||
impl DSPx { | ||
pub fn new() -> Self { | ||
Self {} | ||
} | ||
} | ||
|
||
impl BusMember<Address> for DSPx { | ||
fn read(&self, fulladdr: Address) -> Option<u8> { | ||
let (bank, addr) = ((fulladdr >> 16) as usize, (fulladdr & 0xFFFF) as usize); | ||
|
||
match addr { | ||
0x7000 => { | ||
// SR (LSB) | ||
Some(0) | ||
} | ||
0x7001 => { | ||
// SR (MSB) | ||
Some(0x80) | ||
} | ||
_ => None, | ||
} | ||
} | ||
|
||
fn write(&mut self, fulladdr: Address, val: u8) -> Option<()> { | ||
let (bank, addr) = ((fulladdr >> 16) as usize, (fulladdr & 0xFFFF) as usize); | ||
|
||
match addr { | ||
_ => None, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod dspx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters