RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?

    Scheduled Pinned Locked Moved Help and Support
    arcadedeluxeretropie-extra
    36 Posts 6 Posters 2.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JimmyFromTheBay
      last edited by JimmyFromTheBay

      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?

      Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

      G F 2 Replies Last reply Reply Quote 1
      • G
        gomisensei @JimmyFromTheBay
        last edited by

        @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
        
        1 Reply Last reply Reply Quote 0
        • LolonoisL
          Lolonois
          last edited by

          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 with ProfileStart / ProfileEnd -> remove or disable
            • source/sdl/sasound.c::detect_soundcard(): Stripped down to SDL soundcard autodetect (may have knock-on effects, see below)
          • 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), then xrandr -s 640x480, then launch raine
          • Config file will be in /root/.raine/configs/rainex_sdl.cfg

          raine_poc2.png

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

          Fun 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

          G 1 Reply Last reply Reply Quote 1
          • G
            gomisensei @Lolonois
            last edited by gomisensei

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

            LolonoisL 1 Reply Last reply Reply Quote 0
            • LolonoisL
              Lolonois @gomisensei
              last edited by

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

              G 1 Reply Last reply Reply Quote 0
              • G
                gomisensei @Lolonois
                last edited by

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

                J 1 Reply Last reply Reply Quote 1
                • J
                  JimmyFromTheBay @gomisensei
                  last edited by

                  @gomisensei This is great news :) Hopefully someone will add it in to Retropie in a way dopes like me can understand :D

                  Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    Folly @JimmyFromTheBay
                    last edited by Folly

                    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.

                    1 Reply Last reply Reply Quote 1
                    • F
                      Folly @JimmyFromTheBay
                      last edited by Folly

                      @JimmyFromTheBay

                      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/main

                      Just 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 !

                      ExarKunIvE J LolonoisL 4 Replies Last reply Reply Quote 1
                      • ExarKunIvE
                        ExarKunIv @Folly
                        last edited by

                        @Folly sweet. I'll test it on Monday

                        RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                        RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                        Maintainer of RetroPie-Extra .

                        J F 2 Replies Last reply Reply Quote 0
                        • J
                          JimmyFromTheBay @Folly
                          last edited by JimmyFromTheBay

                          @Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:

                          @JimmyFromTheBay

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

                          Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                          F 1 Reply Last reply Reply Quote 0
                          • J
                            JimmyFromTheBay @ExarKunIv
                            last edited by

                            @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? :)

                            https://retropie.org.uk/forum/topic/36714/monaco-gp-remake

                            Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                            1 Reply Last reply Reply Quote 1
                            • F
                              Folly @JimmyFromTheBay
                              last edited by Folly

                              @JimmyFromTheBay said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:

                              @Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:

                              @JimmyFromTheBay

                              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

                              LolonoisL 1 Reply Last reply Reply Quote 0
                              • LolonoisL
                                Lolonois @Folly
                                last edited by

                                @Folly said in Did anyone ever support RAINE/EmuDX on Retropie/Retroarch?:

                                Here are the files :
                                https://github.com/FollyMaddy/RetroPie-raine-modulescript/tree/main

                                Nice. 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
                                F 1 Reply Last reply Reply Quote 0
                                • LolonoisL
                                  Lolonois @Folly
                                  last edited by

                                  @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

                                  F 1 Reply Last reply Reply Quote 0
                                  • F
                                    Folly @Lolonois
                                    last edited by Folly

                                    @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/main

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

                                    LolonoisL 1 Reply Last reply Reply Quote 0
                                    • F
                                      Folly @Lolonois
                                      last edited by

                                      @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 !

                                      1 Reply Last reply Reply Quote 0
                                      • LolonoisL
                                        Lolonois @Folly
                                        last edited by

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

                                        The 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

                                        F 1 Reply Last reply Reply Quote 0
                                        • F
                                          Folly @Lolonois
                                          last edited by

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

                                          The 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

                                          Added this in commit 10.

                                          Found a missing piece fixing showing roms in emulationstation :
                                          Commit 11

                                          1 Reply Last reply Reply Quote 0
                                          • F
                                            Folly @ExarKunIv
                                            last edited by Folly

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

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.