Devices use start/end address

This commit is contained in:
Max840 committed 2013-12-23 23:31:51 -05:00
1 parent a5af522c5c
commit d1a05aeb2b
5 files changed
+20 -20

No files matched your search

@@ -152,7 +152,7 @@ public class Simulator {
this.via = new Via(VIA_BASE);
this.bus = new Bus(BUS_BOTTOM, BUS_TOP);
this.cpu = new Cpu();
this.ram = new Memory(MEMORY_BASE, MEMORY_SIZE, false);
this.ram = new Memory(MEMORY_BASE, MEMORY_BASE + MEMORY_SIZE - 1, false);
bus.addCpu(cpu);
bus.addDevice(ram);
@@ -163,11 +163,11 @@ public class Simulator {
File romImage = new File("rom.bin");
if (romImage.canRead()) {
logger.info("Loading ROM image from file " + romImage);
this.rom = Memory.makeROM(ROM_BASE, ROM_SIZE, romImage);
this.rom = Memory.makeROM(ROM_BASE, ROM_BASE + ROM_SIZE - 1, romImage);
} else {
logger.info("Default ROM file " + romImage +
" not found, loading empty R/W memory image.");
this.rom = Memory.makeRAM(ROM_BASE, ROM_SIZE);
this.rom = Memory.makeRAM(ROM_BASE, ROM_BASE + ROM_SIZE - 1);
}
bus.addDevice(rom);
}
@@ -568,7 +568,7 @@ public class Simulator {
bus.removeDevice(rom);
}
// Load the new ROM image
rom = Memory.makeROM(ROM_BASE, ROM_SIZE, romFile);
rom = Memory.makeROM(ROM_BASE, ROM_BASE + ROM_SIZE - 1, romFile);
bus.addDevice(rom);
// Now, reset