Some API changes, lots of test changes.

This commit is contained in:
Seth J. Morabito committed 2008-12-14 23:43:04 -08:00
1 parent 6443cacdb9
commit 1bd59b048b
4 files changed
+167 -98

No files matched your search

+13 -1
View File
@@ -63,7 +63,7 @@ public class Bus {
* device.
*/
public boolean isComplete() {
// Emtpy maps cannot be complete.
// Empty maps cannot be complete.
if (devices.isEmpty()) { return false; }
// Loop over devices and ensure they are contiguous.
@@ -129,4 +129,16 @@ public class Bus {
// Expose a copy of the device list, not the original
return new TreeSet<Device>(devices);
}
public Cpu getCpu() {
return cpu;
}
public void loadProgram(int... program) {
int address = getCpu().getProgramCounter();
int i = 0;
for (int d : program) {
write(address + i++, d);
}
}
}