Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
libretro-minivmac
Commits
248c7dbc
Commit
248c7dbc
authored
Jan 25, 2022
by
Vladimir Serbinenko
Browse files
Code simplification
parent
b48c030a
Changes
1
Hide whitespace changes
Inline
Side-by-side
minivmac/src/OSGLUERETRO.c
View file @
248c7dbc
...
...
@@ -43,6 +43,8 @@ extern char RETRO_DIR[512];
LOCALVAR
ui5b
TimeDelta
;
LOCALVAR
int64_t
current_us
;
#define TicksPerSecond 1000000
#define MyInvTimeStep 16626
/* TicksPerSecond / 60.14742 */
/* Forward declarations */
void
DoEmulateOneTick
(
void
);
...
...
@@ -1174,7 +1176,7 @@ void retro_init_time(void)
//retro loop
void
retro_loop
(
void
)
{
current_us
+=
1000000
/
60
;
current_us
+=
MyInvTimeStep
;
if
(
DSKLOAD
==
1
)
{
(
void
)
Sony_Insert1
(
RPATH
,
falseblnr
);
...
...
@@ -1197,9 +1199,6 @@ GLOBALOSGLUPROC WaitForNextTick(void) { }
LOCALVAR
ui5b
TrueEmulatedTime
=
0
;
LOCALVAR
ui5b
CurEmulatedTime
=
0
;
#define TicksPerSecond 1000000
LOCALVAR
ui5b
NewMacDateInSeconds
;
LOCALVAR
ui5b
LastTimeSec
;
...
...
@@ -1212,8 +1211,6 @@ LOCALPROC GetCurrentTicks(void)
NewMacDateInSeconds
=
TimeDelta
+
LastTimeSec
;
}
#define MyInvTimeStep 16626
/* TicksPerSecond / 60.14742 */
LOCALVAR
ui5b
NextTimeSec
;
LOCALVAR
ui5b
NextTimeUsec
;
...
...
@@ -1687,22 +1684,9 @@ LOCALPROC RunEmulatedTicksToTrueTime(void)
int
RunOnEndOfSixtieth
(
void
)
{
while
(
ExtraTimeNotOver
())
{
struct
timespec
rqt
;
struct
timespec
rmt
;
si5b
TimeDiff
=
GetTimeDiff
();
if
(
TimeDiff
<
0
)
{
rqt
.
tv_sec
=
0
;
rqt
.
tv_nsec
=
(
-
TimeDiff
)
*
1000
;
(
void
)
nanosleep
(
&
rqt
,
&
rmt
);
}
}
OnTrueTime
=
TrueEmulatedTime
;
RunEmulatedTicksToTrueTime
();
UpdateTrueEmulatedTime
();
OnTrueTime
=
TrueEmulatedTime
;
RunEmulatedTicksToTrueTime
();
}
LOCALPROC
ReserveAllocAll
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment