diff --git a/Cargo.toml b/Cargo.toml index f4f8535cbfd9a5fc5f9b7f95b75655f6de71e1a7..974041944ff40f1ce55168279fcbcfd3a99782d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,3 +20,9 @@ wasm-bindgen = { version = "0.2", optional = true } debug = false lto = true opt-level = 3 + +[workspace] +members = [ + ".", + "examples/sdl", +] diff --git a/examples/sdl/Cargo.toml b/examples/sdl/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..ee81234825228fdeb3e6e7490ffb11f5fcc41113 --- /dev/null +++ b/examples/sdl/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "boytacean-sdl" +version = "0.1.0" +authors = ["João Magalhães <joamag@gmail.com>"] +description = "Game Boy Emulator SDL (Desktop) Application" +license = "Apache-2.0" +keywords = ["gameboy", "emulator", "rust", "sdl"] +edition = "2018" + +[dependencies.boytacean] +path = "../.." + +[dependencies.sdl2] +version = "0.35" +features = ["ttf", "image", "gfx", "mixer", "static-link", "use-vcpkg"] + +[package.metadata.vcpkg] +dependencies = ["sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"] +git = "https://github.com/microsoft/vcpkg" +rev = "261c458af6e3eed5d099144aff95d2b5035f656b" + +[package.metadata.vcpkg.target] +x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" } diff --git a/res/mbr_rom.bin b/examples/sdl/res/dmg_rom.bin similarity index 100% rename from res/mbr_rom.bin rename to examples/sdl/res/dmg_rom.bin diff --git a/examples/sdl/src/main.rs b/examples/sdl/src/main.rs new file mode 100644 index 0000000000000000000000000000000000000000..e7781244c83fc607b6881557f388c0a134e6297c --- /dev/null +++ b/examples/sdl/src/main.rs @@ -0,0 +1,6 @@ +use boytacean::gb::GameBoy; + +fn main() { + let mut game_boy = GameBoy::new(); + game_boy.load_boot_default() +} diff --git a/res/dmg_rom.bin b/res/dmg_rom.bin new file mode 100644 index 0000000000000000000000000000000000000000..afa0ee4792c2ba80afb6b0c1962e249e195e6fc0 Binary files /dev/null and b/res/dmg_rom.bin differ diff --git a/src/gb.rs b/src/gb.rs index 1d03e62f00d0732bc3beb2721ad701ab5e8fe1b6..a3fd87997fa981e361da0160c33a9f90a68533b8 100644 --- a/src/gb.rs +++ b/src/gb.rs @@ -22,6 +22,6 @@ impl GameBoy { } pub fn load_boot_default(&mut self) { - self.load_boot("./res/mbr_rom.bin"); + self.load_boot("./res/dmg_rom.bin"); } }