diff --git a/Cargo.lock b/Cargo.lock index 266ce2f..a53f851 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,22 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "ab_glyph" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser", -] - -[[package]] -name = "ab_glyph_rasterizer" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" - [[package]] name = "ahash" version = "0.8.12" @@ -1107,15 +1091,6 @@ dependencies = [ "libredox", ] -[[package]] -name = "owned_ttf_parser" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" -dependencies = [ - "ttf-parser", -] - [[package]] name = "parking_lot" version = "0.12.5" @@ -1378,12 +1353,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -1396,9 +1365,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" dependencies = [ - "ab_glyph", "log", - "memmap2", "smithay-client-toolkit", "tiny-skia", ] @@ -1645,12 +1612,6 @@ version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -[[package]] -name = "ttf-parser" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" - [[package]] name = "ultraviolet" version = "0.9.2" @@ -1777,7 +1738,6 @@ dependencies = [ "cc", "downcast-rs", "rustix 1.1.4", - "scoped-tls", "smallvec", "wayland-sys", ] @@ -1828,19 +1788,6 @@ dependencies = [ "wayland-scanner", ] -[[package]] -name = "wayland-protocols-plasma" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d392fc283a87774afc9beefcd6f931582bb97fe0e6ced0b306a62cb1d026527c" -dependencies = [ - "bitflags 2.11.0", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-scanner", -] - [[package]] name = "wayland-protocols-wlr" version = "0.3.11" @@ -1871,9 +1818,6 @@ version = "0.31.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374f6b70e8e0d6bf9461a32988fd553b59ff630964924dad6e4a4eb6bd538d17" dependencies = [ - "dlib", - "log", - "once_cell", "pkg-config", ] @@ -2273,10 +2217,6 @@ dependencies = [ "unicode-segmentation", "wasm-bindgen", "wasm-bindgen-futures", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-protocols-plasma", "web-sys", "web-time", "windows-sys 0.52.0", diff --git a/Cargo.toml b/Cargo.toml index d50881a..71cd995 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,5 +5,5 @@ edition = "2024" [dependencies] pixels = "0.15.0" -winit = "0.30.13" +winit = { version = "0.30.13", default-features = false, features = ["x11", "x11-dl", "x11rb", "ahash", "bytemuck", "memmap2", "rwh_06", "sctk", "sctk-adwaita"] } winit_input_helper = "0.17.0" diff --git a/sim_rs.tar.xz b/sim_rs.tar.xz index 1a6b2d4..1a541dd 100644 Binary files a/sim_rs.tar.xz and b/sim_rs.tar.xz differ diff --git a/src/cpu.rs b/src/cpu.rs index 1304388..df556e3 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -290,11 +290,16 @@ impl<'a, 'b> Computer<'a, 'b> { } self.pc = (addr + self.pc as u32) as usize; } - Instruction::Call(addr) => { + Instruction::Call(mut addr) => { self.sp -= 1; self.ram[self.sp] = ((self.pc << 2) + 4) as u32; - self.pc += addr as usize; - self.pc &= 0x3FFFFFFF; //wrapping on 30 bit pc + + if addr & (1 << 28) != 0 { + addr += 7 << 29; + } else if unlikely(addr == 0) { + sleep(Duration::from_hours(1)); + } + self.pc = (addr + self.pc as u32) as usize; } Instruction::Ret() => { self.pc = (self.ram[self.sp] >> 2) as usize; diff --git a/src/main.rs b/src/main.rs index 996be20..7d0fbba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ use pixels::{Error, Pixels, SurfaceTexture}; use winit::dpi::LogicalSize; use winit::event::{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; @@ -89,7 +90,7 @@ fn main() -> Result<(), Error> { match event.state { winit::event::ElementState::Pressed => { if let Some(val) = event.physical_key.to_scancode() { - kbref.store(val, std::sync::atomic::Ordering::Relaxed); + kbref.store(val + 8, std::sync::atomic::Ordering::Relaxed); } } winit::event::ElementState::Released => {