diff --git a/.idea/Chip8Emulator.iml b/.idea/Chip8Emulator.iml index cf84ae4..f8a19b8 100644 --- a/.idea/Chip8Emulator.iml +++ b/.idea/Chip8Emulator.iml @@ -2,7 +2,7 @@ - + diff --git a/Cargo.lock b/Cargo.lock index 1337e03..374bd03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,20 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "Chip8Emulator" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "crossterm", - "env_logger", - "log", - "pretty_assertions", - "rand", - "ratatui", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -82,9 +68,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "autocfg" @@ -173,9 +159,9 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "compact_str" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" +checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" dependencies = [ "castaway", "cfg-if", @@ -257,11 +243,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "emulator" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "crossterm", + "env_logger", + "log", + "pretty_assertions", + "rand", + "ratatui", +] + [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -269,9 +269,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ "anstream", "anstyle", @@ -304,9 +304,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "getrandom" @@ -356,13 +356,12 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "instability" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b829f37dead9dc39df40c2d3376c179fdfd2ac771f53f55d3c30dc096a3c0c6e" +checksum = "894813a444908c0c8c0e221b041771d107c4a21de1d317dc49bcc66e3c9e5b3f" dependencies = [ "darling", "indoc", - "pretty_assertions", "proc-macro2", "quote", "syn", @@ -391,9 +390,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "linux-raw-sys" @@ -503,9 +502,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -563,9 +562,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags", ] @@ -601,22 +600,22 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" @@ -702,9 +701,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 2f85dc5..a620ccd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,23 +1,5 @@ -[package] -name = "Chip8Emulator" -version = "0.1.0" -edition = "2021" +[workspace] -[lints.rust] -dead_code = "allow" - -[profile.release] -lto = true -codegen-units = 1 - -[dependencies] -log = "0.4.22" -env_logger = "0.11.5" -anyhow = "1.0.93" -ratatui = "0.29.0" -crossterm = "0.28.1" -rand = "0.8.5" -clap = { version = "4.5.23", features = ["derive"] } - -[dev-dependencies] -pretty_assertions = "1.4.1" +members = [ + "emulator", +] \ No newline at end of file diff --git a/emulator/Cargo.toml b/emulator/Cargo.toml new file mode 100644 index 0000000..0bb5a93 --- /dev/null +++ b/emulator/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "emulator" +version = "0.1.0" +edition = "2021" + +[lints.rust] +dead_code = "allow" + +[profile.release] +lto = true +codegen-units = 1 + +[dependencies] +log = "0.4.22" +env_logger = "0.11.5" +anyhow = "1.0.93" +ratatui = "0.29.0" +crossterm = "0.28.1" +rand = "0.8.5" +clap = { version = "4.5.23", features = ["derive"] } + +[dev-dependencies] +pretty_assertions = "1.4.1" diff --git a/src/display.rs b/emulator/src/display.rs similarity index 100% rename from src/display.rs rename to emulator/src/display.rs diff --git a/src/emulator.rs b/emulator/src/emulator.rs similarity index 99% rename from src/emulator.rs rename to emulator/src/emulator.rs index be8cefd..46421b6 100644 --- a/src/emulator.rs +++ b/emulator/src/emulator.rs @@ -501,7 +501,7 @@ mod tests { #[test] fn test_load_rom_ibm_logo() { // Setup - let mut file = File::open("roms/ibm-logo.ch8").expect("Failed to test open ROM"); + let mut file = File::open("../../roms/ibm-logo.ch8").expect("Failed to test open ROM"); let mut rom_file_data: [u8; 132] = [0; 132]; file.read(&mut rom_file_data) .expect("Failed to read test ROM"); diff --git a/src/input.rs b/emulator/src/input.rs similarity index 100% rename from src/input.rs rename to emulator/src/input.rs diff --git a/src/instruction.rs b/emulator/src/instruction.rs similarity index 100% rename from src/instruction.rs rename to emulator/src/instruction.rs diff --git a/src/main.rs b/emulator/src/main.rs similarity index 100% rename from src/main.rs rename to emulator/src/main.rs diff --git a/src/sound.rs b/emulator/src/sound.rs similarity index 100% rename from src/sound.rs rename to emulator/src/sound.rs diff --git a/src/stack.rs b/emulator/src/stack.rs similarity index 100% rename from src/stack.rs rename to emulator/src/stack.rs