Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?
-
One of the coolest things in arcade emulation was EmuDX, which 20-odd years ago ran super-enhanced versions of a handful of classic arcade titles with new graphics and music patched in:
It seems a tragedy that this has been lost to history. It'd seem to be ripe for adding to something like Retropie-Extra. Has anyone ever tackled RAINE?
-
@JimmyFromTheBay There is a pure c version of raine on it's github, that theoretically should be able to compile, but, someone with a bit more c,ompile-fu than me will have to look at it, i get an error on linking the executable.
I'll include the error context just in case someone can point me in the right direction.
/usr/bin/ld: linux-gnu-sdl2/object/sdl/sasound.o: in function `my_callback': sasound.c:(.text+0x134c): undefined reference to `ProfileStop' /usr/bin/ld: sasound.c:(.text+0x137c): undefined reference to `ProfileStart' collect2: error: ld returned 1 exit status make: *** [makefile:1498: raine] Error 1
-
It can be done. Anyone who wants to push this further feel free to take it from here:
I had some success with Bookworm (aarch64) and RetroPie, 32-Bit ARM should also work.
With aarch64 (rpi5), RaspiOS Bookworm (RaspiOS 12)
- install sdl2 from RetroPie setupscript
sudo apt install nasm liblua5.4-dev libcurl4-gnutls-dev libssl-dev libpng-dev
(there may be others, but the build will tell you,apt-file
is your friend)- Checkout sources from [1]
- Apply diff/patch
- Set
NO_ASM
to 1 source/sdl/sasound.c::my_callback()
: Lines withProfileStart
/ProfileEnd
-> remove or disablesource/sdl/sasound.c::detect_soundcard()
: Stripped down to SDL soundcard autodetect (may have knock-on effects, see below)
- Set
- Changes as patch:
diff --git a/makefile b/makefile index fdebacb..a839ff8 100644 --- a/makefile +++ b/makefile @@ -38,7 +38,7 @@ USE_CURL = 1 # 1 = 68020 # 2 = 68000 + 68020 # set to 2 if NO_ASM is defined -# USE_MUSASHI = 2 +USE_MUSASHI = 2 # use mame z80 ? # MAME_Z80 = 1 @@ -57,7 +57,7 @@ GENS_SH2 = 1 # Disable all asm. This will also disable the asm_video_core of # course -# NO_ASM = 1 +NO_ASM = 1 # Use asm video core ? (comment to use C core) ASM_VIDEO_CORE = 1 diff --git a/source/sdl/sasound.c b/source/sdl/sasound.c index 284b1a0..b81f7fa 100644 --- a/source/sdl/sasound.c +++ b/source/sdl/sasound.c @@ -150,11 +150,14 @@ static char *detected; void detect_soundcard() { if (devs_audio < 0) devs_audio = SDL_GetNumAudioDevices(0); // This function can trigger a redetection of all audio devices so it's best to call it only once memset(&gotspec,0,sizeof(gotspec)); + /* if (RaineSoundCard && !strcmp(RaineSoundCard,"None")) return; + */ if (!RaineSoundCard) SDL_GetDefaultAudioInfo(&RaineSoundCard,&gotspec,0); - int isdig = 1; + /* + int isdig = 0; for (int n=0; n<strlen(RaineSoundCard); n++) { if (!isdigit(RaineSoundCard[n])) isdig = 0; } @@ -176,8 +179,9 @@ void detect_soundcard() { return; } } + */ // We couldn't find what's in RaineSoundCard, so make a detection - SDL_GetDefaultAudioInfo(&RaineSoundCard,&gotspec,0); + //SDL_GetDefaultAudioInfo(&RaineSoundCard,&gotspec,0); detected = RaineSoundCard; } @@ -801,12 +805,12 @@ static void my_callback(void *userdata, Uint8 *stream, int len) { int i,channel; short *wstream = (short*) stream; - if(raine_cfg.show_fps_mode>2) ProfileStart(PRO_SOUND); + //if(raine_cfg.show_fps_mode>2) ProfileStart(PRO_SOUND); if (pause_sound) { #if SDL == 2 memset(stream,0,len); #endif - if(raine_cfg.show_fps_mode>2) ProfileStop(PRO_SOUND); + //if(raine_cfg.show_fps_mode>2) ProfileStop(PRO_SOUND); return; } if (callback_busy) @@ -915,7 +919,7 @@ static void my_callback(void *userdata, Uint8 *stream, int len) if (mute_sfx) { callback_busy = 0; - if(raine_cfg.show_fps_mode>2) ProfileStop(PRO_SOUND); + //if(raine_cfg.show_fps_mode>2) ProfileStop(PRO_SOUND); return; } #else @@ -1047,7 +1051,7 @@ static void my_callback(void *userdata, Uint8 *stream, int len) updated_recording++; } callback_busy = 0; - if(raine_cfg.show_fps_mode>2) ProfileStop(PRO_SOUND); + //if(raine_cfg.show_fps_mode>2) ProfileStop(PRO_SOUND); } void saPlayBufferedStreamedSampleBase( int channel, signed char *data, int len, int freq, int volume, int bits , int pan ){
- cp incl. folder from git repo
fonts/
to/root/.raine/
- put
<yourgame.zip>
to/root/.raine/roms/
- Exit ES: On the console, run as root:
xinit $(where xterm)
, thenxrandr -s 640x480
, then launchraine
- Config file will be in
/root/.raine/configs/rainex_sdl.cfg
Known Limitations
- With SDL2.0.10 it can't be done (i.e. RaspiOS Buster based RetroPie), see: [0]
- Optimized string functions SIMD needed [2] to use properly
detect_soundcard()
or changes in Makefile to use standard string functions. - No Audio / Crash when accessing sound options in Raine Menu (most likely due to short-cutted
detect_soundcard()
function) - Must be run as root (did not further investigate on this)
- I guess from here it is best to ask specific questions in the Raine forum, from what I have read they are helpful, if your question is to the point
- If you run it as a project, please share your (github) fork link here
[0] https://www.1emulation.com/forums/topic/37608-is-it-possible-to-compile-raine-on-arm-device-retropie/
[1] tested with 8fa61a8 from https://github.com/zelurker/raine
[2] https://github.com/ARM-software/optimized-routinesFun fact: The question if this Emulator (it is still maintained!) always pops up after a time if it can be supported in RetroPie: here or here
-
@Lolonois thanks for the diff, commenting the profile lines made it compile. It crashed, so I removed the autodetect stuff, and then it worked.
It works in userland for me, not sure why you needed to use root.
No crashes around the sound menu...
my Dual Shock 4 controller is auto setup perfectly.
EmuDX works if you download the dx2 files from raine webpage, and configure the directories right in config.
-
@gomisensei Nice. Do you start it when a GUI (X/Wayland) is already running? That would be my guess for the differences (root/non-root) from the distance.
-
@Lolonois yeah, i added it to emulationstation, it works fine from there, as long as all the files are in /home/pi/.raine it works first thing, it even downloaded the roms when i started a game before i pointed it to my arcade dir.
-
@gomisensei This is great news :) Hopefully someone will add it in to Retropie in a way dopes like me can understand :D
-
It took some time but I have it working too.
I had a failure at compiling first but somehow compiling worked later.
I got it working on a x64 with debian12.
That is really nice as the source-code seems to be future proof.
The roms or emudx paths can be changed in the config file :
/home/pi/.raine/config/rainex_sdl.cfg
I did not have any knowledge of the emudx files so I didn't know you need 2 files 1 for graphics and 1 for sound.
So for frogger you need :
froggerg.dx2 (graphics)
froggerm.dx2 (music)
I think that is useful information. -
I created an initial base module-script with a data-folder for patching and copying the config file.
It's probably not perfect but it after many tests it worked for me.
I must admit I have used a few hackish methods.
I used my own differences files as the one from @Lolonois didn't work for me as "patch" failed to apply patches with that diff.
I also cannot make a "git diff" file like @Lolonois did, not sure how to do that yet so I created and used regular diff files.
It might be that we need to add more packages to the depends.
Also, the SDL package isn't installed by the script.
The Chance is that SDL is already installed otherwise you need to install it from the RetroPie-Setup from the dependency packages.
Not sure yet how to add SDL correctly yet.That said it probably needs some improvements or adjustments but it's a start.
Here are the files :
https://github.com/FollyMaddy/RetroPie-raine-modulescript/tree/mainJust push the raine.sh file and the raine folder in the emulators scriptmodules folder.
Use it on your own risk.
p.s.
The paths can be viewed in the config file.Edit:
These SDL packages are needed to compile raine :
libsdl2-dev
libsdl2-image-dev
These packages are not installed by the module-script ! -
@Folly sweet. I'll test it on Monday
-
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
I created an initial base module-script with a data-folder for patching and copying the config file.
Awesome, cheers :)
Sadly on reading the thread more closely I noticed that it needs Bookworm and I'm still on Buster and I'm not sure my Pi can handle Bookworm :(
(Whenever I try to read stuff about it to see how to/whether I can update, it's all just ARGLE WARGLE FLARGLE BARGLE and I run away sobbing.)
-
@ExarKunIv said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
@Folly sweet. I'll test it on Monday
Hey, while you're here - is there any chance of incorporating this into RetroPie-Extra, friend? :)
-
@JimmyFromTheBay said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
I created an initial base module-script with a data-folder for patching and copying the config file.
Awesome, cheers :)
Sadly on reading the thread more closely I noticed that it needs Bookworm
I think it will run on Buster as raine is old source-code.
and I'm still on Buster and I'm not sure my Pi can handle Bookworm :(
All pi's are supported :
https://www.raspberrypi.com/software/operating-systems/
But the best is to use a pi4 or pi5 and 64bit os.(Whenever I try to read stuff about it to see how to/whether I can update, it's all just ARGLE WARGLE FLARGLE BARGLE and I run away sobbing.)
Just start with a clean OS and install RetroPie manually :
https://github.com/RetroPie/RetroPie-Setup -
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
Here are the files :
https://github.com/FollyMaddy/RetroPie-raine-modulescript/tree/mainNice. Thanks for taking this further.
Positively, a few notes from a cursory look:- The link to the License file in
rp_module_licence
is not right (yields HTTP 404). - For applying the diff there exists the
applyPatch
function from RetroPie. - The indent is not right in L72-74.
- IIRC
chown
should be changed to$__user:$__group
instead of$user:$user
- The link to the License file in
-
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
I think it will run on Buster as raine is old source-code.
It could, but it requires a more recent SDL, which would mean a manual SDL2 install which in turn will have knock-on effects on the rest of a otherwise Buster-based RetroPie installation.
Others have been down the road trying to get Raine compiled with an older SDL2: https://www.1emulation.com/forums/topic/37608-is-it-possible-to-compile-raine-on-arm-device-retropie/
HTH
-
@Lolonois said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
Here are the files :
https://github.com/FollyMaddy/RetroPie-raine-modulescript/tree/mainNice. Thanks for taking this further.
Positively, a few notes from a cursory look:Thanks, I noticed a few myself too and fixed them.
- fixed help (3th commit)
- added depends for the xgettext and msgfmt commands (5th and 6th commit) (didn't work correctly so removed in 7th to 9th commit)
- added comments (3th commit)
- lowered swap (9th commit)
- The link to the License file in
rp_module_licence
is not right (yields HTTP 404).
Replace with the only thing I could find :
unknown https://raw.githubusercontent.com/zelurker/raine/refs/heads/master/source/Musashi/readme.txt
Fixed in the 3th commit- For applying the diff there exists the
applyPatch
function from RetroPie.
Adding applyPatch needs to be done later as it needs a proper diff file.
My earlier attempt with using applyPatch with your diff file failed.- The indent is not right in L72-74.
Fixed in the 4th commit
- IIRC
chown
should be changed to$__user:$__group
instead of$user:$user
Fixed in the 3th commit
-
@Lolonois said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
I think it will run on Buster as raine is old source-code.
It could, but it requires a more recent SDL, which would mean a manual SDL2 install which in turn will have knock-on effects on the rest of a otherwise Buster-based RetroPie installation.
Others have been down the road trying to get Raine compiled with an older SDL2: https://www.1emulation.com/forums/topic/37608-is-it-possible-to-compile-raine-on-arm-device-retropie/
HTH
Gotcha !
-
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
The link to the License file in rp_module_licence is not right (yields HTTP 404).
Replace with the only thing I could find :
unknown https://raw.githubusercontent.com/zelurker/raine/refs/heads/master/source/Musashi/readme.txtThe guys in the gametechwiki interpreted Raine as being Source-Available License (see box on the right). Maybe it is more accurate.
https://emulation.gametechwiki.com/index.php/RAINE -
@Lolonois said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
@Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
The link to the License file in rp_module_licence is not right (yields HTTP 404).
Replace with the only thing I could find :
unknown https://raw.githubusercontent.com/zelurker/raine/refs/heads/master/source/Musashi/readme.txtThe guys in the gametechwiki interpreted Raine as being Source-Available License (see box on the right). Maybe it is more accurate.
https://emulation.gametechwiki.com/index.php/RAINEAdded this in commit 10.
Found a missing piece fixing showing roms in emulationstation :
Commit 11 -
@ExarKunIv said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:
@Folly sweet. I'll test it on Monday
Did you got it working ?
p.s.
Use the latest script.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.