From 044261a2ff9d5b251233f7f8e234a702f1b1ceb8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:28:28 +0000 Subject: [PATCH 1/3] Update Rust crate bitflags to v2 --- agb/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" } From 09ec6c25b01bab516a8dd4590cf35d34ae0181af Mon Sep 17 00:00:00 2001 From: GBA bot Date: Thu, 23 Mar 2023 22:30:47 +0000 Subject: [PATCH 2/3] Update lockfiles --- book/games/pong/Cargo.lock | 12 +++++++++--- examples/combo/Cargo.lock | 12 +++++++++--- examples/hyperspace-roll/Cargo.lock | 12 +++++++++--- examples/the-hat-chooses-the-wizard/Cargo.lock | 12 +++++++++--- examples/the-purple-night/Cargo.lock | 12 +++++++++--- 5 files changed, 45 insertions(+), 15 deletions(-) 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", From 8eac03365095da7782f43e8212f9c029f4b2a6ef Mon Sep 17 00:00:00 2001 From: Corwin Date: Thu, 23 Mar 2023 22:47:04 +0000 Subject: [PATCH 3/3] derive some traits on bitflags --- agb/src/display/mod.rs | 1 + agb/src/input.rs | 1 + 2 files changed, 2 insertions(+) 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;