Fix a bug in manual palette selection

This commit is contained in:
Vincent Mistler
2022-12-25 11:37:05 +01:00
parent 1ec7701b74
commit 7c5bb2f2c9
+17 -16
View File
@@ -459,30 +459,31 @@ int main(void)
gb.direct.joypad_bits.start=gpio_get(GPIO_START); gb.direct.joypad_bits.start=gpio_get(GPIO_START);
/* manually assign a palette with button combo */ /* manually assign a palette with button combo */
if(!gb.direct.joypad_bits.right) {
get_colour_palette(palette,0x05,0x00); /* Right */ if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.up) {
get_colour_palette(palette,0x10,0x05); /* A + Up */
} else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.down) { } else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.down) {
get_colour_palette(palette,0x07,0x00); /* A + Down */ get_colour_palette(palette,0x07,0x00); /* A + Down */
} else if(!gb.direct.joypad_bits.up) {
get_colour_palette(palette,0x12,0x00); /* Up */
} else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.right) {
get_colour_palette(palette,0x13,0x00); /* B + Right */
} else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.left) {
get_colour_palette(palette,0x16,0x00); /* B + Left (Game Boy Pocket Palette, shades of gray) */
} else if(!gb.direct.joypad_bits.down) {
get_colour_palette(palette,0x17,0x00); /* Down */
} else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.up) {
get_colour_palette(palette,0x19,0x03); /* B + Up */
} else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.right) { } else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.right) {
get_colour_palette(palette,0x1C,0x03); /* A + Right */ get_colour_palette(palette,0x1C,0x03); /* A + Right */
} else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.left) { } else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.left) {
get_colour_palette(palette,0x0D,0x05); /* A + Left */ get_colour_palette(palette,0x0D,0x05); /* A + Left */
} else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.up) { } else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.up) {
get_colour_palette(palette,0x10,0x05); /* A + Up */ get_colour_palette(palette,0x19,0x03); /* B + Up */
} else if(!gb.direct.joypad_bits.left) {
get_colour_palette(palette,0x18,0x05); /* Left */
} else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.down) { } else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.down) {
get_colour_palette(palette,0x1A,0x05); /* B + Down */ get_colour_palette(palette,0x1A,0x05); /* B + Down */
} else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.right) {
get_colour_palette(palette,0x13,0x00); /* B + Right */
} else if(!gb.direct.joypad_bits.b && !gb.direct.joypad_bits.left) {
get_colour_palette(palette,0x16,0x00); /* B + Left (Game Boy Pocket Palette, shades of gray) */
} else if(!gb.direct.joypad_bits.up) {
get_colour_palette(palette,0x12,0x00); /* Up */
} else if(!gb.direct.joypad_bits.down) {
get_colour_palette(palette,0x17,0x00); /* Down */
} else if(!gb.direct.joypad_bits.right) {
get_colour_palette(palette,0x05,0x00); /* Right */
} else if(!gb.direct.joypad_bits.left) {
get_colour_palette(palette,0x18,0x05); /* Left */
} else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.b) { } else if(!gb.direct.joypad_bits.a && !gb.direct.joypad_bits.b) {
get_colour_palette(palette,0xFF,0xFF); /* A + B */ get_colour_palette(palette,0xFF,0xFF); /* A + B */
} else { } else {