Skip to content

Commit

Permalink
Restructure ROMs
Browse files Browse the repository at this point in the history
  • Loading branch information
breqdev committed Nov 22, 2023
1 parent e18d3d6 commit e791011
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 13 deletions.
Binary file added aiie/applesoft.bin
Binary file not shown.
Binary file removed aiie/char.bin.new.bin
Binary file not shown.
File renamed without changes.
Binary file added aiie/firmware.bin
Binary file not shown.
Binary file added aiie/monitor.bin
Binary file not shown.
18 changes: 12 additions & 6 deletions src/systems/aiie/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,6 @@ impl SystemBuilder<AiieSystem, AiieSystemRoms, AiieSystemConfig> for AiieSystemB

let peripheral_card =

Check warning on line 300 in src/systems/aiie/mod.rs

View workflow job for this annotation

GitHub Actions / WASM Build, Docs Build, and Web Deploy

unused variable: `peripheral_card`

Check failure on line 300 in src/systems/aiie/mod.rs

View workflow job for this annotation

GitHub Actions / Desktop Build and Style Check

unused variable: `peripheral_card`
LoggingMemory::new(Box::new(NullMemory::new()), "Peripheral Card", 0xC100);
//let applesoft_interpreter = BlockMemory::from_file(0x2800, roms.applesoft);
//let monitor = BlockMemory::from_file(0x4000, roms.monitor);
let rom = BlockMemory::from_file(16128, roms.rom);

let memory = BranchMemory::new()
.map(
Expand Down Expand Up @@ -361,9 +358,18 @@ impl SystemBuilder<AiieSystem, AiieSystemRoms, AiieSystemConfig> for AiieSystemB
Box::new(io),
// Box::new(LoggingMemory::new(Box::new(io), "I/O", 0xC000)),
)
.map(0xC100, Box::new(rom));
//.map(0xD000, Box::new(applesoft_interpreter))
//.map(0xF800, Box::new(monitor));
.map(
0xC100,
Box::new(BlockMemory::from_file(0x0F00, roms.firmware)),
)
.map(
0xD000,
Box::new(BlockMemory::from_file(0x2800, roms.applesoft)),
)
.map(
0xF800,
Box::new(BlockMemory::from_file(0x0800, roms.monitor)),
);

let cpu = Mos6502::new(Box::new(memory));

Expand Down
23 changes: 16 additions & 7 deletions src/systems/aiie/roms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@ pub struct AiieSystemRoms {
/// Character ROM. Used to generate the 7x8 character bitmaps.
pub character: RomFile,

pub rom: RomFile,
/// Firmware ROM. Contains text drawing and I/O routines.
pub firmware: RomFile,

/// AppleSoft BASIC ROM. Contains the BASIC interpreter and editor.
pub applesoft: RomFile,

/// Monitor ROM. Contains reset vectors and the system monitor.
pub monitor: RomFile,
}

impl AiieSystemRoms {
#[cfg(not(target_arch = "wasm32"))]
pub fn from_disk() -> Self {
use crate::roms::DiskLoadable;

// let character = RomFile::from_file("aiie/char.bin");
//let applesoft = RomFile::from_file("aiie/applesoft.bin");
//let monitor = RomFile::from_file("aiie/monitor.bin");
let rom = RomFile::from_file("aiie/appleiie.bin");
let character = RomFile::from_file("aiie/char.bin");
let character = RomFile::from_file("aiie/character.bin");
let firmware = RomFile::from_file("aiie/firmware.bin");
let applesoft = RomFile::from_file("aiie/applesoft.bin");
let monitor = RomFile::from_file("aiie/monitor.bin");

Self {
character,
rom
firmware,
applesoft,
monitor,
}
}

Check warning on line 35 in src/systems/aiie/roms.rs

View check run for this annotation

Codecov / codecov/patch

src/systems/aiie/roms.rs#L21-L35

Added lines #L21 - L35 were not covered by tests
}

0 comments on commit e791011

Please sign in to comment.