libretro / snes9x2010

Snes9x 2010. Port of Snes9x 1.52+ to Libretro (previously called SNES9x Next). Rewritten in C and several optimizations and speedhacks.
Other
98 stars 71 forks source link

Support discarding video frames #111

Closed Dwedit closed 6 years ago

Dwedit commented 6 years ago

This changeset adds these features:

inactive123 commented 6 years ago

OK, I assume the way you made this, if a frontend doesn't implement this feature, it will still work like before, right?

Dwedit commented 6 years ago

Yep.

   int result = -1;
   bool okay = environ_cb(RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE, &result);
   if (!okay) result |= 3;
   bool audioEnabled = 0 != (result & 2);
   bool videoEnabled = 0 != (result & 1);

   IPPU.RenderThisFrame = videoEnabled;
   S9xSetSoundMute(!audioEnabled);

The "okay" return value determines if the frontend supports this feature or not. So for that code, I'm just ORing with 3 (setting audio enable and video enable bits).

inactive123 commented 6 years ago

OK, looks very promising then. Let's merge it.