77 lines
2.2 KiB
Java
77 lines
2.2 KiB
Java
package vue;
|
|
|
|
// Native-backed emulation core implementation
|
|
class NativeVUE extends VUE {
|
|
|
|
// Instance fields
|
|
private byte[] pointer; // Context address in native memory
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
// Constructors //
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// Default constructor
|
|
NativeVUE() {
|
|
construct();
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
// Public Methods //
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// Release any used resources
|
|
public native void dispose();
|
|
|
|
// Process the simulation
|
|
public native int emulate(int maxCycles);
|
|
|
|
// Retrieve the application break code
|
|
public native int getBreakCode();
|
|
|
|
// Retrieve a register value
|
|
public native int getRegister(int index, boolean system);
|
|
|
|
// Retrieve a copy of the ROM data
|
|
public native byte[] getROM();
|
|
|
|
// Determine whether the context is native-backed
|
|
public native boolean isNative();
|
|
|
|
// Read a value from the CPU bus
|
|
public native int read(int address, int type);
|
|
|
|
// Read bytes from the CPU bus
|
|
public native boolean readBytes(int address, byte[] dest, int offset,
|
|
int length);
|
|
|
|
// Initialize all system components
|
|
public native void reset();
|
|
|
|
// Specify a register value
|
|
public native int setRegister(int index, boolean system, int value);
|
|
|
|
// Provide new ROM data
|
|
public native boolean setROM(byte[] data, int offset, int length);
|
|
|
|
// Write a value to the CPU bus
|
|
public native void write(int address, int type, int value);
|
|
|
|
// Write bytes to the CPU bus
|
|
public native boolean writeBytes(int address, byte[] src, int offset,
|
|
int length);
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
// Private Methods //
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// Native constructor
|
|
private native void construct();
|
|
|
|
}
|