Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/browser/starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ export function V86(options)
"cpu_event_halt": () => { this.emulator_bus.send("cpu-event-halt"); },
"abort": function() { dbg_assert(false); },
"microtick": v86.microtick,
"get_epoch_milis": function () { return Date.now(); },
"getDate": function (date) { return (new Date(date)).getUTCDate(); },
"getDay": function (date) { return (new Date(date)).getUTCDay(); },
"getFullYear": function (date) { return (new Date(date)).getUTCFullYear(); },
"getMonth": function (date) { return (new Date(date)).getUTCMonth(); },
"getHours": function (date) { return (new Date(date)).getUTCHours(); },
"getMinutes": function (date) { return (new Date(date)).getUTCMinutes(); },
"getSeconds": function (date) { return (new Date(date)).getUTCSeconds(); },
"newDate": function (year, month, day, hour, minute, second) {
return new Date(Date.UTC(year, month, day, hour, minute, second));
},
"get_rand_int": function() { return get_rand_int(); },
"stop_idling": function() { return cpu.stop_idling(); },

Expand Down
39 changes: 39 additions & 0 deletions src/cpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,45 @@ CPU.prototype.wasm_patch = function()
this.get_apic_addr = get_import("get_apic_addr");
this.get_ioapic_addr = get_import("get_ioapic_addr");

this.rtc_new = get_import("rtc_new");
this.port_70_write = get_import("port_70_write");
this.port_71_read = get_import("port_71_read");
this.port_71_write = get_import("port_71_write");
this.cmos_read = get_import("cmos_read");
this.cmos_write = get_import("cmos_write");
this.rtc_timer = get_import("rtc_timer");
this.get_cmos_index = get_import("get_cmos_index");
this.set_cmos_index = get_import("set_cmos_index");
this.get_cmos_data_byte = get_import("get_cmos_data_byte");
this.set_cmos_data_byte = get_import("set_cmos_data_byte");
this.get_rtc_time = get_import("get_rtc_time");
this.set_rtc_time = get_import("set_rtc_time");
this.get_last_update = get_import("get_last_update");
this.set_last_update = get_import("set_last_update");
this.get_next_interrupt = get_import("get_next_interrupt");
this.set_next_interrupt = get_import("set_next_interrupt");
this.get_next_interrupt_alarm = get_import("get_next_interrupt_alarm");
this.set_next_interrupt_alarm = get_import("set_next_interrupt_alarm");
this.get_periodic_interrupt = get_import("get_periodic_interrupt");
this.set_periodic_interrupt = get_import("set_periodic_interrupt");
this.get_periodic_interrupt_time = get_import("get_periodic_interrupt_time");
this.set_periodic_interrupt_time = get_import("set_periodic_interrupt_time");
this.get_cmos_a = get_import("get_cmos_a");
this.set_cmos_a = get_import("set_cmos_a");
this.get_cmos_b = get_import("get_cmos_b");
this.set_cmos_b = get_import("set_cmos_b");
this.get_cmos_c = get_import("get_cmos_c");
this.set_cmos_c = get_import("set_cmos_c");
this.get_cmos_diag_status = get_import("get_cmos_diag_status");
this.set_cmos_diag_status = get_import("set_cmos_diag_status");
this.get_nmi_disabled = get_import("get_nmi_disabled");
this.set_nmi_disabled = get_import("set_nmi_disabled");
this.get_update_interrupt = get_import("get_update_interrupt");
this.set_update_interrupt = get_import("set_update_interrupt");
this.get_update_interrupt_time = get_import("get_update_interrupt_time");
this.set_update_interrupt_time = get_import("set_update_interrupt_time");


this.zstd_create_ctx = get_import("zstd_create_ctx");
this.zstd_get_src_ptr = get_import("zstd_get_src_ptr");
this.zstd_free_ctx = get_import("zstd_free_ctx");
Expand Down
Loading
Loading