RetroPie / RetroPie-Setup

Shell script to set up a Raspberry Pi/Odroid/PC with RetroArch emulator and various cores
Other
10k stars 1.38k forks source link

Add Sega Model3: supermodel #3918

Closed DirtBagXon closed 1 month ago

DirtBagXon commented 2 months ago

Just pushing this to see if there is any interest. Feel free to close if it's considered too problematic, I am aware it can require lots of tweaking per install.

This is the ARM optimised code, as used from Exarkuniv's "RetroPie-Extra", based on mechafatnick's original arm mods.

This branch has received tweaking, from the Sinden Pi guys, to Supermodel.ini and Games.xml for some time and is maintained.

It also has the following additions to the arm optimizations:

'Absolute' Mouse Input for light guns in Linux
Multiple Mouse Support : Allowing 2 players in lightgun games
Support for selecting a clone from within merged ROM set
Per game .commands file for individual game configuration
Log based Framerate Monitoring
Built-in Sinden border

The repo branch is here for reference: https://github.com/DirtBagXon/model3emu-code-sinden/tree/arm

I have made this rp_module_id="supermodel3" to avoid existing unofficial installs which seem to be just supermodel

It's now using a .commands file, based on game, to alter arguments.
With the addition of -game to select a clone within a MAME style merged ROM set, this has become particularly useful.

/opt/retropie/emulators/supermodel3/supermodel3 /home/pi/RetroPie/roms/arcade/scud.zip -game=scuddxo

It will run on a Pi4 and P5, without too many issues, on many games, so perhaps there should be a restriction in the scriptmodule for those model - looking for feedback or disinterest. Either is fine.

DirtBagXon commented 1 month ago

Then I would suggest 'matchbox' is the issue here. Window managers override SDL window environment requests in many documented cases I've read, there is nothing SDL can do to override this - WM have priority. I have witnessed this behaviour in hypseus when using SDL_WINDOW_MAXIMIZED for a "fake" fullscreen setup. There are certain areas you cannot place the sdl window, dictated by the Window Manager. That is remedied there using SDL_WINDOW_FULLSCREEN_DESKTOP but that is using an SDL_Renderer - here we are in SDL_WINDOW_OPENGL, without a Renderer, and have less alternates. The Window Manager can be clearly seen in Widge's screenshots, this has never been witnessed in the working examples we had before using XINIT.

Can setBackend be called without the WM? I'm not certain where we would go from here.

Giandj commented 1 month ago

Hi, the best way to use Sega Supermodel 3 with Raspberry PI5 on Retropie 4.8.8, on "1920x1080p 60hz" screen, adding a new system called Supermodel3, in es_systems.cfg, is to use this command:

<command>cd /home/pi/model3emu-code;startx ./supermodel -legacy3d -res=1024,600 -no-vsync -stretch -ppc-frequency=43 -no-dsb -no-throttle %ROM%</command>

if you have Supermodel3 compiled in /home/pi/model3emu-code/ directory (Raspberry pi5):

you can launch for testing: cd /home/pi/model3emu-code;startx ./supermodel -legacy3d -res=1024,600 -no-vsync -stretch -ppc-frequency=43 -no-dsb -no-throttle %ROM%

Other resolution different from "1024x600" (to see correctly Supermodel3 at a fullscreen and stretched to 16:9 without problems on screen of 1920x1080), displaying a supermodel3, going out of the screen... The "-fullscreen" parameters won't works correctly infact I have deleted it from my launching command.

PS: Remeber that there is no space between "...-code;startx..." otherwise the launch command won't works I have installed on Lite version of Raspbian Bookworm 64bit, and i have installed wayland desktop, then i have installed retropie 4.8.8 (latest version), but it works also on Pi5 and Retropie 4.8.x

here is my complete working system added on es_systems.cfg (Retropie 4.8.8, Raspberry Pi5 4gb, 1920x1080p 60hz)

 `<system>
    <name>Supermodel3</name>
    <fullname>Supermodel3</fullname>
    <path>/home/pi/RetroPie/roms/supermodel3</path>
    <extension>.zip .ZIP</extension>
    <command>cd /home/pi/model3emu-code;startx ./supermodel -legacy3d -res=1024,600 -no-vsync -stretch -ppc-frequency=43 -no-dsb -no-throttle %ROM%</command>
    <platform>Supermodel</platform>
    <theme>Supermodel</theme>
  </system> 

PPS: The only problem with "supermodel3" is how to program an exit button different from "ESC" ? (you need a keyboard on pi3/pi4/pi5 to "exit" from emulator, to return back in Emulationstation), no solution founded (for now..).

PPS2: I previously created a new theme for supermodel3, by myself, in Emulationstation

cmitu commented 1 month ago

@Widge-5 Thanks again for testing.

OK. I removed -fullscreen from the command line and this is what happens:. The emulator runs within the desktop-style window. Adjusting the runcommand videomode has an effect, here are some pictures of how The Lost Word appears using different videomodes in this test:

When you run without -fullscreen, your test shows the emulator window being fullscreen, but showing the borders. The game videoport is scaled, probably based on the Games.xml files, but without

In my testing, I always added -fullscreen, but without a WM, I get something like the image below, with the image shifted right and slightly down.

image

I've tested with the setBackend configuration (i.e. with the WM) and it shows correctly at the weird VGA/DOS resolution of 720x400:

image

Note that this with a native 4:3 monitor, so the image is not widescreen, but I don't think this is a factor. Coming back to your previous comment:

But, whilst this desktop-style window is affected by the videomode, the game itself is not. It always occupies the same space within the screen, the same space as before, and the lightgun is still inaccurate. :(

OK, so with or without the WM, the videoport size is the same, it's just that the lightgun doesn't work properly with the WM ?

The way I see in my tests:

So far the only option which works 100% is the initial one - no setBackend/WM and no -fullscreen.

cmitu commented 1 month ago

@DirtBagXon The WM/setBackend config was added by me when testing with -fullscreen shows the emulator image being incorrectly displayed and cut. In my experience the opposite is sometimes true under X11 - without a WM, some programes (either due to using the SDL/QT/FLTK/other widget functions or directly trying to talk to the Xserver) may incorrectly scale the window, detect the fullscreen status or even apply focus. That's mainly the reason we added a Window Manager in setBackend. Now, Wayland may be a different can of worms and can have different results.

As for how to go ahead, I summarized a bit in my earlier comment what options I think we have. Normally setBackend would have been ok, but seems like lightgun is not working properly, even though, as far as I understand, the viewport displayed (i.e. game resolution) is identical to the one without the WM.

DirtBagXon commented 1 month ago
So far the only option which works 100% is the initial one - no setBackend/WM and no -fullscreen.

I would concur from the reports I've also received.

cmitu commented 1 month ago

Alright, hopefully the last changes. Added back XINIT on kms (Raspberry Pis) and removed an extra indentation space. Should be - again - ready to merge.

Widge-5 commented 1 month ago

Seems all good to me 👍

joolswills commented 1 month ago

Cheers!

cmitu commented 1 month ago

@joolswills thanks for the merge and everyone else for patience and testing support.

Added a new page for Supermodel in https://github.com/RetroPie/RetroPie-Docs/commit/962ec0a657c4b3a5065489f87b020d3f773dc5dd, linked from the main arcade quick start. It will appear online in the next hour or so. If anything needs to be added, let me know - either PR the changes or comment on the docs repo/forums.