Skip to content
Snippets Groups Projects
Verified Commit 45b6f484 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: initial rom implementation

parent 1787d4df
No related branches found
No related tags found
No related merge requests found
...@@ -112,7 +112,9 @@ impl Cpu { ...@@ -112,7 +112,9 @@ impl Cpu {
// @todo this is so bad, need to improve this by an order // @todo this is so bad, need to improve this by an order
// of magnitude // of magnitude
if self.halted { 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; self.halted = false;
} }
} }
......
...@@ -5,5 +5,6 @@ pub mod inst; ...@@ -5,5 +5,6 @@ pub mod inst;
pub mod mmu; pub mod mmu;
pub mod pad; pub mod pad;
pub mod ppu; pub mod ppu;
pub mod rom;
pub mod timer; pub mod timer;
pub mod util; pub mod util;
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
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment