Viceo_cb and vertical flip. Is it possible?

I am developing my first core: to expose AppleWin in RetroArch.

One thing which I have not been able to solve is correct video rendering. In the SDL version, I combine these 3 calls and I get a pretty good performance (including a Pi3):

  • SDL_UpdateTexture
  • SDL_RenderCopyEx
  • SDL_RenderPresent

The emulator draws to a video buffer and the 3 calls above do the job. In libretro I have replaced with a single call to video_cb().

The most important question is: how do I tell libretro to flip my image vertically? In the same way I do it in SDL_RenderCopyEx?

I know I could rework the emulator to draw in the correct way, but at this moment is not possible (I am trying to reuse the original AppleWin code without modifications to ease periodic merge).

1 Like

I just asked around in the discord channel and will report back. At the very least, I think you can use a rotation callback to spin it 180 degrees, but there might be a better way to handle it (some platforms/drivers don’t support rotation properly, IIRC)

Thank you. Btw, it is not a 180 rotation, but a vertical flip.

This is my current software solution: flip.

Cheers

Oh yeah, right, 180 rotation would end up flipped horizontal. Oh well.

I know a lot of cores use #ifdef __LIBRETRO__ for that sort of thing, or if you’re not using SDL in the libretro core something like #ifndef HAVE_SDL if you want to make it more generic (e.g., to ease porting to other multi-emu APIs, like ones used by OpenEmu or BizHawk).

Guess this means it is not possible. Thank you anyway.