changed futex crate for mac compat (maybe) and image to bitmap assembly converter
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
|
||||
use std::env::args;
|
||||
use std::hint::unlikely;
|
||||
use std::io::stdin;
|
||||
use std::process::exit;
|
||||
use std::sync::{
|
||||
Arc,
|
||||
@@ -18,17 +17,16 @@ use std::thread::scope;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use pixels::{Error, Pixels, SurfaceTexture};
|
||||
use wait_on_address::AtomicWait;
|
||||
use winit::application::ApplicationHandler;
|
||||
use winit::dpi::LogicalSize;
|
||||
use winit::event::WindowEvent;
|
||||
use winit::event_loop::EventLoop;
|
||||
use winit::platform::modifier_supplement::KeyEventExtModifierSupplement;
|
||||
use winit::platform::scancode::PhysicalKeyExtScancode;
|
||||
use winit::window::Window;
|
||||
// use winit_input_helper::WinitInputHelper;
|
||||
|
||||
use crate::cpu::{Computer, MMIOInterupt};
|
||||
|
||||
mod cpu;
|
||||
use cpu::SHARED;
|
||||
|
||||
@@ -37,7 +35,7 @@ fn wait_int() {
|
||||
while unlikely(v != 0) {
|
||||
#[cfg(feature = "debug")]
|
||||
println!("wating for interupt clear {v}");
|
||||
atomic_wait::wait(&SHARED.external_interupts, v);
|
||||
SHARED.external_interupts.wait(v);
|
||||
v = (&SHARED.external_interupts).load(Acquire);
|
||||
}
|
||||
}
|
||||
@@ -123,7 +121,7 @@ impl<'a> ApplicationHandler for App<'a> {
|
||||
(&SHARED.external_interupts).store(MMIOInterupt::Keyboard.into(), Release);
|
||||
#[cfg(feature = "debug")]
|
||||
println!("wake due to keyboard event");
|
||||
atomic_wait::wake_all(&SHARED.external_interupts);
|
||||
SHARED.external_interupts.notify_one();
|
||||
}
|
||||
}
|
||||
WindowEvent::CursorMoved { position, .. } => {
|
||||
@@ -152,7 +150,7 @@ impl<'a> ApplicationHandler for App<'a> {
|
||||
(&SHARED.external_interupts).store(MMIOInterupt::MouseMove.into(), Release);
|
||||
#[cfg(feature = "debug")]
|
||||
println!("wake due mouse move");
|
||||
atomic_wait::wake_all(&SHARED.external_interupts);
|
||||
SHARED.external_interupts.notify_one();
|
||||
}
|
||||
}
|
||||
// WindowEvent::MouseWheel {
|
||||
@@ -186,7 +184,7 @@ impl<'a> ApplicationHandler for App<'a> {
|
||||
(&SHARED.external_interupts).store(MMIOInterupt::MouseClick.into(), Release);
|
||||
#[cfg(feature = "debug")]
|
||||
println!("wake mouse click");
|
||||
atomic_wait::wake_all(&SHARED.external_interupts);
|
||||
SHARED.external_interupts.notify_one();
|
||||
}
|
||||
}
|
||||
WindowEvent::ScaleFactorChanged { .. } => {
|
||||
@@ -199,7 +197,7 @@ impl<'a> ApplicationHandler for App<'a> {
|
||||
!= 0;
|
||||
if enabled {
|
||||
(&SHARED.external_interupts).store(MMIOInterupt::VSync.into(), Relaxed);
|
||||
atomic_wait::wake_all(&SHARED.external_interupts);
|
||||
SHARED.external_interupts.notify_one();
|
||||
wait_int();
|
||||
}
|
||||
let pix = self.pixels.as_mut().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user