Merge branch 'master' into crtc

Conflicts:
	src/main/java/com/loomcom/symon/Simulator.java
	src/main/java/com/loomcom/symon/devices/Device.java
	src/main/java/com/loomcom/symon/devices/Memory.java
This commit is contained in:
Seth Morabito committed 2013-12-28 23:35:22 -08:00
commit 070e9db813
10 files changed
+51 -66

No files matched your search

@@ -37,6 +37,11 @@ import java.util.Set;
public abstract class Device implements Comparable<Device> {
/**
* Size of the device in memory
*/
int size;
/**
* The memory range for this device.
*/
@@ -57,15 +62,16 @@ public abstract class Device implements Comparable<Device> {
*/
private Set<DeviceChangeListener> deviceChangeListeners;
public Device(int address, int size, String name)
public Device(int startAddress, int endAddress, String name)
throws MemoryRangeException {
this.memoryRange = new MemoryRange(address, address + size - 1);
this.memoryRange = new MemoryRange(startAddress, endAddress);
this.size = endAddress - startAddress + 1;
this.name = name;
this.deviceChangeListeners = new HashSet<DeviceChangeListener>();
}
public Device(int address, int size) throws MemoryRangeException {
this(address, size, null);
public Device(int startAddress, int endAddress) throws MemoryRangeException {
this(startAddress, endAddress, null);
}
/* Methods required to be implemented by inheriting classes. */
@@ -103,6 +109,10 @@ public abstract class Device implements Comparable<Device> {
this.name = name;
}
public int getSize() {
return size;
}
public void registerListener(DeviceChangeListener listener) {
deviceChangeListeners.add(listener);
}