Home | Forums | What's new | Resources | |
Get internal clock date and time ? |
cafe-alpha - Feb 10, 2012 |
television2000 | Feb 11, 2012 | |||
Any particular reason why you're avoiding SGL Cafe ? Funny that I'm avoiding SBL at all cost right now. |
vbt | Feb 12, 2012 | |||
Uint8 *t; t = PER_GET_TIM(); char my_date[60]; sprintf(my_date,"%02x%02x/%02d/%02x %02x-%02x-%02x",t[6],t[5],t[4] & 0x0F,t[3],t[2],t[1],t[0] ); |
cafe-alpha | Feb 18, 2012 | ||||||||||||||||||||
Thank you Antime for your precious help ! Until now, I didn't know anything about SMPC, and thank to your post, I now understand a little about SMPC. I use INTBACK in order to retrieve RTC value, and poll SMPC's status register instead of using SMPC interrupt. (Related information can be found in ST-169-R1-072694.pdf pages 13-16) For people interested, see the following code for usage example, or download source code here....
Code:
(I tested the code above under yabause and real hardware and it seems to work correctly.)
The main reason I want to use SBL is that nearly all of its sources are available, which is not the case with SGL. (SBL source code can be found in SaturnOrbit's forlder: C:\SaturnOrbit\SBL_601\SEGALIB) However, source code related to RTC is not available >_<
Thank you for your SBL example, vbt RTC can actually be acquired from your code above, however, sources related to theses SBL functions are not available (only SEGA_PER.A file is available). Since I want my project to be compilable from sources, I tried to directly use INTBACK, and it works now |
slinga | Feb 8, 2023 | |||
@nando..., According to this issue jo_random() is seeded with system time by default: jo_random() Needs a Seed · Issue #16 · johannes-.... Is that not sufficient for your purposes? Here's how I was doing it before: Twelve-Snakes/main.c at 48ec1cfe45168a21f649abe171.... Here's how Johaness is setting jo_random_seed: Get or set random seed · johannes-fetz/joengine@0.... |