Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cartridge: added support for switchable mirroring
- properly handled the mirroring flags in INES header
- Loading branch information
Showing
12 changed files
with
112 additions
and
40 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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
use common::Device; | ||
use common::{Device, MirroringMode}; | ||
|
||
pub trait Mapper { | ||
fn init(&mut self, pgr_count: u8, chr_count: u8); | ||
fn map_read(&self, address: u16, device: Device) -> usize; | ||
fn map_write(&mut self, address: u16, data: u8, device: Device); | ||
fn is_hardwired_mirrored(&self) -> bool; | ||
fn nametable_mirroring(&self) -> MirroringMode; | ||
} |
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
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
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
mod bus; | ||
mod mirroring; | ||
|
||
pub mod interconnection; | ||
|
||
pub use bus::{Bus, Device}; | ||
pub use mirroring::{MirroringMode, MirroringProvider}; |
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,12 @@ | ||
#[derive(Debug, Copy, Clone)] | ||
pub enum MirroringMode { | ||
Vertical, | ||
Horizontal, | ||
SingleScreenLowBank, | ||
SingleScreenHighBank, | ||
FourScreen, | ||
} | ||
|
||
pub trait MirroringProvider { | ||
fn mirroring_mode(&self) -> MirroringMode; | ||
} |
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
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