There is already an existing project (albeit defunct) named j6502. Name changed to lm6502.

This commit is contained in:
Seth J. Morabito committed 2008-12-08 14:28:44 -08:00
1 parent 316d0feac6
commit 061eeba85c
8 files changed
+19 -22

No files matched your search

@@ -0,0 +1,40 @@
package com.loomcom.lm6502;
/**
* A memory-mapped IO Device.
*/
public abstract class Device {
/** The memory range for this device. */
private MemoryRange m_memoryRange;
/** Reference to the CPU, for interrupts. */
private Cpu m_cpu;
public Device(MemoryRange range, Cpu cpu) {
m_memoryRange = range;
m_cpu = cpu;
}
public MemoryRange getMemoryRange() {
return m_memoryRange;
}
public int getEndAddress() {
return m_memoryRange.getEndAddress();
}
public int getStartAddress() {
return m_memoryRange.getStartAddress();
}
public void generateInterrupt() {
m_cpu.interrupt();
}
public void generateNonMaskableInterrupt() {
m_cpu.nmiInterrupt();
}
}