Dreamcast - Reicast - Time and Date
-
Ok, I finally decided to install an image with HyperPie on my old RPI2 that I wasn't using anymore.
It seems that reicast refreshes the time and date automatically on RetroPie, you don't need any extra code for that! So you can remove the script I sent you (even thought it was correct and at the right place), I need it on my XU4, but it's not necessary on the RPI.
Actually the solution for the bios was on the first link of your first post of this topic (which is on the Wiki as well):
https://retropie.org.uk/forum/topic/364/every-time-i-play-dreamcast-displays-the-setting-screen-time-date/51The last thing that you may want to do, is to create a fake game to have access to the reicast System Manager, in case you want to format or manage the space on your VMUs.
Here is what you have to do:- Create a fake game by typing this command on a terminal:
ln -sv fileThatDoesNotExist ~/RetroPie/roms/dreamcast/systemManager.cdi
- Edit the Dreamcast romlist file
/home/pi/.attract/romlists/Sega Dreamcast.txt
Add this line right after the first line:
systemManager;System Manager;Sega Dreamcast;...
You need to complete the line properly, replace "..." by the something that matches the structure that you have in this file.
You should be all set with that.
-
@tipoto Thanks. I'm just wondering about some of the comments at the bottom of that thread. Most of the people who posted were unable to update the time/date at all. I suppose, when creating the new bios, they might not have updated the bios to the current time/date (ie they may have made the same mistake I made), but it still makes me wonder whether we should still have the case statement. I suppose it does no harm leaving it in runcommand-onstart.sh in case it actually does do something.
I tried to add the fake file but have received the following message:
ln: failed to create symbolic link `/home/pi/RetroPie/roms/dreamcast/systemManager.cdi`: Operation not permitted
I copied and pasted your command so that shouldn't be a problem.
-
Just add
sudo
to the command:sudo ln -sv fileThatDoesNotExist ~/RetroPie/roms/dreamcast/systemManager.cdi
-
@tipoto Thanks. I should have thought of that and will do so once at home.
By the way, I'm not sure whether Retropie/Retroarch updates time automatically from the get go.
Just before I got the new bios to work, I did make one further change to things to be sure that Retroarch uses my current localised time. I followed @mediamogul's guide here and set up my local time:
https://retropie.org.uk/forum/topic/9575/how-to-set-time-in-retroarch/2
I just point this out if anyone else is viewing this thread.
-
@tipoto Hi tipoto. I have added sudo to the command, but I still get the same message each time. Not sure why.
-
It's weird! Try to change the permissions of the folder then try again:
sudo chmod -R 777 /home/pi/RetroPie/roms/dreamcast
-
@tipoto Yep, sure is. But in fact it has worked, despite the error. So thank you!
I've checked the time via System Manager and it remains up to date so far. I will be interested to see what happens if I leave it for a while like you did. Did you leave it about a month or so and not play any games?
-
Did this got implemented in any form in Retropie by now? Or do we still have to fix it manualy?
-
@Cederick said in Dreamcast - Reicast - Time and Date:
Did this got implemented in any form in Retropie by now? Or do we still have to fix it manualy?
My bios are unaltered and, as of an update 1 week ago, there is not a fix built in.
-
@hooperre I wonder why it takes so long for this fix to get implemented to be honest.
-
@Cederick It is a great pity. I've been hoping for a couple of years that it would be fixed. Several individuals have had a serious go at altering reicast's code but it seems no one has been successful, at least for the rpi.
-
But I saw some option to fix it on images with games on it but I don't want to pirate games just to have the option to fix it...
-
Here is an updated code for the time and date issue:
# We need to add 20 years to the current date (we add 631123200 seconds) # but since the limit is 2147483647 seconds (January 19th 2038), we need to loop when we reach this number (it becomes negative) newtime=$(date +%s); let "newtime = $newtime + 631123200"; let "time_offset = $newtime - 2147483647"; let "newtime = -2147483648 + $time_offset" sudo perl -i -p -e "s|Dreamcast.RTC = .*|Dreamcast.RTC = "$newtime"|" /home/odroid/.reicast/emu.cfg # Replace the Dreamcast.RTC value in emu.cfg
You need to change the path to the emu.cfg file in the code in order to adapt it to your system (I have an odroid XU4 and I'm not using retropie).
The code that I provided a year ago, doesn't work anymore because of "year 2038" issue, but this new code should work just fine.Edit: This script has to be executed every-time you launch a game, before reicast starts.
-
I know 2 ways to get around this issue :
- the first is to use a custom bios for dreamcast, i don't know if it's a legal ressource (it wasn't created by sega afaik), so i won't link it, however it shouldn't be hard to find it if you google "bootROM v1.032 Retail", that bios just won't ask, it's one of its features.
- the second one, which i only confirmed with lr-reicast, is to enable "boot to BIOS" (that's a core option in lr-reicast allowing direct access to bios), set time and date, disable "boot to BIOS" and quit. After that the emulator won't ask again.
-
My code is for the standalone version of reicast only. It has to be executed every-time a game is launched.
The time and date are asked when there is a too big difference between the date of your linux system and the date written in the emu.cfg file.
So basically my code update the time in the emu.cfg just before a game is launched. The little advantage of doing this, it's that the time and date in the emulator are correct while you're playing a game or when you launch the system manager. -
@tipoto said in Dreamcast - Reicast - Time and Date:
The little advantage of doing this, it's that the time and date in the emulator are correct while you're playing a game or when you launch the system manager.
That's also true with my 2 methods, as long as you set the time/date properly in system manager.
None of those tips to get the date updated might work on rpi tough, because rpi doesn't have rtc, so it's not keeping its time updated except if you sync it from internet.
I think the custom bios method is somehow easier, since you only need to replace the bios, no script editing. -
@barbudreadmon Hi. Thanks for your input on this. I tested
jc-bootROM-retail-v1.032.bin
on the rpi, but it doesn't work. Runcommand.log comes up with this:Parameters: Executing: /opt/retropie/emulators/reicast/bin/reicast.sh oss "/home/pi/RetroPie/roms/dreamcast/NBA Showtime.cdi" evdev: open: No such file or directory joystick open: No such file or directory /opt/retropie/emulators/reicast/bin/reicast.sh: line 88: 4512 Trace/breakpoint trap aoss "$rootdir/emulators/reicast/bin/reicast" "${params[@]}" > /dev/null
So unfortunately the easiest way doesn't seem to be operative on the rpi.
-
Yes, you are right, you need to have a constant connection to internet or to have an RTC battery.
From what I noticed with my system, but it can be different on a RPI with retropie , reicast only updates the date in the emu.cfg when you exit a game, and then starts from this date the next time you play a game. Because of that, as time passes without playing a game, the clock inside reicast losses time, and at some point, when the difference is too big with the system, it asks again to update the clock manually. But like I say, it is maybe specific to my system.That being said, you're also right when you say that it's easier to just download a custom bios that gets rid of this issue directly. I haven't tried this bios, but if it works and if you don't have your clock constantly updated, it's perfect I guess.
-
@tipoto Hi. Thanks again for looking at this. Do you think this will last forever or will it be like the other fix and after about a month it will need to be redone?
-
@spud11 Oh! We just replied at the same time. :)
The problem can be easily fixed in reicast (I think), when you start reicast, it has to update the date in the emu.cfg before doing anything else, it has to be the first task it does. Because currently, it just reads the date in the emu.cfg and starts from it while you're playing, then when you exit the game, it saves the date into emu.cfg. But the clock in reicast is never updated with your system and is only "alive" when you play a game. So for instance, if it was 1:30 pm on January 10th the last time you exit a game, and if you don't play for 3 months, the next time you will launch a game, the date will be 3 months late. And if you play for 30 minutes, when you will exit the game, the clock will be 2 pm on January 10th (3 months late). And it seems that when the offset is bigger than about a month, it asks you to update the date.It's why I wrote this little script to do this task automatically. Some people maybe tried the script that I provided months ago in this thread, but this one wasn't working anymore because of a technical issue with every 32 bit system (too complicated to explain here), but this new script is smaller and doesn't have this issue.
Edit: I want to add that if you don't have an RTC battery or an internet connection, it doesn't matter, the time won't be right with the real time of course, but at least the time between your system and reicast will be perfectly in-sync and so it shouldn't ask to update the date and time anymore.
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.