pvbemu/src/desktop/Main.java

66 lines
1.9 KiB
Java

// Java imports
import java.io.*;
// Project imports
import app.*;
import util.*;
import vue.*;
// Desktop application primary class
public class Main {
// Program entry point
public static void main(String[] args) {
// Configure Swing look-and-feel
Util.setSystemLAF();
// Load the native module, if available
for (String filename : Util.listFiles("native")) {
File file = null;
// Skip any file that isn't a shared object library
if (!filename.endsWith(".dll") && !filename.endsWith(".so"))
continue;
// Write the contents of the native object file
FileOutputStream stream = null;
try {
file = File.createTempFile("native", "." + filename);
stream = new FileOutputStream(file);
stream.write(Util.fileRead("native/" + filename));
} catch (Exception e) { file = null; }
try { stream.close(); } catch (Exception e) { }
// Load the native object file into the JVM
try {
System.load(file.getAbsolutePath());
Vue.setNativeID(filename.substring(0,
filename.lastIndexOf(".")));
break;
}
catch (Error e) { }
}
// Use the native module
boolean useNative = false;
for (String arg : args)
if (arg.trim().toLowerCase().equals("native"))
useNative = true;
// Begin application operations
new App(useNative);
/*
var brk = new Breakpoint();
String exp = "([sp - 8] & 3) << 6 != 12.0 + r6 * ecr && [0x0500008C + r8] == 0";
System.out.println(exp);
if (brk.setCondition(exp))
System.out.println(brk.debug());
else System.out.println(brk.getErrorCode() + "\t" +
brk.getErrorPosition() + ":" + brk.getErrorText());
*/
}
}