LIJI32 / SameBoy

Game Boy and Game Boy Color emulator written in C
https://sameboy.github.io/
Other
1.65k stars 207 forks source link

Ternary safety #562

Closed ghost closed 1 year ago

ghost commented 1 year ago

Stop MinGW from breaking things!

LIJI32 commented 1 year ago

Is MinGW legit compiling these wrong? Isn't this just GCC?

ghost commented 1 year ago

Using stock g++-mingw-w64-i686-posix on ubuntu jammy - says gcc 10. Fresh install and update using Github Actions.

Something like this retro_debug_timer = strcmp(var.value, "On") == 0 ? 150 : 0;

would always keep printing debug messages to RETRO_ENVIRONMENT_SET_MESSAGE (something I added). When I added the () guards around the strcmp test, then it correctly toggled on and off.

Then I started checking the sprite priority bug I was having (always was using X priority). Same problem and solution.

And noticed broken libretro joypad2, odd pixel glitches and sometimes weird sounds. These didn't happen with an earlier mingw build I had lying around - I think it was gcc 9.

So I thought it was worthwhile to notify upstream, and probably other libretro cores too...

ghost commented 1 year ago

Think I goofed one of the () brackets. Have to recheck again.