misc: get rid of some errors from Cargo lol
This commit is contained in:
@@ -1,2 +1,7 @@
|
|||||||
[build]
|
[build]
|
||||||
rustc-wrapper = "sccache"
|
rustc-wrapper = "sccache"
|
||||||
|
# Enable to cut unused deps.
|
||||||
|
# rustflags = ["-D", "unused-crate-dependencies"]
|
||||||
|
|
||||||
|
[future-incompat-report]
|
||||||
|
frequency = "always"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
cargo-features = ["codegen-backend"]
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["emulator", "common", "assembler", "dsa_editor"]
|
members = ["emulator", "common", "assembler", "dsa_editor"]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
@@ -6,3 +8,10 @@ resolver = "3"
|
|||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["zxq5", "nullndvoid"]
|
authors = ["zxq5", "nullndvoid"]
|
||||||
|
|
||||||
|
[profile.dev]
|
||||||
|
codegen-backend = "cranelift"
|
||||||
|
panic = "abort" # Cranelift does not support stack unwinds.
|
||||||
|
lto = false
|
||||||
|
debug = true
|
||||||
|
incremental = false # sccache does not support caching incremental crates.
|
||||||
|
|||||||
@@ -113,11 +113,10 @@ impl Parser {
|
|||||||
let dest = expect_type!(self.next()?, Register)?;
|
let dest = expect_type!(self.next()?, Register)?;
|
||||||
|
|
||||||
let mut offset = Token::Immediate(0);
|
let mut offset = Token::Immediate(0);
|
||||||
if let Ok(next) = self.peek_next() {
|
if let Ok(next) = self.peek_next()
|
||||||
if expect_type!(next, Immediate).is_ok() {
|
&& expect_type!(next, Immediate).is_ok() {
|
||||||
offset = self.next()?;
|
offset = self.next()?;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
args = vec![base, dest, offset];
|
args = vec![base, dest, offset];
|
||||||
}
|
}
|
||||||
@@ -125,11 +124,10 @@ impl Parser {
|
|||||||
let base = expect_type!(self.next()?, Register)?;
|
let base = expect_type!(self.next()?, Register)?;
|
||||||
let dest = expect_type!(self.next()?, Register, Symbol)?;
|
let dest = expect_type!(self.next()?, Register, Symbol)?;
|
||||||
let mut offset = Token::Immediate(0);
|
let mut offset = Token::Immediate(0);
|
||||||
if let Ok(next) = self.peek_next() {
|
if let Ok(next) = self.peek_next()
|
||||||
if expect_type!(next, Immediate).is_ok() {
|
&& expect_type!(next, Immediate).is_ok() {
|
||||||
offset = self.next()?;
|
offset = self.next()?;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
args = vec![base, dest, offset];
|
args = vec![base, dest, offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,3 +24,6 @@ pub mod prelude {
|
|||||||
pub use crate::tooling::brainf;
|
pub use crate::tooling::brainf;
|
||||||
pub use crate::tooling::project;
|
pub use crate::tooling::project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use num_cpus as _;
|
||||||
|
use threadpool as _;
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
use common as _;
|
||||||
|
use num_cpus as _;
|
||||||
|
use threadpool as _;
|
||||||
|
|
||||||
use assembler::{
|
use assembler::{
|
||||||
prelude::*,
|
prelude::*,
|
||||||
tooling::{brainf, project},
|
tooling::{brainf, project},
|
||||||
@@ -23,7 +27,7 @@ fn main() {
|
|||||||
|
|
||||||
let mut file = match fs::File::create("brainf.dsb") {
|
let mut file = match fs::File::create("brainf.dsb") {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("Failed to create output file: {}", e);
|
eprintln!("Failed to create output file: {e}");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
@@ -31,7 +35,7 @@ fn main() {
|
|||||||
|
|
||||||
for instruction in result {
|
for instruction in result {
|
||||||
if let Err(e) = file.write(&instruction.encode().to_be_bytes()) {
|
if let Err(e) = file.write(&instruction.encode().to_be_bytes()) {
|
||||||
eprintln!("Failed to write to output file: {}", e);
|
eprintln!("Failed to write to output file: {e}");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,7 +61,7 @@ fn main() {
|
|||||||
|
|
||||||
for instruction in result {
|
for instruction in result {
|
||||||
if let Err(e) = fs::write(output_path, instruction.encode().to_be_bytes()) {
|
if let Err(e) = fs::write(output_path, instruction.encode().to_be_bytes()) {
|
||||||
eprintln!("Failed to write to output file: {}", e);
|
eprintln!("Failed to write to output file: {e}");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-7
@@ -1,8 +1,3 @@
|
|||||||
cargo-features = ["codegen-backend"]
|
|
||||||
|
|
||||||
[profile.dev]
|
|
||||||
codegen-backend = "cranelift"
|
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "emulator"
|
name = "emulator"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -22,7 +17,6 @@ required-features = ["config"]
|
|||||||
common = { path = "../common" }
|
common = { path = "../common" }
|
||||||
assembler = { path = "../assembler" }
|
assembler = { path = "../assembler" }
|
||||||
dsa_editor = { path = "../dsa_editor" }
|
dsa_editor = { path = "../dsa_editor" }
|
||||||
eframe = { version = "0.31.1" }
|
|
||||||
egui = "0.31.1"
|
egui = "0.31.1"
|
||||||
dirs = "6.0.0"
|
dirs = "6.0.0"
|
||||||
discord-presence = { version = "1.6.0", optional = true }
|
discord-presence = { version = "1.6.0", optional = true }
|
||||||
@@ -35,7 +29,7 @@ default = ["config"]
|
|||||||
discord-rpc = ["dep:discord-presence"]
|
discord-rpc = ["dep:discord-presence"]
|
||||||
config = ["dep:toml", "dep:serde"]
|
config = ["dep:toml", "dep:serde"]
|
||||||
|
|
||||||
# Add support for Android for the fun of it.
|
# Add support for Android for the fun of it. Currently crashes lol.
|
||||||
[target.'cfg(target_os = "android")'.dependencies]
|
[target.'cfg(target_os = "android")'.dependencies]
|
||||||
winit = { version = "0.30.11", features = ["android-native-activity"] }
|
winit = { version = "0.30.11", features = ["android-native-activity"] }
|
||||||
# jni = "0.21.1"
|
# jni = "0.21.1"
|
||||||
@@ -43,3 +37,6 @@ winit = { version = "0.30.11", features = ["android-native-activity"] }
|
|||||||
[target.'cfg(target_os = "android")'.dependencies.eframe]
|
[target.'cfg(target_os = "android")'.dependencies.eframe]
|
||||||
version = "0.31.1"
|
version = "0.31.1"
|
||||||
features = ["android-native-activity"]
|
features = ["android-native-activity"]
|
||||||
|
|
||||||
|
[target.'cfg(not(target_os = "android"))'.dependencies.eframe]
|
||||||
|
version = "0.31.1"
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::{
|
use std::sync::mpsc::{self, Receiver, Sender};
|
||||||
sync::mpsc::{self, Receiver, Sender},
|
|
||||||
thread,
|
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use crate::emulator::misc::rpc::{Activity, RpcClient};
|
use crate::emulator::misc::rpc::{Activity, RpcClient};
|
||||||
|
|||||||
@@ -218,8 +218,9 @@ impl Editor {
|
|||||||
|
|
||||||
fn handle_file_dialogs(&mut self, ctx: &egui::Context) {
|
fn handle_file_dialogs(&mut self, ctx: &egui::Context) {
|
||||||
// Handle open dialog
|
// Handle open dialog
|
||||||
if let Some(dialog) = &mut self.open_file_dialog {
|
if let Some(dialog) = &mut self.open_file_dialog
|
||||||
if dialog.show(ctx).selected() {
|
&& dialog.show(ctx).selected()
|
||||||
|
{
|
||||||
if let Some(file) = dialog.path() {
|
if let Some(file) = dialog.path() {
|
||||||
// check if the file is a binary file
|
// check if the file is a binary file
|
||||||
if file.extension().is_some_and(|ext| ext == "dsb") {
|
if file.extension().is_some_and(|ext| ext == "dsb") {
|
||||||
@@ -259,11 +260,11 @@ impl Editor {
|
|||||||
}
|
}
|
||||||
self.open_file_dialog = None;
|
self.open_file_dialog = None;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Handle save dialog
|
// Handle save dialog
|
||||||
if let Some(dialog) = &mut self.save_file_dialog {
|
if let Some(dialog) = &mut self.save_file_dialog
|
||||||
if dialog.show(ctx).selected() {
|
&& dialog.show(ctx).selected()
|
||||||
|
{
|
||||||
if let Some(file) = dialog.path() {
|
if let Some(file) = dialog.path() {
|
||||||
self.buffer = self.text.clone();
|
self.buffer = self.text.clone();
|
||||||
|
|
||||||
@@ -302,7 +303,6 @@ impl Editor {
|
|||||||
self.save_file_dialog = None;
|
self.save_file_dialog = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn render_output(&self, _state: &mut State, ui: &mut Ui, _ctx: &Context) {
|
fn render_output(&self, _state: &mut State, ui: &mut Ui, _ctx: &Context) {
|
||||||
// Output area with synchronized scrolling
|
// Output area with synchronized scrolling
|
||||||
|
|||||||
@@ -115,8 +115,9 @@ impl Loader {
|
|||||||
|
|
||||||
fn handle_file_dialogs(&mut self, ctx: &egui::Context) {
|
fn handle_file_dialogs(&mut self, ctx: &egui::Context) {
|
||||||
// Handle open dialog
|
// Handle open dialog
|
||||||
if let Some(dialog) = &mut self.open_file_dialog {
|
if let Some(dialog) = &mut self.open_file_dialog
|
||||||
if dialog.show(ctx).selected() {
|
&& dialog.show(ctx).selected()
|
||||||
|
{
|
||||||
if let Some(file) = dialog.path() {
|
if let Some(file) = dialog.path() {
|
||||||
// check if the file is a binary file
|
// check if the file is a binary file
|
||||||
if file.extension().is_some_and(|ext| ext == "dsb") {
|
if file.extension().is_some_and(|ext| ext == "dsb") {
|
||||||
@@ -134,7 +135,6 @@ impl Loader {
|
|||||||
self.open_file_dialog = None;
|
self.open_file_dialog = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn render_output(&self, _state: &mut State, ui: &mut Ui, _ctx: &Context) {
|
fn render_output(&self, _state: &mut State, ui: &mut Ui, _ctx: &Context) {
|
||||||
// Output area with synchronized scrolling
|
// Output area with synchronized scrolling
|
||||||
|
|||||||
Reference in New Issue
Block a user