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.
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.