libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.4k stars 1.84k forks source link

[Feature Request]: Support video rotation via Network API #17006

Open DaveBullet1050 opened 2 months ago

DaveBullet1050 commented 2 months ago

I'd like to be able to remotely rotate the screen. This would be useful for 2 player single controller MAME games that only enable the 2nd player's controls when in cocktail mode. The reason to rotate the screen is to flip the screen back 180 degrees when switching between player 1 and 2 (rather than shuffling seats!). This is for a side by side console.

e.g. if using netcat:

echo "VIDEO_ROTATE" | nc -u -c localhost 55355

Optionally taking one of the existing 4 arguments (Normal | 90 | 180 | 270)

gouchi commented 2 months ago

Documentation about Network Control Interface "NCI."

Similar issue about "Extending the Network Control Interface to allow loading games".

hizzlekizzle commented 2 months ago

This does not address your request directly, but rather your usecase: the image-adjustment shader has parameters to flip the video vertically or horizontally. You could save shader presets with your flip settings and then switch among them using the next/prev shader hotkeys.

DaveBullet1050 commented 2 months ago

This does not address your request directly, but rather your usecase: the image-adjustment shader has parameters to flip the video vertically or horizontally. You could save shader presets with your flip settings and then switch among them using the next/prev shader hotkeys.

Thank you! Brilliant lateral thinking.

DaveBullet1050 commented 2 months ago

It works fine. the issue on lower powered hardware is the shader is causing some frame skip I think on certain games - e.g. Galaga (original). But this is due to me using a Pi 3B. It's not a problem for Retroarch/MAME etc...

I'm actually running Libretro Retroarch on Batocera, so will include those steps of what I did for the benefit of others:

  1. Launch Retroarch via running a game
  2. Enter the Retroarch config menu (in my system using a hotkey combo - HOTKEY + BTN2 - remapped via global.retroarch.input_menu_toggle_btn=2 in batocera.conf)
  3. Quick menu -> Shaders -> Load
  4. Open the misc/image-adjustment.glsp
  5. Select shader parameters
  6. At the bottom set Flip Horiz Axis and Flip Vert Axis to 1
  7. Save - give the shader a name - e.g. upside_down
  8. Go to your /usr/share/batocera/shaders
  9. Delete everything except stock and upside_down (allowing you to toggle between)
  10. batocera-save-overlay (to persist the shaders on reboot)

Now when you run a game, you can press your shader next / prev buttons to switch between stock and upside_down. I just do this manually on player 1 / 2 death / changeover.