Some API changes, lots of test changes.
This commit is contained in:
1 parent
6443cacdb9
commit
1bd59b048b
4 files changed
+167
-98
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user