Commit 88a0a581 by Jessica Hawkwell

fixed some broken things

1 parent 78af4d11
Pipeline #212 passed
in 1 minute 6 seconds
...@@ -186,6 +186,10 @@ ...@@ -186,6 +186,10 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>3.0.1</version> <version>3.0.1</version>
<configuration>
<excludeScope>test</excludeScope>
<includeScope>compile</includeScope>
</configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
......
...@@ -81,12 +81,14 @@ public class KBoard extends BaseDevice implements IMemory { ...@@ -81,12 +81,14 @@ public class KBoard extends BaseDevice implements IMemory {
@Override public void memIrq(short addr, byte irq) { @Override public void memIrq(short addr, byte irq) {
short dev = checkDevice(addr); short dev = checkDevice(addr);
short rdev = (short)(0x0f & dev); short rdev = (short)(0x0f & dev);
StackTraceElement ste = Thread.currentThread().getStackTrace()[1]; StackTraceElement[] stes = Thread.currentThread().getStackTrace();
StackTraceElement ste = stes[2];
String className = ste.getClassName(); String className = ste.getClassName();
System.err.format("\t\t%s\n", ste.getClassName());
int sendIrq = 16; int sendIrq = 16;
int a; int a;
for (a = 0; a < 16; a++) { for (a = 0; a < 16; a++) {
if (devices[a].getClass().getCanonicalName().equals(className)) { if ((devices[a] != null) && devices[a].getClass().getCanonicalName().equals(className)) {
sendIrq = a; sendIrq = a;
break; break;
} }
......
...@@ -127,11 +127,6 @@ public class Kcpu extends BaseDevice { ...@@ -127,11 +127,6 @@ public class Kcpu extends BaseDevice {
log("%04x : [%10s] %04x ->", pc, ((od == null)?"nop":od.name()), ref); log("%04x : [%10s] %04x ->", pc, ((od == null)?"nop":od.name()), ref);
log(" %04x %04x %04x %04x ", registers[0], registers[1], registers[2], registers[3]); log(" %04x %04x %04x %04x ", registers[0], registers[1], registers[2], registers[3]);
// bring up the program counter
if (od == null) { pc += 12; return; } // inc if nop
pc += 4;
pc += (((0x0700 & ref) >> 8) * 2);
// this works because the value starts counting at 1 // this works because the value starts counting at 1
switch(0x0700 & ref) { switch(0x0700 & ref) {
case 0x0000: ref += ValueType.R.getValue(); case 0x0000: ref += ValueType.R.getValue();
...@@ -144,7 +139,16 @@ public class Kcpu extends BaseDevice { ...@@ -144,7 +139,16 @@ public class Kcpu extends BaseDevice {
if ((0x0700 & ref) >= 0x0200) { log(" %2s.%04x", ValueType.valueOf(ref, 1), values[1]); } if ((0x0700 & ref) >= 0x0200) { log(" %2s.%04x", ValueType.valueOf(ref, 1), values[1]); }
if ((0x0700 & ref) >= 0x0300) { log(" %2s.%04x", ValueType.valueOf(ref, 2), values[2]); } if ((0x0700 & ref) >= 0x0300) { log(" %2s.%04x", ValueType.valueOf(ref, 2), values[2]); }
if ((0x0700 & ref) >= 0x0400) { log(" %2s.%04x", ValueType.valueOf(ref, 3), values[3]); } if ((0x0700 & ref) >= 0x0400) { log(" %2s.%04x", ValueType.valueOf(ref, 3), values[3]); }
logln("");
// bring up the program counter
if (od == null) {
pc += 12; // inc if nop
logln("\t[X]");
return;
}
else { logln(""); }
pc += 4;
pc += (((0x0700 & ref) >> 8) * 2);
if ( od.hasHandler() ) { if ( od.hasHandler() ) {
registers = od.call(pc, ref, registers, values, kboard); registers = od.call(pc, ref, registers, values, kboard);
......
...@@ -19,7 +19,7 @@ public class HardwareMemIrq extends TimerTask { ...@@ -19,7 +19,7 @@ public class HardwareMemIrq extends TimerTask {
i = irq; i = irq;
} }
@Override public void run() { @Override public void run() {
Thread.currentThread().setName(String.format("memIRQ-%02x-%x", id, Thread.currentThread().getId() )); Thread.currentThread().setName(String.format("memIRQ-%02x_%04x-%x", i, a, Thread.currentThread().getId() ));
id.memIrq(a, i); id.memIrq(a, i);
} }
} }
...@@ -17,7 +17,7 @@ public class HardwareRecvIrq extends TimerTask { ...@@ -17,7 +17,7 @@ public class HardwareRecvIrq extends TimerTask {
i = irq; i = irq;
} }
@Override public void run() { @Override public void run() {
Thread.currentThread().setName(String.format("recvIRQ-%02x_%02x-%x", id, i, Thread.currentThread().getId() )); Thread.currentThread().setName(String.format("recvIRQ-%02x-%x", i, Thread.currentThread().getId() ));
id.recvIrq(i); id.recvIrq(i);
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!