logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0001-Libretro-Only-set-camera-peripheral-when-it-is-avail.patch (1280B)


  1. From 2e5f5c0cefff728097068e447aab4d75678a671a Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 7 Nov 2020 03:39:33 -0800
  4. Subject: [PATCH] Libretro: Only set camera peripheral when it is available
  5. Otherwise, if the frontend does not support GET_CAMERA_INTERFACE,
  6. the start and stop functions are NULL, causing a crash when a gameboy
  7. ROM is unloaded.
  8. ---
  9. src/platform/libretro/libretro.c | 5 +++--
  10. 1 file changed, 3 insertions(+), 2 deletions(-)
  11. diff --git a/src/platform/libretro/libretro.c b/src/platform/libretro/libretro.c
  12. index 0d2d0e60b..0b59dd4ce 100644
  13. --- a/src/platform/libretro/libretro.c
  14. +++ b/src/platform/libretro/libretro.c
  15. @@ -606,9 +606,10 @@ bool retro_load_game(const struct retro_game_info* game) {
  16. cam.width = GBCAM_WIDTH;
  17. cam.caps = 1 << RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER;
  18. cam.frame_raw_framebuffer = _updateCamera;
  19. - core->setPeripheral(core, mPERIPH_IMAGE_SOURCE, &imageSource);
  20. + if (environCallback(RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE, &cam)) {
  21. + core->setPeripheral(core, mPERIPH_IMAGE_SOURCE, &imageSource);
  22. + }
  23. - environCallback(RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE, &cam);
  24. const char* modelName = mCoreConfigGetValue(&core->config, "gb.model");
  25. struct GB* gb = core->board;
  26. --
  27. 2.29.2