diff --git a/emulator/frontends/pixels/assets/moa-genesis/interface.js b/emulator/frontends/pixels/assets/moa-genesis/interface.js index fc20f53..a2a9a41 100644 --- a/emulator/frontends/pixels/assets/moa-genesis/interface.js +++ b/emulator/frontends/pixels/assets/moa-genesis/interface.js @@ -9,23 +9,15 @@ function initialize_emulator() { setTimeout(function refreshFrame() { let current = performance.now(); let diff = current - last_update; -let realdiff = current - last_update; //let remaining = Math.max((16 * Emulator.get_speed()) - diff, 0); last_update = current; let runtime = Emulator.run_system_for(system, diff * 1_000_000); if (Emulator.is_running()) { let remaining = Math.max(diff - runtime - (diff * 0.1), 1); - console.log(realdiff, diff, runtime, remaining); setTimeout(refreshFrame, remaining); } }, 0); - /* - setTimeout(function refreshFrame() { - let run_time = run_system_for(system, 66_000_000); - setTimeout(refreshFrame, 66 - run_time); - }, 0); - */ Emulator.host_run_loop(host); } diff --git a/emulator/frontends/pixels/src/web.rs b/emulator/frontends/pixels/src/web.rs index c90fde7..0d566b9 100644 --- a/emulator/frontends/pixels/src/web.rs +++ b/emulator/frontends/pixels/src/web.rs @@ -96,7 +96,7 @@ pub fn run_system_for(handle: &mut SystemHandle, nanos: u32) -> usize { log::error!("{:?}", err); } let run_time = run_timer.elapsed().as_millis(); - log::warn!("ran simulation for {:?}ms in {:?}ms", nanoseconds_per_frame / 1_000_000, run_time); + log::debug!("ran simulation for {:?}ms in {:?}ms", nanoseconds_per_frame / 1_000_000, run_time); run_time as usize } diff --git a/todo.txt b/todo.txt index 14bc886..7805564 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,8 @@ +* can you refactor the update timeout to put it in rust? Would that make it faster? (the tricky part is the closure) +* re-enable sound on webassembly, see if it works (it does not. Very lagged and jittery with what sounds like repeated frames) + + * can you somehow speed up the memory accessing through the sim? The dyn Addressable is causing a fair amount of overhead * can you somehow make devices have two step functions for running things at different times? (I'm thinking ym2612 audio gen vs timers) * should you rename devices.rs traits.rs?