diff --git a/agb/Cargo.toml b/agb/Cargo.toml index 60e202c0..9bca59fb 100644 --- a/agb/Cargo.toml +++ b/agb/Cargo.toml @@ -21,7 +21,7 @@ default = ["testing"] testing = [] [dependencies] -bitflags = "1" +bitflags = "2" agb_image_converter = { version = "0.13.0", path = "../agb-image-converter" } agb_sound_converter = { version = "0.13.0", path = "../agb-sound-converter" } agb_macros = { version = "0.13.0", path = "../agb-macros" } diff --git a/agb/src/display/mod.rs b/agb/src/display/mod.rs index 2b5d1e44..939c22d3 100644 --- a/agb/src/display/mod.rs +++ b/agb/src/display/mod.rs @@ -35,6 +35,7 @@ pub(crate) const DISPLAY_STATUS: MemoryMapped = unsafe { MemoryMapped::new( const VCOUNT: MemoryMapped = unsafe { MemoryMapped::new(0x0400_0006) }; bitflags! { + #[derive(PartialEq, Eq, Hash, Debug, Clone, Copy)] struct GraphicsSettings: u16 { const PAGE_SELECT = 1 << 0x4; const OAM_HBLANK = 1 << 0x5; diff --git a/agb/src/input.rs b/agb/src/input.rs index a2da38d8..14192e3b 100644 --- a/agb/src/input.rs +++ b/agb/src/input.rs @@ -40,6 +40,7 @@ impl From<(bool, bool)> for Tri { bitflags! { /// Represents a button on the GBA + #[derive(PartialEq, Eq, Hash, Debug, Clone, Copy)] pub struct Button: u32 { /// The A button const A = 1 << 0; diff --git a/book/games/pong/Cargo.lock b/book/games/pong/Cargo.lock index 8b042c6f..16d18409 100644 --- a/book/games/pong/Cargo.lock +++ b/book/games/pong/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ "agb_macros", "agb_sound_converter", "bare-metal", - "bitflags", + "bitflags 2.0.2", "modular-bitfield", "rustc-hash", ] @@ -85,7 +85,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a71de7aecd2d0a76ec90fde2c443d12667c737d92de76bd187f101eca37891" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "flate2", "image", @@ -111,6 +111,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "bytemuck" version = "1.13.1" @@ -328,7 +334,7 @@ version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "deflate", "miniz_oxide 0.3.7", diff --git a/examples/combo/Cargo.lock b/examples/combo/Cargo.lock index 0bb150f2..68bc03c2 100644 --- a/examples/combo/Cargo.lock +++ b/examples/combo/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ "agb_macros", "agb_sound_converter", "bare-metal", - "bitflags", + "bitflags 2.0.2", "modular-bitfield", "rustc-hash", ] @@ -85,7 +85,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a71de7aecd2d0a76ec90fde2c443d12667c737d92de76bd187f101eca37891" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "flate2", "image", @@ -120,6 +120,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "bytemuck" version = "1.13.1" @@ -388,7 +394,7 @@ version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "deflate", "miniz_oxide 0.3.7", diff --git a/examples/hyperspace-roll/Cargo.lock b/examples/hyperspace-roll/Cargo.lock index ec09a572..cb6ec5e9 100644 --- a/examples/hyperspace-roll/Cargo.lock +++ b/examples/hyperspace-roll/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ "agb_macros", "agb_sound_converter", "bare-metal", - "bitflags", + "bitflags 2.0.2", "modular-bitfield", "rustc-hash", ] @@ -85,7 +85,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a71de7aecd2d0a76ec90fde2c443d12667c737d92de76bd187f101eca37891" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "flate2", "image", @@ -111,6 +111,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "bytemuck" version = "1.13.1" @@ -336,7 +342,7 @@ version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "deflate", "miniz_oxide 0.3.7", diff --git a/examples/the-hat-chooses-the-wizard/Cargo.lock b/examples/the-hat-chooses-the-wizard/Cargo.lock index 6e2955f1..eb0098c0 100644 --- a/examples/the-hat-chooses-the-wizard/Cargo.lock +++ b/examples/the-hat-chooses-the-wizard/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ "agb_macros", "agb_sound_converter", "bare-metal", - "bitflags", + "bitflags 2.0.2", "modular-bitfield", "rustc-hash", ] @@ -85,7 +85,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a71de7aecd2d0a76ec90fde2c443d12667c737d92de76bd187f101eca37891" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "flate2", "image", @@ -111,6 +111,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "bytemuck" version = "1.13.1" @@ -334,7 +340,7 @@ version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "deflate", "miniz_oxide 0.3.7", diff --git a/examples/the-purple-night/Cargo.lock b/examples/the-purple-night/Cargo.lock index 7fdcae59..dc5b0e60 100644 --- a/examples/the-purple-night/Cargo.lock +++ b/examples/the-purple-night/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ "agb_macros", "agb_sound_converter", "bare-metal", - "bitflags", + "bitflags 2.0.2", "modular-bitfield", "rustc-hash", ] @@ -85,7 +85,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a71de7aecd2d0a76ec90fde2c443d12667c737d92de76bd187f101eca37891" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "flate2", "image", @@ -120,6 +120,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "bytemuck" version = "1.13.1" @@ -364,7 +370,7 @@ version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "deflate", "miniz_oxide 0.3.7",