* Fixed a bug where frames are still duped when the frontend is
fast-forwarding
* Fixed a bug where manual frame duping (without
`RETRO_ENVIRONMENT_GET_CAN_DUPE`) causes screen flickering during a
`Graphics.transition` call
Apparently we're not supposed to use
`RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO` to change the FPS. The core
should be running at the display refresh rate and resampling the game's
video output.
When not using the threaded audio driver, the frontend is supposed to
block until enough audio samples have been rendered for one frame, so
the frontend throttles the frame rate automatically if the core's frame
rate is slower than the display frame rate.
However, when using the threaded audio driver, there's no more
throttling, so we have to do it ourselves.
This adds a new driver for audio in libretro builds for devices with
multithreading support that defers audio rendering to a worker thread
provided by the libretro frontend.
The threaded driver has the advantage that video lag will not also cause
the audio to lag, which is very noticeable since it manifests in the
form of audio crackling when it happens.
Not sure why, but this fixes crashes when calling variadic functions in
the Ruby API in libretro builds when Ruby is built without `-DNDEBUG`.
Maybe the previous way of calling varargs functions was undefined
behaviour somehow.
`rb_rescue` only catches `StandardError`s, which doesn't include things
like Ruby syntax errors that we'd like to catch. We need to explicitly
use `rb_rescue2` to catch `Exception` in order to catch everything.
OpenAL Soft 1.24 introduces a lot of code that doesn't work well with
the PlayStation 3 homebrew toolchain, and also the old version of the
Wii U homebrew toolchain currently used by the libretro buildbot.
Instead of maintaining a bunch of patches to get 1.24 to work on these
toolchains, I think it'd be easier to just use 1.23.
Reverts commit d6ede8bcc6 and changes the
game path parser in libretro builds to not normalize the game path as it
causes problems on consoles with weird path formats.
This isn't to fix any bug I've experienced on any platform thus far, but
to avoid problems showing up in the future, since the libretro API docs
say you should unbind everything every frame.
Okay, the coroutine implementation of `sandbox_malloc` is clearly
broken. It would be working if Asyncify instrumented the `memory.grow`
WebAssembly instruction, but it doesn't instrument it.
This commit reverts commit 42c4ff9497 and
also increases the default VM memory allocation from 64 MiB to 96 MiB to
account for the lack of ability to increase the memory allocation at run
time. I'll find some new way to implement increasing the memory
allocation later.
It seems getting performance callbacks also doesn't work except in the
specific call to `retro_set_environment` that occurs before the core is
initialized, so this seems easier than handling only the logging
callback specially.
We need to call `video_refresh()` exactly once every time `retro_run()`
is called as per the libretro docs. These return statements were
preventing that from happening.
Since the libretro frontend can do whatever to the OpenGL state between
frames, we can't make any assumptions about the state at the beginning
of a frame.