diff --git a/src/cpu.rs b/src/cpu.rs index 86f7dc97879bc74470903a99ac69eac1dab194b3..0b717de1c83ccbae2ea35a41fc6067ffb14aa75e 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -112,7 +112,9 @@ impl Cpu { //Â @todo this is so bad, need to improve this by an order // of magnitude if self.halted { - if ((self.mmu.ie & 0x01 == 0x01) && self.mmu.ppu().int_vblank()) || ((self.mmu.ie & 0x04 == 0x04) && self.mmu.timer().int_tima()) { + if ((self.mmu.ie & 0x01 == 0x01) && self.mmu.ppu().int_vblank()) + || ((self.mmu.ie & 0x04 == 0x04) && self.mmu.timer().int_tima()) + { self.halted = false; } } diff --git a/src/lib.rs b/src/lib.rs index 11af82a5047fa0b409b5bbf4eccfad99daa9bec5..42a2983608cdf5ef4268560a36346b2739650021 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,5 +5,6 @@ pub mod inst; pub mod mmu; pub mod pad; pub mod ppu; +pub mod rom; pub mod timer; pub mod util; diff --git a/src/rom.rs b/src/rom.rs new file mode 100644 index 0000000000000000000000000000000000000000..8c6fbeda8afb4fc965f04500a238519a9a96da6d --- /dev/null +++ b/src/rom.rs @@ -0,0 +1,23 @@ +pub struct Rom { + data: Vec<u8>, +} + +pub enum RomType { + RomOnly = 0x00, + Mbc1 = 0x01, + Mbc1Ram = 0x02, + Mbc1RamBattery = 0x03, + Mbc2 = 0x05, + Mbc2Battery = 0x06, + Unknown = 0xff, +} + +impl Rom { + pub fn title() -> &'static str { + "asdas" + } + + pub fn rom_type() -> RomType { + RomType::RomOnly + } +}