mirror of
https://codeberg.org/sethm/symon.git
synced 2026-11-07 19:12:23 +00:00
There is already an existing project (albeit defunct) named j6502. Name changed to lm6502.
This commit is contained in:
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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user