diff --git a/Cargo.lock b/Cargo.lock index 0d38ef4..7e3ba88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -425,18 +425,24 @@ name = "gb-emu" version = "0.1.0" dependencies = [ "async-ringbuf", + "futures", + "itertools", + "once_cell", + "rand", + "samplerate", +] + +[[package]] +name = "gb-emu-bin" +version = "0.1.0" +dependencies = [ "clap", "cpal", "ctrlc", "futures", + "gb-emu", "gilrs", - "itertools", "minifb", - "once_cell", - "rand", - "ringbuf", - "samplerate", - "spin_sleep", ] [[package]] @@ -1229,16 +1235,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" -[[package]] -name = "spin_sleep" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cafa7900db085f4354dbc7025e25d7a839a14360ea13b5fc4fd717f2d3b23134" -dependencies = [ - "once_cell", - "winapi", -] - [[package]] name = "static_assertions" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index 7c42ab7..5a2850b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,2 @@ -[package] -name = "gb-emu" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -clap = {version = "4.1.8", features = ["derive"]} -spin_sleep = "1.1.1" -minifb = "0.24" -rand = "0.8.5" -gilrs = "0.10.1" -samplerate = "0.2.4" -cpal = "0.15.0" -ringbuf = "0.3.2" -async-ringbuf = "0.1.2" -futures = "0.3.26" -once_cell = "1.17.1" -itertools = "0.10.5" -ctrlc = "3.2.5" +[workspace] +members = ["gb-emu-lib", "gb-emu-bin"] \ No newline at end of file diff --git a/gb-emu-bin/Cargo.toml b/gb-emu-bin/Cargo.toml new file mode 100644 index 0000000..12a75d5 --- /dev/null +++ b/gb-emu-bin/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "gb-emu-bin" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +gb-emu = { path = "../gb-emu-lib" } +clap = {version = "4.1.8", features = ["derive"]} +minifb = "0.24" +gilrs = "0.10.1" +cpal = "0.15.0" +futures = "0.3.26" +ctrlc = "3.2.5" diff --git a/src/main.rs b/gb-emu-bin/src/main.rs similarity index 100% rename from src/main.rs rename to gb-emu-bin/src/main.rs diff --git a/gb-emu-lib/Cargo.toml b/gb-emu-lib/Cargo.toml new file mode 100644 index 0000000..3ebc361 --- /dev/null +++ b/gb-emu-lib/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "gb-emu" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" +samplerate = "0.2.4" +async-ringbuf = "0.1.2" +futures = "0.3.26" +once_cell = "1.17.1" +itertools = "0.10.5" diff --git a/src/connect/mod.rs b/gb-emu-lib/src/connect/mod.rs similarity index 100% rename from src/connect/mod.rs rename to gb-emu-lib/src/connect/mod.rs diff --git a/src/constants.rs b/gb-emu-lib/src/constants.rs similarity index 100% rename from src/constants.rs rename to gb-emu-lib/src/constants.rs diff --git a/src/lib.rs b/gb-emu-lib/src/lib.rs similarity index 100% rename from src/lib.rs rename to gb-emu-lib/src/lib.rs diff --git a/src/processor/instructions/instructions.rs b/gb-emu-lib/src/processor/instructions/instructions.rs similarity index 100% rename from src/processor/instructions/instructions.rs rename to gb-emu-lib/src/processor/instructions/instructions.rs diff --git a/src/processor/instructions/mod.rs b/gb-emu-lib/src/processor/instructions/mod.rs similarity index 100% rename from src/processor/instructions/mod.rs rename to gb-emu-lib/src/processor/instructions/mod.rs diff --git a/src/processor/instructions/primitives.rs b/gb-emu-lib/src/processor/instructions/primitives.rs similarity index 100% rename from src/processor/instructions/primitives.rs rename to gb-emu-lib/src/processor/instructions/primitives.rs diff --git a/src/processor/memory.rs b/gb-emu-lib/src/processor/memory.rs similarity index 100% rename from src/processor/memory.rs rename to gb-emu-lib/src/processor/memory.rs diff --git a/src/processor/memory/interrupts.rs b/gb-emu-lib/src/processor/memory/interrupts.rs similarity index 100% rename from src/processor/memory/interrupts.rs rename to gb-emu-lib/src/processor/memory/interrupts.rs diff --git a/src/processor/memory/mmio/apu.rs b/gb-emu-lib/src/processor/memory/mmio/apu.rs similarity index 100% rename from src/processor/memory/mmio/apu.rs rename to gb-emu-lib/src/processor/memory/mmio/apu.rs diff --git a/src/processor/memory/mmio/apu/channels.rs b/gb-emu-lib/src/processor/memory/mmio/apu/channels.rs similarity index 100% rename from src/processor/memory/mmio/apu/channels.rs rename to gb-emu-lib/src/processor/memory/mmio/apu/channels.rs diff --git a/src/processor/memory/mmio/apu/types.rs b/gb-emu-lib/src/processor/memory/mmio/apu/types.rs similarity index 100% rename from src/processor/memory/mmio/apu/types.rs rename to gb-emu-lib/src/processor/memory/mmio/apu/types.rs diff --git a/src/processor/memory/mmio/gpu.rs b/gb-emu-lib/src/processor/memory/mmio/gpu.rs similarity index 100% rename from src/processor/memory/mmio/gpu.rs rename to gb-emu-lib/src/processor/memory/mmio/gpu.rs diff --git a/src/processor/memory/mmio/gpu/addresses.rs b/gb-emu-lib/src/processor/memory/mmio/gpu/addresses.rs similarity index 100% rename from src/processor/memory/mmio/gpu/addresses.rs rename to gb-emu-lib/src/processor/memory/mmio/gpu/addresses.rs diff --git a/src/processor/memory/mmio/gpu/tile_window.rs b/gb-emu-lib/src/processor/memory/mmio/gpu/tile_window.rs similarity index 100% rename from src/processor/memory/mmio/gpu/tile_window.rs rename to gb-emu-lib/src/processor/memory/mmio/gpu/tile_window.rs diff --git a/src/processor/memory/mmio/gpu/types.rs b/gb-emu-lib/src/processor/memory/mmio/gpu/types.rs similarity index 100% rename from src/processor/memory/mmio/gpu/types.rs rename to gb-emu-lib/src/processor/memory/mmio/gpu/types.rs diff --git a/src/processor/memory/mmio/joypad.rs b/gb-emu-lib/src/processor/memory/mmio/joypad.rs similarity index 100% rename from src/processor/memory/mmio/joypad.rs rename to gb-emu-lib/src/processor/memory/mmio/joypad.rs diff --git a/src/processor/memory/mmio/mod.rs b/gb-emu-lib/src/processor/memory/mmio/mod.rs similarity index 100% rename from src/processor/memory/mmio/mod.rs rename to gb-emu-lib/src/processor/memory/mmio/mod.rs diff --git a/src/processor/memory/mmio/serial.rs b/gb-emu-lib/src/processor/memory/mmio/serial.rs similarity index 100% rename from src/processor/memory/mmio/serial.rs rename to gb-emu-lib/src/processor/memory/mmio/serial.rs diff --git a/src/processor/memory/mmio/timer.rs b/gb-emu-lib/src/processor/memory/mmio/timer.rs similarity index 100% rename from src/processor/memory/mmio/timer.rs rename to gb-emu-lib/src/processor/memory/mmio/timer.rs diff --git a/src/processor/memory/rom.rs b/gb-emu-lib/src/processor/memory/rom.rs similarity index 100% rename from src/processor/memory/rom.rs rename to gb-emu-lib/src/processor/memory/rom.rs diff --git a/src/processor/memory/rom/mbcs.rs b/gb-emu-lib/src/processor/memory/rom/mbcs.rs similarity index 100% rename from src/processor/memory/rom/mbcs.rs rename to gb-emu-lib/src/processor/memory/rom/mbcs.rs diff --git a/src/processor/memory/rom/mbcs/mbc1.rs b/gb-emu-lib/src/processor/memory/rom/mbcs/mbc1.rs similarity index 100% rename from src/processor/memory/rom/mbcs/mbc1.rs rename to gb-emu-lib/src/processor/memory/rom/mbcs/mbc1.rs diff --git a/src/processor/memory/rom/mbcs/mbc2.rs b/gb-emu-lib/src/processor/memory/rom/mbcs/mbc2.rs similarity index 100% rename from src/processor/memory/rom/mbcs/mbc2.rs rename to gb-emu-lib/src/processor/memory/rom/mbcs/mbc2.rs diff --git a/src/processor/memory/rom/mbcs/mbc3.rs b/gb-emu-lib/src/processor/memory/rom/mbcs/mbc3.rs similarity index 100% rename from src/processor/memory/rom/mbcs/mbc3.rs rename to gb-emu-lib/src/processor/memory/rom/mbcs/mbc3.rs diff --git a/src/processor/memory/rom/mbcs/mbc5.rs b/gb-emu-lib/src/processor/memory/rom/mbcs/mbc5.rs similarity index 100% rename from src/processor/memory/rom/mbcs/mbc5.rs rename to gb-emu-lib/src/processor/memory/rom/mbcs/mbc5.rs diff --git a/src/processor/memory/rom/mbcs/none.rs b/gb-emu-lib/src/processor/memory/rom/mbcs/none.rs similarity index 100% rename from src/processor/memory/rom/mbcs/none.rs rename to gb-emu-lib/src/processor/memory/rom/mbcs/none.rs diff --git a/src/processor/mod.rs b/gb-emu-lib/src/processor/mod.rs similarity index 100% rename from src/processor/mod.rs rename to gb-emu-lib/src/processor/mod.rs diff --git a/src/processor/opcodes.rs b/gb-emu-lib/src/processor/opcodes.rs similarity index 100% rename from src/processor/opcodes.rs rename to gb-emu-lib/src/processor/opcodes.rs diff --git a/src/util.rs b/gb-emu-lib/src/util.rs similarity index 100% rename from src/util.rs rename to gb-emu-lib/src/util.rs