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

    Dreamcast - Reicast - Time and Date

    Scheduled Pinned Locked Moved Help and Support
    dreamcastreicast
    45 Posts 10 Posters 16.4k 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.
    • B
      backstander
      last edited by

      I'm curious about this as well. I could never get any of the workarounds to work either.

      S 1 Reply Last reply Reply Quote 1
      • S
        spud11 @backstander
        last edited by

        @backstander Funnily enough, I noticed on another thread a @gizmo98 . Not sure if this is the same gizmo98 who forked reicast. If so, would be nice to know his/her thoughts?

        RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

        1 Reply Last reply Reply Quote 1
        • gizmo98G
          gizmo98 Global Moderator
          last edited by

          I have no solution. This is a long standing issue.

          1 Reply Last reply Reply Quote 2
          • T
            tipoto
            last edited by tipoto

            I have my own solution for this reicast issue. I don't have a RPI and I don't use Retropie (I have an Odroid XU4 with OGST), but my solution should works on the Pi too.

            You will need to edit the emu.cfg file in the reicast folder (I don't know the location in Retropie)
            The Dreamcast.RTC field has to be edited every time you launch a game. It actually needs your local time minus or plus the offset between your local time and Greenwich time (GMT), AND you need to add 20 years (the result has to be converted in seconds).

            So here are the steps to get your time/date always updated when you launch a Dreamcast game:

            1. Backup these 2 files ....reicast/data/dc_flash.bin and /....reicast/emu.cfg, just in case.
            2. If reicast always asks you to set the time/date, then you need to fix that first, otherwise you can go to the next step. Here is how to fix this first problem:
            • Install dreamcast emulator "NullDC" on a PC
            • Start dreamcast without a game and you are in the bios
            • Make your settings (date,time,language) and exit the bios
            • NullDC just has created a new file in the /data directory : dc_nvmem.bin
            • Rename dc_nvmem.bin to dc_flash.bin and copy the file into your RPI "....reicast/data", overwrite existing file
            • Start reicast with or without a game to check if you don't have the Time/Date screen again
            1. You need to run these lines before launching a game. So the lines have to be added to your launcher script in Retropie. Here they are (You need to edit the path to reicast folder in Retropie):
            ### Update the time/date in emu.cfg
            time_offset=$(date +'%:::z') # Get how many hours of difference between local time and Greenwich time (GTM)
            newtime=$(date -d "$(date -d "+20 years $time_offset hours" +%D) $(date -d "+20 years $time_offset hours" +%T)" +"%s")
            # The result is in seconds (ex: 2125613317) with an offset of +20 years
            sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /path/to/reicast/emu.cfg # Replace Dreamcast.RTC value in emu.cfg
            

            It should work with any timezones.

            I have an RTC battery so the time is always up to date, but if you don't have one or if you're not connected to your network, it should at least remove the Time/Date screen when you launch a rom (I guess).

            S 2 Replies Last reply Reply Quote 2
            • S
              spud11 @tipoto
              last edited by spud11

              @tipoto Thank you. (Just added you both FYI @backstander @gizmo98 )

              I'll have a go later on with respect to this, but I just wanted to clarify something.

              With Retropie, we do have an emu.cfg. It appears in the /opt/retropie/configs/dreamcast/ folder.

              Are you saying that the code below is added to the emu.cfg as so, so that it looks like this?:

              [code]
              ###Update the time/date in emu.cfg
              time_offset=$(date +'%:::z') # Get how many hours of difference between local time and Greenwich time (GTM)
              newtime=$(date -d "$(date -d "+20 years $time_offset hours" +%D) $(date -d "+20 years $time_offset hours" +%T)" +"%s")
              #The result is in seconds (ex: 2125613317) with an offset of +20 years
              sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /path/to/reicast/emu.cfg # Replace Dreamcast.RTC value in emu.cfg
              [/code]
              
              [audio]
              disable = 0
              
              [config]
              Debug.SerialConsoleEnabled = 0
              Dreamcast.Broadcast = 4
              Dreamcast.Cable = 3
              Dreamcast.RTC = 1543276800
              Dreamcast.Region = 3
              Dynarec.Enabled = 1
              Dynarec.idleskip = 1
              Dynarec.unstable-opt = 0
              aica.LimitFPS = 1
              aica.NoBatch = 0
              aica.NoSound = 0
              bios.UseReios = 0
              pvr.MaxThreads = 3
              pvr.Subdivide = 0
              pvr.SynchronousRendering = 0
              pvr.rend = 0
              rend.UseMipmaps = 1
              rend.WideScreen = 1
              ta.skip = 0
              
              [dispmanx]
              height = 1080
              maintain_aspect = no
              width = 1920
              
              [input]
              evdev_device_id_1 = 9
              evdev_device_id_2 = 7
              evdev_device_id_3 = -1
              evdev_device_id_4 = -1
              evdev_mapping_1 = /opt/retropie/configs/dreamcast/mappings/controller_DragonRiseInc.GenericUSBJoystick.cfg
              evdev_mapping_2 = /opt/retropie/configs/dreamcast/mappings/controller_DragonRiseInc.GenericUSBJoystick_Player2.cfg
              joystick_device_id = -1
              
              [omx]
              audio_hdmi = yes
              audio_latency = 100
              
              [players]
              nb = 2
              
              [reios]
              ElfFile = 
              
              [testing]
              ta.HashCheckFile = 
              ta.HashLogFile = 
              
              [validate]
              OpenGlChecks = 0
              

              Or that the code goes into a launch file (which would probably be runcommand-onstart.sh for Retropie) ?

              RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

              1 Reply Last reply Reply Quote 1
              • S
                spud11 @tipoto
                last edited by spud11

                @tipoto Hi. So I have experimented a little bit with your code but can't get it to work. For anyone else interested, this is what I did. I have previously used NullDC to create a new dc_flash.bin so just retained that bios.

                I added the following to runcommand-onstart.sh:

                ### DREAMCAST - REICAST - Time and date correction
                ### Update the time/date in emu.cfg
                ### Get how many hours of difference between local time and Greenwich time (GTM)
                ### Replace Dreamcast.RTC value in emu.cfg
                ### The result is in seconds (ex: 2125613317) with an offset of +20 years
                Time="time_offset=$(date +'%:::z')
                newtime=$(date -d "$(date -d "+20 years $time_offset hours" +%D) $(date -d "+20 years $time_offset hours" +%T)" +"%s")
                sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /opt/retropie/configs/dreamcast/emu.cfg"
                

                and:

                	reicast-audio-oss)
                		joycommand="$Time &"
                		eval $joycommand
                	;;
                

                There was no change. Perhaps someone else could experiment with tipoto's code?

                RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                1 Reply Last reply Reply Quote 1
                • T
                  tipoto
                  last edited by tipoto

                  To answer your first question, emu.cfg has to be edited by the script, not manually, but I think you figured it out when you did your test.

                  I looked at the retropie wiki and it seems that you modified or created the right script "runcommand-onstart.sh", which has to be placed here: /opt/retropie/configs/all/.
                  However, you modified my code and it can't work this way.

                  If you need a function and a case statement, then try this instead:

                  dreamcast_time_fn () {
                  	### DREAMCAST - REICAST - Time and date correction
                  	### Update the time/date in emu.cfg
                  	### 1) Get how many hours of difference between local time and Greenwich time (GTM)
                  	### 2) Calculate the current time in seconds (ex: 2125613317) with an offset of +20 years
                  	### 3) Replace Dreamcast.RTC value in emu.cfg with the result
                  
                  	time_offset=$(date +'%:::z') 
                  	newtime=$(date -d "$(date -d "+20 years $time_offset hours" +%D) $(date -d "+20 years $time_offset hours" +%T)" +"%s")
                  	sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /opt/retropie/emulators/reicast/emu.cfg
                  }
                  

                  and, inside a case statement:

                  	reicast-audio-oss)
                  		dreamcast_time_fn
                  	;;
                  

                  "reicast-audio-oss" looks weird to me, but I don't have Retropie so I don't know what is the variable when you launch reicast. Make sure it is the right value.
                  Also I assume that the case statement is the right way to go, but again, make sure it is correct.

                  EDIT:
                  2 more things:

                  • Just in case, make sure to give the permissions on the bios file "dc_flash.bin"
                  • You need to make sure that reicast starts without displaying the time/date screen, my script won't fix that by itself, it will only make sure that the date is updated with the current time when you launch a game. When reicast starts, it checks the emu.cfg, then it grabs the "Dreamcast.RTC" value, then it updates the bios with it.
                  B 1 Reply Last reply Reply Quote 1
                  • B
                    backstander @tipoto
                    last edited by backstander

                    @tipoto
                    Where are you putting the "case statement":

                    	reicast-audio-oss)
                    		dreamcast_time_fn
                    	;;
                    

                    Does that go in /opt/retropie/configs/all/runcommand-onstart.sh as well?

                    Also, shouldn't there be a test before running dreamcast_time_fn () to ensure that reicast is the emulator being ran so this doesn't have to execute every time the Runcommand is invoked?

                    1 Reply Last reply Reply Quote 1
                    • T
                      tipoto
                      last edited by

                      Like I said, I don't have Retropie, so I don't know the structure and how it works exactly.
                      About this:

                      	reicast-audio-oss)
                      		dreamcast_time_fn
                      	;;
                      

                      This code is part of a case statement and it comes from spud11, I just edited what he wrote in his post to make it look good. My original post didn't content this part. You have to make sure by yourself that this case statement is correct and logical. If so, it has to be in /opt/retropie/configs/all/runcommand-onstart.sh, after the function dreamcast_time_fn (not before)

                      I don't know how Retropie gives you the information about the starting emulator, hopefully someone in the forum could help for this detail. When spud11 added the case statement, I thought it was part of the Retropie structure and it was the answer to that. But double check with someone whom knows Retropie.

                      You will need something that looks like this (but adapted to Retropie):

                      launched_emulator="$1"
                      case "$lauched_emulator" in
                      	reicast)
                      		dreamcast_time_fn
                      	;;
                      
                      	mupen64plus)
                      		# your code
                      	;;
                      
                      	*)
                      		# your code
                      	;;
                      esac
                      

                      It would be great to have someone in the forum to tell you exactly where to add my function and how to tell Retropie to launch it only with reicast.

                      S 1 Reply Last reply Reply Quote 1
                      • S
                        spud11 @tipoto
                        last edited by spud11

                        @tipoto Hi. Yes, I do recognise the case statement you are using. Might be easier, to give things a bit more structure, for me to extract from my runcommand-onstart.sh the appropriate parts I have (adapted to your new code - thank you!). I've also created the new dc_flash.bin as per instructions just to make sure my old one wasn't the problem.

                        My runcommand-onstart.sh is very long, so I'll just take out the parts that are relevant and then we can look at it again and, hopefully, as you pointed out, one of the moderators might take an interest:

                        ### Code begins
                        ### Game/ROM full path
                        rom="${3##*/}"
                        
                        dreamcast_time_fn () {
                        	### DREAMCAST - REICAST - Time and date correction
                        	### Update the time/date in emu.cfg
                        	### 1) Get how many hours of difference between local time and Greenwich time (GTM)
                        	### 2) Calculate the current time in seconds (ex: 2125613317) with an offset of +20 years
                        	### 3) Replace Dreamcast.RTC value in emu.cfg with the result
                        
                        	time_offset=$(date +'%:::z') 
                        	newtime=$(date -d "$(date -d "+20 years $time_offset hours" +%D) $(date -d "+20 years $time_offset hours" +%T)" +"%s")
                        	sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /opt/retropie/configs/dreamcast/emu.cfg
                        }
                        
                        case $2 in
                        
                        	reicast-audio-oss)
                        		$dreamcast_time_fn
                        	;;
                        esac
                        

                        I've added the $ sign to the command above as I believe it will need it.
                        For the sake of completeness, my runcommand.info file, followed by my runcommand.log, are as follows:

                        dreamcast
                        reicast-audio-oss
                        /home/pi/RetroPie/roms/dreamcast/NBA Showtime.cdi
                        /opt/retropie/emulators/reicast/bin/reicast.sh oss "/home/pi/RetroPie/roms/dreamcast/NBA Showtime.cdi"
                        

                        As you will see from the above, case $2 (which is what I use) is reicast-audio-oss. And the log:

                        Parameters: 
                        Executing: /opt/retropie/emulators/reicast/bin/reicast.sh oss "/home/pi/RetroPie/roms/dreamcast/NBA Showtime.cdi"
                        

                        There are no errors from the log, but there is also no change to the outcome - I still need to do the time/date thing.

                        RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                        1 Reply Last reply Reply Quote 1
                        • T
                          tipoto
                          last edited by tipoto

                          Nope, don't add $ to call the function, I'm surprised you didn't get an error with that.

                          However even if my function is eventually called, it seems that it won't fix the fact that you will be asked for the date/time, you need to fix this issue first, then my script will make sure that it won't happen again and you will always have the current time on with your saves on the VMU.

                          It's weird that you still have this screen since you created a fresh bios as I asked to do. What type of bios did you create (Region free, NTSC, PAL... ?), if it was a region free, try a specific one (PAL or NTSC), it won't restrain you to play any game, it will just chose a frame rate by default (50 or 60 fps). Also, try to change the permissions on the bios, just in case reicast doesn't manage to edit the file.
                          To do so, you can do:

                          sudo chmod 777 /path/to/the/bios/dc_flash.bin
                          

                          EDIT:
                          By the way, the function is not really necessary, you can put the content of the function directly into the case statement if you want, it's up to you.

                          S 1 Reply Last reply Reply Quote 1
                          • S
                            spud11 @tipoto
                            last edited by

                            @tipoto Okay, I'm having trouble changing the permissions from 0755 to 0777 even with sudo. I'll need to check which bios I created too. Unfortunately, I've got to go out now. Thanks for your help.

                            RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                            1 Reply Last reply Reply Quote 1
                            • T
                              tipoto
                              last edited by tipoto

                              Oh... I forgot to mention something very important! When you create the new dc_flash.bin with NullDC (by renaming dc_nvmem.bin), you have to launch a game and set the date/time! Otherwise the manipulation is completely useless.
                              After that it should work in your RPI without asking for the time/date anymore.

                              Another thing that I just noticed, even with my script, if you don't play a game for too long (maybe one month or so), it will ask for the time/date again since the registered time in dc_flash.bin and the time inemu.cfg will be too different.
                              Once the gap is too big, it seems that reicast doesn't refresh dc_flash.bin properly anymore.
                              I just had to recreate a dc_flash.bin right now for this reason. The problem has been fixed immediately with the new file, so it should work for you too. ;)

                              S 2 Replies Last reply Reply Quote 1
                              • S
                                spud11 @tipoto
                                last edited by

                                @tipoto Hi. I've finally got back to this. Thanks for the extra info too.

                                I haven't yet checked which version of the BIOS I'm using (ie Region free etc), because I haven't yet got past the issue with the write permissions using my current dc_flash.bin. If it's necessary to write to this file, then that is currently a stumbling block.

                                Using both WinSCP and Putty, I've tried to change the permissions both of the BIOS folder and of the individual file dc_flash.bin, both without success. The permissions remain 755 rather than 777, meaning no write access for Group and Others.

                                Tried sudo chmod 777 dc_flash.bin from within the folder and sudo chmod -R 0777 /home/pi/RetroPie/BIOS without success.

                                I'd like to try to sort this out before experimenting much further. Hopefully, someone will chime in on why the BIOS files can't be made 0777.

                                RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                1 Reply Last reply Reply Quote 0
                                • S
                                  spud11 @tipoto
                                  last edited by

                                  @tipoto Okay. Just went back to NullDC - it's a US NTSC Bios. I set the date to 12/28/1998 and it now loads automatically in NullDC without requesting further time/date input, but having tried it again in Retropie, it requires further time/date input.

                                  As you suggested, I removed the case statement so it now appears as follows in runcommand-onstart.sh:

                                  reicast-audio-oss)
                                  		time_offset=$(date +'%:::z')
                                  		newtime=$(date -d "$(date -d "+20 years $time_offset hours" +%D) $(date -d "+20 years $time_offset hours" +%T)" +"%s")
                                  		sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /opt/retropie/configs/dreamcast/emu.cfg
                                  	;;
                                  

                                  There are no errors in the log. Unless it is the 777 write permissions, I'm not sure what the problem is.

                                  RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    tipoto
                                    last edited by tipoto

                                    I think you misunderstand a few things, so I need to clarify:

                                    • You need to set the time/date in NullDC, which means that you have set 06/24/2017 and the current time. Don't leave it in 1998.
                                    • In the new code that you kept in your runcommand-onstart.sh, you actually kept the case statement and you removed the function, which is fine, but I just wanted to clarify this since you were saying that you removed the case statement and it's not the case.

                                    For the permissions change, first of all I want to mention that it's maybe not necessary to do it, I was just suggesting to do it since we didn't get any result with the other things that we tried, maybe it will work without modifying the permissions. With that said, if you are still stuck, it is worth trying this option. If you don't manage to change the permissions, maybe it's because you are logged as root and you try to use sudo, if it's the case, don't use sudo.
                                    And if you are not logged as root, you can try to do it, but it should normally work when you are logged as pi with using sudo.

                                    S 1 Reply Last reply Reply Quote 1
                                    • S
                                      spud11 @tipoto
                                      last edited by spud11

                                      @tipoto You, sir, are brilliant!

                                      The workaround does work. I went back to NullDC and created a new bios, setting the date to the current date of 06/25/2017, then copied that bios into my Retropie bios folder. (The bios is US NTSC, for anyone else who wants to give this a go).

                                      The case statement (rather than the function, as you pointed out) in runcommand-onstart.sh is:

                                       reicast-audio-oss)
                                      		time_offset=$(date +'%:::z')
                                      		newtime=$(date -d "$(date -d "+20 years $time_offset hours" +%D) $(date -d "+20 years $time_offset hours" +%T)" +"%s")
                                      		sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /opt/retropie/configs/dreamcast/emu.cfg
                                      	;;
                                      

                                      The permissions in respect of the bios remain 755 which is fine as it seems to work anyway.

                                      I note also your point that the bios might have to be recreated every now and again for it to continue working, but this workaround is very good (in my view) and hopefully others using Retropie will be able to replicate it easily enough.

                                      I hope a moderator picks up your instructions, tipoto, and adds it to the wiki.

                                      My next step will be to go back to the "function" method, so that I can set it up to work concurrently with xboxdrv in a case statement applying to Reicast.

                                      Thank you!

                                      Edit: One thing I should add is that I didn't need to set the date/time "in game" once. It just seemed to work straightaway and I've now tested with half a dozen games and even reset the Pi in between games and it continues to work.

                                      RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        tipoto
                                        last edited by tipoto

                                        I'm glad that the new bios worked this time! :)

                                        But I'm also curious to know if the script works too! ;)
                                        The fact that you can now skip the time/date screen is only due to the new bios (you don't need any script for that), but my little script allows the system to also update the time every time you launch a game. That way you always have a logical time when you save a game on the VMU, it should also prevent reicast to display the time screen again since the date and time will be refreshed regularly (it's why you have to launch a game on a regular basis otherwise the screen will eventually come back again).

                                        Could you just open reicast without any game, so you can have access to the system manager? Here you should read the date and time, if it's up to date, it means my script has been launched, otherwise it means that the case statement doesn't do anything.
                                        If the time is not refreshed, could you send me your runcommand-onstart.sh file, so I can take a look at it?

                                        Thanks!

                                        S 2 Replies Last reply Reply Quote 1
                                        • space cadetS
                                          space cadet
                                          last edited by

                                          I've been trying to figure this out as well. Thanks for the info on the bios!

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            spud11 @tipoto
                                            last edited by spud11

                                            @tipoto No problems. I'm not 100% sure how to invoke the bios without starting a game so I've set out below both my attract mode and the emulator commands and was just wondering whether you might be able to suggest changes that would invoke the bios (although I know you don't have retropie).

                                            I'll try to send you the runcommand-onstart.sh in my next post. This is now quite a long file, 99% of which you can ignore, but it might be too long to send in a post. It's only in the very last part of that file that there is reference now to the reicast case statement.

                                            Attract mode file:

                                            # Generated by Attract-Mode v2.2.1
                                            #
                                            executable           /opt/retropie/supplementary/runcommand/runcommand.sh
                                            args                 0 _SYS_ dreamcast "[romfilename]"
                                            rompath              /home/pi/RetroPie/roms/dreamcast
                                            romext               .cdi;.gdi;.CDI;.GDI
                                            system               Sega Dreamcast
                                            info_source          thegamesdb.net
                                            artwork    flyer           /home/pi/RetroPie/roms/dreamcast/boxart
                                            artwork    marquee         /home/pi/RetroPie/roms/dreamcast/marquee
                                            artwork    snap            /home/pi/RetroPie/roms/dreamcast/snap
                                            artwork    wheel           /home/pi/RetroPie/roms/dreamcast/wheel
                                            

                                            Emulators.cfg:

                                            reicast-audio-omx = "CON:/opt/retropie/emulators/reicast/bin/reicast.sh omx %ROM%"
                                            default = "reicast-audio-oss"
                                            reicast-audio-oss = "CON:/opt/retropie/emulators/reicast/bin/reicast.sh oss %ROM%"
                                            

                                            A copy of reicast.sh:

                                            #!/usr/bin/env bash
                                            
                                            # This file is part of The RetroPie Project
                                            #
                                            # The RetroPie Project is the legal property of its developers, whose names are
                                            # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
                                            #
                                            # See the LICENSE.md file at the top-level directory of this distribution and
                                            # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
                                            #
                                            
                                            AUDIO="$1"
                                            ROM="$2"
                                            rootdir="/opt/retropie"
                                            configdir="$rootdir/configs"
                                            
                                            source "$rootdir/lib/inifuncs.sh"
                                            
                                            function mapInput() {
                                                local js_device
                                                local js_device_num
                                                local ev_device
                                                local ev_devices
                                                local ev_device_num
                                                local device_counter
                                                local conf="$configdir/dreamcast/emu.cfg"
                                                local params=""
                                            
                                                # get a list of all present js device numbers and device names
                                                # and device count
                                                for js_device in /dev/input/js*; do
                                                    js_device_num=${js_device/\/dev\/input\/js/}
                                                    for ev_device in /dev/input/event*; do
                                                        ev_device_num=${ev_device/\/dev\/input\/event/}
                                                        if [[ -d "/sys/class/input/event${ev_device_num}/device/js${js_device_num}" ]]; then
                                                            file[$ev_device_num]=$(grep --exclude=*.bak -rl "$configdir/dreamcast/mappings/" -e "= $(</sys/class/input/event${ev_device_num}/device/name)")
                                                            if [[ -f "${file[$ev_device_num]}" ]]; then
                                                                #file[$ev_device_num]="${file[$ev_device_num]##*/}"
                                                                ev_devices[$ev_device_num]=$(</sys/class/input/event${ev_device_num}/device/name)
                                                                device_counter=$(($device_counter+1))
                                                            fi
                                                        fi
                                                    done
                                                done
                                            
                                                # emu.cfg: store up to four event devices and mapping files
                                                if [[ "$device_counter" -gt "0" ]]; then
                                                    # reicast supports max 4 event devices
                                                    if [[ "$device_counter" -gt "4" ]]; then
                                                        device_counter="4"
                                                    fi
                                                    local counter=0
                                                    for ev_device_num in "${!ev_devices[@]}"; do
                                                        if [[ "$counter" -lt "$device_counter" ]]; then
                                                            counter=$(($counter+1))
                                                            params+="-config input:evdev_device_id_$counter=$ev_device_num "
                                                            params+="-config input:evdev_mapping_$counter=${file[$ev_device_num]} "
                                                        fi
                                                    done
                                                    while [[ "$counter" -lt "4" ]]; do
                                                        counter=$(($counter+1))
                                                        params+="-config input:evdev_device_id_$counter=-1 "
                                                        params+="-config input:evdev_mapping_$counter=-1 "
                                                    done
                                                else
                                                    # fallback to keyboard setup
                                                    params+="-config input:evdev_device_id_1=0 "
                                                    device_counter=1
                                                fi
                                                params+="-config input:joystick_device_id=-1 "
                                                params+="-config players:nb=$device_counter "
                                                echo "$params"
                                            }
                                            
                                            if [[ ! -f "$HOME/RetroPie/BIOS/dc_boot.bin" ]]; then
                                                dialog --msgbox "You need to copy the Dreamcast BIOS files (dc_boot.bin and dc_flash.bin) to the folder $biosdir to boot the Dreamcast emulator." 22 76
                                                exit 1
                                            fi
                                            
                                            params=(-config config:homedir=$HOME -config x11:fullscreen=1)
                                            getAutoConf reicast_input && params+=($(mapInput))
                                            [[ -n "$AUDIO" ]] && params+=(-config audio:backend=$AUDIO -config audio:disable=0)
                                            [[ -n "$ROM" ]] && params+=(-config config:image="$ROM")
                                            if [[ "$AUDIO" == "oss" ]]; then
                                                aoss "$rootdir/emulators/reicast/bin/reicast" "${params[@]}" >/dev/null
                                            else
                                                "$rootdir/emulators/reicast/bin/reicast" "${params[@]}" >/dev/null
                                            fi
                                            

                                            RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                            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.