Tying up some loose ends
This commit is contained in:
+2
-2
@@ -191,9 +191,9 @@ class Core {
|
||||
}
|
||||
|
||||
// Execute until the next current instruction
|
||||
runNext(sims, options) {
|
||||
runToNext(sims, options) {
|
||||
return this.message({
|
||||
command: "runNext",
|
||||
command: "runToNext",
|
||||
sims : Array.isArray(sims) ?
|
||||
sims.map(s=>s.pointer) : [ sims.pointer ]
|
||||
}, [], options);
|
||||
|
||||
@@ -210,11 +210,11 @@ class CoreThread {
|
||||
}
|
||||
|
||||
// Execute until the next current instruction
|
||||
runNext(msg) {
|
||||
runToNext(msg) {
|
||||
let sims = this.malloc(msg.sims.length, true);
|
||||
for (let x = 0; x < msg.sims.length; x++)
|
||||
sims[x] = msg.sims[x];
|
||||
this.RunNext(sims.pointer, msg.sims.length);
|
||||
this.RunToNext(sims.pointer, msg.sims.length);
|
||||
this.free(sims);
|
||||
|
||||
let pcs = new Array(msg.sims.length);
|
||||
|
||||
+8
-8
@@ -41,19 +41,19 @@ EMSCRIPTEN_KEEPALIVE int PointerSize() {
|
||||
////////////////////////////// Debugger Commands //////////////////////////////
|
||||
|
||||
// Execute until the following instruction
|
||||
static uint32_t RunNextAddress;
|
||||
static int RunNextFetch(VB *sim, int fetch, VBAccess *access) {
|
||||
return access->address == RunNextAddress;
|
||||
static uint32_t RunToNextAddress;
|
||||
static int RunToNextFetch(VB *sim, int fetch, VBAccess *access) {
|
||||
return access->address == RunToNextAddress;
|
||||
}
|
||||
static int RunNextExecute(VB *sim, VBInstruction *inst) {
|
||||
RunNextAddress = inst->address + inst->size;
|
||||
static int RunToNextExecute(VB *sim, VBInstruction *inst) {
|
||||
RunToNextAddress = inst->address + inst->size;
|
||||
vbSetCallback(sim, VB_ONEXECUTE, NULL);
|
||||
vbSetCallback(sim, VB_ONFETCH, &RunNextFetch);
|
||||
vbSetCallback(sim, VB_ONFETCH, &RunToNextFetch);
|
||||
return 0;
|
||||
}
|
||||
EMSCRIPTEN_KEEPALIVE void RunNext(VB **sims, int count) {
|
||||
EMSCRIPTEN_KEEPALIVE void RunToNext(VB **sims, int count) {
|
||||
uint32_t clocks = 20000000; // 1s
|
||||
vbSetCallback(sims[0], VB_ONEXECUTE, &RunNextExecute);
|
||||
vbSetCallback(sims[0], VB_ONEXECUTE, &RunToNextExecute);
|
||||
vbEmulateEx (sims, count, &clocks);
|
||||
vbSetCallback(sims[0], VB_ONEXECUTE, NULL);
|
||||
vbSetCallback(sims[0], VB_ONFETCH , NULL);
|
||||
|
||||
Reference in New Issue
Block a user