Less JS, more happiness

This commit is contained in:
Fabian 2020-12-31 19:14:30 -06:00
parent e1f8a563ad
commit df46ffb598
3 changed files with 9 additions and 20 deletions

View file

@ -111,8 +111,6 @@ function V86Starter(options)
"hlt_op": function() { return cpu.hlt_op(); },
"abort": function() { dbg_assert(false); },
"logop": function(eip, op) { return cpu.debug.logop(eip, op); },
"undefined_instruction": function() { return cpu.undefined_instruction.apply(cpu, arguments); },
"unimplemented_sse": function() { return cpu.unimplemented_sse(); },
"microtick": v86.microtick,
"get_rand_int": function() { return v86util.get_rand_int(); },
"dbg_trace": function()

View file

@ -2346,20 +2346,6 @@ CPU.prototype.hlt_op = function()
this.hlt_loop();
};
CPU.prototype.undefined_instruction = function()
{
dbg_assert(false, "Possible fault: undefined instruction");
this.trigger_ud();
};
CPU.prototype.unimplemented_sse = function()
{
const opcode = this.safe_read32s(this.previous_ip[0]);
console.log("No SSE: " + h(opcode & 0xFF) + " " + h(opcode >> 8 & 0xFF) + " " + h(opcode >> 16 & 0xFF), LOG_CPU);
dbg_assert(false);
this.trigger_ud();
};
CPU.prototype.handle_irqs = function()
{
//dbg_assert(this.prefixes[0] === 0);

View file

@ -1,10 +1,6 @@
#![allow(non_snake_case, non_upper_case_globals, unused_variables)]
extern "C" {
#[no_mangle]
fn unimplemented_sse();
#[no_mangle]
fn undefined_instruction();
#[no_mangle]
fn lss16(x: i32, y: i32, z: i32);
#[no_mangle]
@ -27,6 +23,15 @@ extern "C" {
fn load_ldt(v: i32);
}
unsafe fn undefined_instruction() {
dbg_assert!(false, "Undefined instructions");
trigger_ud()
}
unsafe fn unimplemented_sse() {
dbg_assert!(false, "Unimplemented SSE instruction");
trigger_ud()
}
use cpu2::arith::{
bsf16, bsf32, bsr16, bsr32, bt_mem, bt_reg, btc_mem, btc_reg, btr_mem, btr_reg, bts_mem,
bts_reg, cmpxchg8, cmpxchg16, cmpxchg32, popcnt, shld16, shld32, shrd16, shrd32, xadd8, xadd16,