mirror of
https://github.com/Pecusx/libretro-atari800.git
synced 2026-05-20 22:33:22 +02:00
Use frame counter instead of real clock
This commit is contained in:
@@ -16,17 +16,6 @@ char DISKA_NAME[512]="\0";
|
|||||||
char DISKB_NAME[512]="\0";
|
char DISKB_NAME[512]="\0";
|
||||||
char TAPE_NAME[512]="\0";
|
char TAPE_NAME[512]="\0";
|
||||||
|
|
||||||
//TIME
|
|
||||||
#ifdef __CELLOS_LV2__
|
|
||||||
#include "sys/sys_time.h"
|
|
||||||
#include "sys/timer.h"
|
|
||||||
#define usleep sys_timer_usleep
|
|
||||||
#else
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <time.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern void Screen_SetFullUpdate(int scr);
|
extern void Screen_SetFullUpdate(int scr);
|
||||||
|
|
||||||
long frame=0;
|
long frame=0;
|
||||||
@@ -103,36 +92,6 @@ void retro_set_input_poll(retro_input_poll_t cb)
|
|||||||
input_poll_cb = cb;
|
input_poll_cb = cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
long GetTicks(void)
|
|
||||||
{ // in MSec
|
|
||||||
#ifndef _ANDROID_
|
|
||||||
|
|
||||||
#ifdef __CELLOS_LV2__
|
|
||||||
|
|
||||||
//#warning "GetTick PS3\n"
|
|
||||||
|
|
||||||
unsigned long ticks_micro;
|
|
||||||
uint64_t secs;
|
|
||||||
uint64_t nsecs;
|
|
||||||
|
|
||||||
sys_time_get_current_time(&secs, &nsecs);
|
|
||||||
ticks_micro = secs * 1000000UL + (nsecs / 1000);
|
|
||||||
|
|
||||||
return ticks_micro;///1000;
|
|
||||||
#else
|
|
||||||
struct timeval tv;
|
|
||||||
gettimeofday (&tv, NULL);
|
|
||||||
return (tv.tv_sec*1000000 + tv.tv_usec);///1000;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
struct timespec now;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
|
||||||
return (now.tv_sec*1000000 + now.tv_nsec/1000);///1000;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
int slowdown=0;
|
int slowdown=0;
|
||||||
|
|
||||||
#if defined(ANDROID) || defined(__ANDROID__)
|
#if defined(ANDROID) || defined(__ANDROID__)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ int retrojoy_init=0,retro_ui_finalized=0;
|
|||||||
int retro_sound_finalized=0;
|
int retro_sound_finalized=0;
|
||||||
|
|
||||||
float retro_fps=49.8607597;
|
float retro_fps=49.8607597;
|
||||||
|
long long retro_frame_counter;
|
||||||
extern int ToggleTV;
|
extern int ToggleTV;
|
||||||
extern int CURRENT_TV;
|
extern int CURRENT_TV;
|
||||||
|
|
||||||
@@ -621,6 +622,8 @@ void retro_run(void)
|
|||||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
|
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
|
||||||
update_variables();
|
update_variables();
|
||||||
|
|
||||||
|
retro_frame_counter++;
|
||||||
|
|
||||||
if(pauseg==0){
|
if(pauseg==0){
|
||||||
|
|
||||||
if (ToggleTV == 1)
|
if (ToggleTV == 1)
|
||||||
|
|||||||
+4
-1
@@ -647,9 +647,12 @@ void PLATFORM_DisplayScreen(void)
|
|||||||
retro_Render();
|
retro_Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern float retro_fps;
|
||||||
|
extern long long retro_frame_counter;
|
||||||
|
|
||||||
double PLATFORM_Time(void)
|
double PLATFORM_Time(void)
|
||||||
{
|
{
|
||||||
return GetTicks()/1000 ;//* 1e-3;
|
return retro_frame_counter * (1000.0 / retro_fps);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PLATFORM_PaletteUpdate(void)
|
void PLATFORM_PaletteUpdate(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user