SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit c50fdfd222ac5a2e07cf9c6f43c645e2dbe0a62d parent 20157823941a81479fea99cdd8de3de02929c6a8 Author: Lior Halphon <LIJI32@gmail.com> Date: Fri, 14 Nov 2025 23:26:33 +0200 Fixed a bug that can cause the SDL port to be stuck on the greyscale palette Diffstat:
| M | SDL/gui.c | 10 | ++++++++++ |
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/SDL/gui.c b/SDL/gui.c @@ -1439,8 +1439,10 @@ static void cycle_palette(unsigned index) } } else if (configuration.dmg_palette == 4) { + bool found = false; for (unsigned i = 0; i < n_custom_palettes; i++) { if (strcmp(custom_palettes[i], configuration.dmg_palette_name) == 0) { + found = true; if (i == n_custom_palettes - 1) { configuration.dmg_palette = 0; } @@ -1450,6 +1452,9 @@ static void cycle_palette(unsigned index) break; } } + if (!found) { + configuration.dmg_palette = 0; + } } else { configuration.dmg_palette++; @@ -1471,7 +1476,9 @@ static void cycle_palette_backwards(unsigned index) } else if (configuration.dmg_palette == 4) { for (unsigned i = 0; i < n_custom_palettes; i++) { + bool found = false; if (strcmp(custom_palettes[i], configuration.dmg_palette_name) == 0) { + found = true; if (i == 0) { configuration.dmg_palette = 3; } @@ -1480,6 +1487,9 @@ static void cycle_palette_backwards(unsigned index) } break; } + if (!found) { + configuration.dmg_palette = 3; + } } } else {
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.