diff --git a/src/cpu.rs b/src/cpu.rs index f26ac5f..082ba62 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -11,7 +11,7 @@ pub struct CPU { } impl CPU { - pub fn new(mode: GBMode, rom: [u8; 0x10000]) -> CPU { + pub fn new(mode: GBMode, rom: Vec) -> CPU { CPU { reg: Registers::new(mode), mem: MMU::new(rom), diff --git a/src/main.rs b/src/main.rs index 1001de5..ac9dd98 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,7 +43,7 @@ async fn main() -> Result<(), impl std::error::Error> { println!("Starting \"{game_name}\"..."); // Start CPU - let mut cpu = CPU::new(GBMode::Classic, buffer.clone().try_into().unwrap()); + let mut cpu = CPU::new(GBMode::Classic, buffer.clone()); while true { cpu.cycle(); diff --git a/src/mmu.rs b/src/mmu.rs index 3cb5e51..e8bde96 100644 --- a/src/mmu.rs +++ b/src/mmu.rs @@ -1,5 +1,5 @@ pub struct MMU { - rom: [u8; 0x10000], + rom: Vec, gpu: [u8; 0x2000], wram: [u8; 0x8000], hram: [u8; 0x7F], @@ -8,7 +8,7 @@ pub struct MMU { } impl MMU { - pub fn new(rom: [u8; 0x10000]) -> MMU { + pub fn new(rom: Vec) -> MMU { MMU { rom, gpu: [0; 0x2000],