From b219e00454048cbbf01cc37d3a61a99c9343352c Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sat, 25 May 2024 11:10:59 +0100 Subject: [PATCH 1/6] Update the test_logo to be a bit nicer --- agb/gfx/test_logo.png | Bin 1402 -> 1148 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/agb/gfx/test_logo.png b/agb/gfx/test_logo.png index e0c3f5abf67009552486721c6b39879c9e63ff90..97b139de6619b203c8c69d1048fa543b9c6f8d9b 100644 GIT binary patch literal 1148 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SQ}NHG=%xjQkeJ16s!fq})$)5S5Q zV$R#UXLE%e8QKzib~tdCI64{>Focn*r}ShRi3_S?D7l`HeU|K9uh@04HnMI@Sh;~zw2PW>ve z_j~c$E1RcBHY(oO!m9T)^cK(7`sG2-BE8of5XjlZr2W2F^MBvwX%RsA64rfP_m0~K z|LA)r12XtW!qPqG!`7t#-LuZGQE>*7{F9s9TlYx)Su_9nRSjTxJW&7q`}6(yz4_|1 zK_S9tx@yI#IcI_4v-*Ofm+Jl6+Mm^H=k3kcmtS6HogQtMeD>uuTCXBY3^JoBsgAkZbtGz->WJO5Iy z)UT$ba(bWE`%iD5{)-XY>hY8Bl?K?QN$b9?S+RM2koLR(ng%Sv4_cpw|5<$g;I(+Wv63HKg-72BN=d-mS%JKIa^ zHH+j~+Y-2H4Ev|OzgYZy>+?;EyVvYU1_o~M1IMa*x$^blViKk6_FP*$e|qr)L$G@k z_8zU6_Fp*b^+)Y@5@64(tYwP5d(BA;%ms#3<|imF`_ze{a{Tzb`@`-1@!N z^w+=nZ$mk`ffimC*>Pj{k;PxcwlDks`E_m0uT|eKuX(BqN;TmRk|G~1-Q0b-I&@dq zxqF+o{i}QZw=Zb7eVT6mLSQW2ViMoF{=r(Ncd?7ESr)whv27l+{NEiVufL_~=k_u= zZ+OWabNN@-{_us-&lfF@Yb|*F*2XLGJ5Z-jWB9G87dJKD*nxfFC(^DAN<#yjr%*C< aJ;QsBl-dPy)t7=vv literal 1402 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SQ}NHG=%xjQkeJ16s!fq~V;)5S5Q zV$R#U2fJiLnT~yY-^VDesN2LC`1ppKxR6so6GziC!80j#4aAR)6!Wl4hW2NQ%n$0)g)VztA{5ber=9vqY`d@3WXRUi}_yJtYBe){-UeXSU#~si_HW&!C*RlCpQ)C=!}~KXu2_HJ!W+-t zmhX>#68|Ac`9sj@v~1IF)e@I1s^*)xC1|K2A+wjgGTCzv%FN2N>oh(Yd}gcSQJ$}V z6EP!o@o5idZ&zGNZJWwO4q7N1hzKJg>A9`pa^{ZcFyT_;gHbCYu>Y+}lwe<6VaChUM%2{yKS%eg6IZMg0D(KXzm0fj3tc z-~VUzqv3J$-~Ye2Zd6?{dD|J2lKZQUw6VOiM{^F)X}48w^4UJp=D7xce0%{XW7PUzcbIKo|}K2gXbs<68gvdKrwu-`S14K Qz`~Tl)78&qol`;+0Ik-9#Q*>R From bf4a6887a5846685b3520fd19d7622b922cd507b Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sat, 25 May 2024 11:11:12 +0100 Subject: [PATCH 2/6] Update the background example to search for the colour --- agb/examples/dma_effect_background_colour.rs | 19 ++++++++++--------- agb/src/display/tiled/vram_manager.rs | 7 +++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/agb/examples/dma_effect_background_colour.rs b/agb/examples/dma_effect_background_colour.rs index 6efc4ed9..57c969e9 100644 --- a/agb/examples/dma_effect_background_colour.rs +++ b/agb/examples/dma_effect_background_colour.rs @@ -31,18 +31,19 @@ fn main(mut gba: agb::Gba) -> ! { let colours: Box<[_]> = (0..160).map(|i| ((i * 0xffff) / 160) as u16).collect(); - let mut frame = 0; + let background_colour = 0x732b; // generated using `https://agbrs.dev/colour` + let background_colour_index = vram + .find_colour_index_16(0, background_colour) + .expect("Should contain colour 0x732b"); loop { - // hardcoding palette index 2 here which you wouldn't want to do in a real example (instead, look for - // the colour you want to replace) - let _background_color_transfer = - unsafe { dma.hblank_transfer(&vram.background_palette_colour_dma(0, 2), &colours) }; + let _background_color_transfer = unsafe { + dma.hblank_transfer( + &vram.background_palette_colour_dma(0, background_colour_index), + &colours, + ) + }; vblank.wait_for_vblank(); - frame += 1; - if frame > 160 { - frame = 0; - } } } diff --git a/agb/src/display/tiled/vram_manager.rs b/agb/src/display/tiled/vram_manager.rs index 55503332..2a482a69 100644 --- a/agb/src/display/tiled/vram_manager.rs +++ b/agb/src/display/tiled/vram_manager.rs @@ -461,4 +461,11 @@ impl VRamManager { self.set_background_palette(palette_index as u8, entry); } } + + /// Gets the index of the colour for a given background palette, or None if it doesn't exist + pub fn find_colour_index_16(&mut self, palette_index: usize, colour: u16) -> Option { + assert!(palette_index < 16); + + (0..16).find(|i| PALETTE_BACKGROUND.get(palette_index * 16 + i) == colour) + } } From da9ad6d496ca1589cf87066b422f757ab3bc0779 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sat, 25 May 2024 11:13:01 +0100 Subject: [PATCH 3/6] Add a 256 colour variant too --- agb/src/display/tiled/vram_manager.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/agb/src/display/tiled/vram_manager.rs b/agb/src/display/tiled/vram_manager.rs index 2a482a69..4339d56b 100644 --- a/agb/src/display/tiled/vram_manager.rs +++ b/agb/src/display/tiled/vram_manager.rs @@ -463,9 +463,16 @@ impl VRamManager { } /// Gets the index of the colour for a given background palette, or None if it doesn't exist - pub fn find_colour_index_16(&mut self, palette_index: usize, colour: u16) -> Option { + #[must_use] + pub fn find_colour_index_16(&self, palette_index: usize, colour: u16) -> Option { assert!(palette_index < 16); (0..16).find(|i| PALETTE_BACKGROUND.get(palette_index * 16 + i) == colour) } + + /// Gets the index of the colour in the entire background palette, or None if it doesn't exist + #[must_use] + pub fn find_colour_index_256(&self, colour: u16) -> Option { + (0..256).find(|&i| PALETTE_BACKGROUND.get(i) == colour) + } } From b208133564de8d8bab995dff0279005a428809ab Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sat, 25 May 2024 11:14:06 +0100 Subject: [PATCH 4/6] Add changelog entry for new functions --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab37a025..095a6e51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Added `find_colour_index_16` and `find_colour_index_256` to the `VRamManager` to find where a colour is in a palette. + ## [0.20.2] - 2024/05/25 ### Fixed From 24e15f87861bff88e5f145f4761d4d995e780a96 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sat, 25 May 2024 11:24:23 +0100 Subject: [PATCH 5/6] Add a basic version of the example_logo for certain examples --- agb/examples/dma_effect_background_colour.rs | 2 +- agb/gfx/test_logo.aseprite | Bin 0 -> 2514 bytes agb/gfx/test_logo.png | Bin 1148 -> 2786 bytes agb/gfx/test_logo_basic.png | Bin 0 -> 1148 bytes agb/src/display/example_logo.rs | 10 ++++++++++ 5 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 agb/gfx/test_logo.aseprite create mode 100644 agb/gfx/test_logo_basic.png diff --git a/agb/examples/dma_effect_background_colour.rs b/agb/examples/dma_effect_background_colour.rs index 57c969e9..f7386c59 100644 --- a/agb/examples/dma_effect_background_colour.rs +++ b/agb/examples/dma_effect_background_colour.rs @@ -25,7 +25,7 @@ fn main(mut gba: agb::Gba) -> ! { let dma = gba.dma.dma().dma0; - example_logo::display_logo(&mut map, &mut vram); + example_logo::display_logo_basic(&mut map, &mut vram); let vblank = VBlank::get(); diff --git a/agb/gfx/test_logo.aseprite b/agb/gfx/test_logo.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..4656258c558a5e649e87db9b2e00c32391791e21 GIT binary patch literal 2514 zcmd6nX;f2L5`Z6rfHr7A#8xpR+9)n4K@b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2XLGJ5Z-jWB9G87dJKD*nxfFC(^DAN<#yjr%*C< aJ;QsBl-dPy)t7=vv diff --git a/agb/gfx/test_logo_basic.png b/agb/gfx/test_logo_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..97b139de6619b203c8c69d1048fa543b9c6f8d9b GIT binary patch literal 1148 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SQ}NHG=%xjQkeJ16s!fq})$)5S5Q zV$R#UXLE%e8QKzib~tdCI64{>Focn*r}ShRi3_S?D7l`HeU|K9uh@04HnMI@Sh;~zw2PW>ve z_j~c$E1RcBHY(oO!m9T)^cK(7`sG2-BE8of5XjlZr2W2F^MBvwX%RsA64rfP_m0~K z|LA)r12XtW!qPqG!`7t#-LuZGQE>*7{F9s9TlYx)Su_9nRSjTxJW&7q`}6(yz4_|1 zK_S9tx@yI#IcI_4v-*Ofm+Jl6+Mm^H=k3kcmtS6HogQtMeD>uuTCXBY3^JoBsgAkZbtGz->WJO5Iy z)UT$ba(bWE`%iD5{)-XY>hY8Bl?K?QN$b9?S+RM2koLR(ng%Sv4_cpw|5<$g;I(+Wv63HKg-72BN=d-mS%JKIa^ zHH+j~+Y-2H4Ev|OzgYZy>+?;EyVvYU1_o~M1IMa*x$^blViKk6_FP*$e|qr)L$G@k z_8zU6_Fp*b^+)Y@5@64(tYwP5d(BA;%ms#3<|imF`_ze{a{Tzb`@`-1@!N z^w+=nZ$mk`ffimC*>Pj{k;PxcwlDks`E_m0uT|eKuX(BqN;TmRk|G~1-Q0b-I&@dq zxqF+o{i}QZw=Zb7eVT6mLSQW2ViMoF{=r(Ncd?7ESr)whv27l+{NEiVufL_~=k_u= zZ+OWabNN@-{_us-&lfF@Yb|*F*2XLGJ5Z-jWB9G87dJKD*nxfFC(^DAN<#yjr%*C< aJ;QsBl-dPy)t7=vv literal 0 HcmV?d00001 diff --git a/agb/src/display/example_logo.rs b/agb/src/display/example_logo.rs index 66d98442..4b6295f2 100644 --- a/agb/src/display/example_logo.rs +++ b/agb/src/display/example_logo.rs @@ -1,6 +1,7 @@ use super::tiled::{RegularMap, TiledMap, VRamManager}; crate::include_background_gfx!(crate, agb_logo, test_logo => deduplicate "gfx/test_logo.png"); +crate::include_background_gfx!(crate, agb_logo_basic, test_logo => deduplicate "gfx/test_logo_basic.png"); pub fn display_logo(map: &mut RegularMap, vram: &mut VRamManager) { vram.set_background_palettes(agb_logo::PALETTES); @@ -11,6 +12,15 @@ pub fn display_logo(map: &mut RegularMap, vram: &mut VRamManager) { map.set_visible(true); } +pub fn display_logo_basic(map: &mut RegularMap, vram: &mut VRamManager) { + vram.set_background_palettes(agb_logo_basic::PALETTES); + + map.fill_with(vram, &agb_logo_basic::test_logo); + + map.commit(vram); + map.set_visible(true); +} + #[cfg(test)] mod tests { use crate::display::{tiled::RegularBackgroundSize, Priority}; From 30e371879788a4f438ac2a5ebb75b0c210b1cea8 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sat, 25 May 2024 21:09:19 +0100 Subject: [PATCH 6/6] Include drawing a leviathan --- agb/gfx/test_logo.aseprite | Bin 2514 -> 2779 bytes agb/gfx/test_logo.png | Bin 2786 -> 2957 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/agb/gfx/test_logo.aseprite b/agb/gfx/test_logo.aseprite index 4656258c558a5e649e87db9b2e00c32391791e21..46ec959e0e155d3f311df3b7993941957789947d 100644 GIT binary patch delta 273 zcmca4d|Q<1HrGU^I^Jk528LfBMHo^T7#Ku0_P$`$R{^qE6qp$pfiwc}Fa#$TrKaW; zXC!8)7Rv)AKx!Bm7$;9;6y`BT6JRvjT*?&7ULOlo!K%Q)5XDf+@Sh20nh=8!L&cor zgaf=fqLcqCC);>+Uh-d6+44m=S#D+81EX%KXA`p7c12z>Xb&=OvzE*GXex2p*z~ie z<}<-d{wHi|vKZ@|7X)~L4d-NtVW>tjoR5J6Xn3}!-M9U%8XRXDm>&f9`|2B(C0=em fU03t&(DS&OoS?s+YwBX&DO}}0!NBm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