From 7aef0de46bf35238c6a349bab630c345e0ad788b Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 5 Apr 2023 20:35:13 +0200 Subject: [PATCH 1/9] Update for linker-fix-3ds rename --- ctru-rs/Cargo.toml | 2 +- ctru-rs/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index d8b095a..a7a160c 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -15,7 +15,7 @@ name = "ctru" cfg-if = "1.0" ctru-sys = { path = "../ctru-sys", version = "21.2" } const-zero = "0.1.0" -linker-fix-3ds = { git = "https://github.com/rust3ds/rust-linker-fix-3ds.git" } +shim-3ds = { git = "https://github.com/rust3ds/shim-3ds.git" } pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" } libc = "0.2.121" bitflags = "1.0.0" diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 57b61e9..12939d2 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -8,7 +8,7 @@ #![test_runner(test_runner::run)] // Nothing is imported from these crates but their inclusion here assures correct linking of the missing implementations. -extern crate linker_fix_3ds; +extern crate shim_3ds; extern crate pthread_3ds; #[no_mangle] From bca9aa791828dc7cd1232621085d34d792959c3a Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 5 Apr 2023 20:41:31 +0200 Subject: [PATCH 2/9] fmt --- ctru-rs/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 12939d2..210d37f 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -8,8 +8,8 @@ #![test_runner(test_runner::run)] // Nothing is imported from these crates but their inclusion here assures correct linking of the missing implementations. -extern crate shim_3ds; extern crate pthread_3ds; +extern crate shim_3ds; #[no_mangle] #[cfg(feature = "big-stack")] From a2a990b715c7b1bd715b2f85abd22ae614d4c741 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 8 Apr 2023 14:17:08 +0200 Subject: [PATCH 3/9] Compilation error when romfs can't be found --- ctru-rs/src/services/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index 6b9e115..ec554cb 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -34,6 +34,8 @@ cfg_if::cfg_if! { //! [package.metadata.cargo-3ds] //! romfs_dir = "romfs" //! ``` + + compile_error!("romfs feature is enabled but no romfs found!"); } } } From 93fdaffa6b018433049000194cd0dda770d0bf54 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 8 Apr 2023 15:04:42 +0200 Subject: [PATCH 4/9] fmt --- ctru-rs/src/services/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index ec554cb..c466f04 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -34,7 +34,7 @@ cfg_if::cfg_if! { //! [package.metadata.cargo-3ds] //! romfs_dir = "romfs" //! ``` - + compile_error!("romfs feature is enabled but no romfs found!"); } } From ef4ea1797ac199bd4c747678b20a59e7b8db7880 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 8 Apr 2023 20:20:01 +0200 Subject: [PATCH 5/9] Compilation error only if feature is set --- ctru-rs/src/services/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index c466f04..2c51d10 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -34,7 +34,9 @@ cfg_if::cfg_if! { //! [package.metadata.cargo-3ds] //! romfs_dir = "romfs" //! ``` - + + // If the feature is set, but no "romfs" directory was found: send an error during compilation. + #[cfg(feature = "romfs")] compile_error!("romfs feature is enabled but no romfs found!"); } } From a0e36f3753a612774b82fbb3443054e76987f4ef Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 8 Apr 2023 20:21:38 +0200 Subject: [PATCH 6/9] fmt --- ctru-rs/src/services/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index 2c51d10..1d31dea 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -34,7 +34,7 @@ cfg_if::cfg_if! { //! [package.metadata.cargo-3ds] //! romfs_dir = "romfs" //! ``` - + // If the feature is set, but no "romfs" directory was found: send an error during compilation. #[cfg(feature = "romfs")] compile_error!("romfs feature is enabled but no romfs found!"); From 8821ed4326e5328c162b2410c4bd42371eeebb69 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 11 Apr 2023 12:58:02 +0200 Subject: [PATCH 7/9] Explicit DPAD nomenclature --- ctru-rs/src/services/hid.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 2db0d23..79a649b 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -13,10 +13,10 @@ bitflags::bitflags! { const B = ctru_sys::KEY_B; const SELECT = ctru_sys::KEY_SELECT; const START = ctru_sys::KEY_START; - const DRIGHT = ctru_sys::KEY_DRIGHT; - const DLEFT = ctru_sys::KEY_DLEFT; - const DUP = ctru_sys::KEY_DUP; - const DDOWN = ctru_sys::KEY_DDOWN; + const DPAD_RIGHT = ctru_sys::KEY_DRIGHT; + const DPAD_LEFT = ctru_sys::KEY_DLEFT; + const DPAD_UP = ctru_sys::KEY_DUP; + const DPAD_DOWN = ctru_sys::KEY_DDOWN; const R = ctru_sys::KEY_R; const L = ctru_sys::KEY_L; const X = ctru_sys::KEY_X; @@ -33,10 +33,10 @@ bitflags::bitflags! { const CPAD_UP = ctru_sys::KEY_CPAD_UP; const CPAD_DOWN = ctru_sys::KEY_CPAD_DOWN; // Convenience catch-all for the dpad and cpad - const UP = KeyPad::DUP.bits() | KeyPad::CPAD_UP.bits(); - const DOWN = KeyPad::DDOWN.bits() | KeyPad::CPAD_DOWN.bits(); - const LEFT = KeyPad::DLEFT.bits() | KeyPad::CPAD_LEFT.bits(); - const RIGHT = KeyPad::DRIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); + const UP = KeyPad::DPAD_UP.bits() | KeyPad::CPAD_UP.bits(); + const DOWN = KeyPad::DPAD_DOWN.bits() | KeyPad::CPAD_DOWN.bits(); + const LEFT = KeyPad::DPAD_LEFT.bits() | KeyPad::CPAD_LEFT.bits(); + const RIGHT = KeyPad::DPAD_RIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); } } From 80efa807b1889355ecc24c5fbce8a7133d7807f9 Mon Sep 17 00:00:00 2001 From: Meziu <55318903+Meziu@users.noreply.github.com> Date: Tue, 11 Apr 2023 20:21:14 +0200 Subject: [PATCH 8/9] Update flush_buffer docs Co-authored-by: Ian Chamberlain --- ctru-rs/src/services/gfx.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 1412bb7..49dc6cd 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -55,7 +55,7 @@ pub trait Screen: private::Sealed { unsafe { ctru_sys::gfxSetDoubleBuffering(self.as_raw(), enabled) } } - /// Swaps the video buffers. + /// Flushes the video buffer for this screen. /// /// This should be used even if double buffering is disabled. fn flush_buffer(&mut self) { From 71ad3e94623e4e2b25fc46182f5ded074f396e69 Mon Sep 17 00:00:00 2001 From: Meziu <55318903+Meziu@users.noreply.github.com> Date: Wed, 12 Apr 2023 11:39:34 +0200 Subject: [PATCH 9/9] Update gfx.rs --- ctru-rs/src/services/gfx.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 49dc6cd..9ac0a34 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -56,8 +56,6 @@ pub trait Screen: private::Sealed { } /// Flushes the video buffer for this screen. - /// - /// This should be used even if double buffering is disabled. fn flush_buffer(&mut self) { let framebuffer = self.raw_framebuffer();