|
@@ -61,6 +61,8 @@ public class Iiixmish2 {
|
|
|
|
|
|
private static boolean th0, th1, th2, th3;
|
|
|
|
|
|
+ private static boolean comm = false;
|
|
|
+
|
|
|
static String progName = "";
|
|
|
|
|
|
public static void main(String args[]) {
|
|
@@ -107,6 +109,13 @@ public class Iiixmish2 {
|
|
|
}
|
|
|
}.start();
|
|
|
}
|
|
|
+ System.err.println("full reboot");
|
|
|
+ } else if(e.getKeyCode() == KeyEvent.VK_F2) {
|
|
|
+ comm = true;
|
|
|
+ System.err.println("communication enabled");
|
|
|
+ } else if(e.getKeyCode() == KeyEvent.VK_F3) {
|
|
|
+ comm = false;
|
|
|
+ System.err.println("communication disabled");
|
|
|
} else ureg[1] = e.getKeyChar();
|
|
|
}
|
|
|
public void keyReleased(KeyEvent e) {}
|
|
@@ -118,20 +127,24 @@ public class Iiixmish2 {
|
|
|
new Thread() {
|
|
|
public void run() {
|
|
|
while(true) {
|
|
|
- try {
|
|
|
- byte[] message = Files.readAllBytes(Paths.get(".comm"));
|
|
|
- if(message.length < 1) {
|
|
|
+ if(comm) {
|
|
|
+ try {
|
|
|
+ byte[] message = Files.readAllBytes(Paths.get(".comm"));
|
|
|
+ if(message.length < 1) {
|
|
|
+ Thread.sleep(10);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for(int i = 0; i < message.length; i++) {
|
|
|
+ mem[9999872 + i] = (int)message[i];
|
|
|
+ }
|
|
|
Thread.sleep(10);
|
|
|
- continue;
|
|
|
- }
|
|
|
- for(int i = 0; i < message.length; i++) {
|
|
|
- mem[9999872 + i] = (int)message[i];
|
|
|
+ Files.deleteIfExists(Paths.get(".comm"));
|
|
|
+ Files.createFile(Paths.get(".comm"));
|
|
|
+ } catch(Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- Thread.sleep(10);
|
|
|
- Files.deleteIfExists(Paths.get(".comm"));
|
|
|
- Files.createFile(Paths.get(".comm"));
|
|
|
- } catch(Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ } else {
|
|
|
+ try { Thread.sleep(100); } catch(Exception e) {}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -139,16 +152,20 @@ public class Iiixmish2 {
|
|
|
new Thread() {
|
|
|
public void run() {
|
|
|
while(true) {
|
|
|
- try {
|
|
|
- Thread.sleep(20);
|
|
|
- Files.deleteIfExists(Paths.get(".comm2"));
|
|
|
- Files.createFile(Paths.get(".comm2"));
|
|
|
- byte[] answer = new byte[100];
|
|
|
- for(int i = 0; i < answer.length; i++)
|
|
|
- answer[i] = (byte)mem[9999000 + i];
|
|
|
- Files.write(Paths.get(".comm2"), answer);
|
|
|
- } catch(Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ if(comm) {
|
|
|
+ try {
|
|
|
+ Thread.sleep(20);
|
|
|
+ Files.deleteIfExists(Paths.get(".comm2"));
|
|
|
+ Files.createFile(Paths.get(".comm2"));
|
|
|
+ byte[] answer = new byte[100];
|
|
|
+ for(int i = 0; i < answer.length; i++)
|
|
|
+ answer[i] = (byte)mem[9999000 + i];
|
|
|
+ Files.write(Paths.get(".comm2"), answer);
|
|
|
+ } catch(Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ try { Thread.sleep(100); } catch(Exception e) {}
|
|
|
}
|
|
|
}
|
|
|
}
|