mirror of
https://github.com/Pecusx/libretro-atari800.git
synced 2026-05-20 22:33:22 +02:00
+1
-1
@@ -53,7 +53,7 @@ int pre_main(const char *argv)
|
||||
for (i = 0; i < PARAMCOUNT; i++)
|
||||
{
|
||||
xargv_cmd[i] = (char*)(XARGV[i]);
|
||||
LOGI("%2d %s\n",i,XARGV[i]);
|
||||
log_cb(RETRO_LOG_INFO, "%2d %s\n",i,XARGV[i]);
|
||||
}
|
||||
|
||||
skel_main(PARAMCOUNT,( char **)xargv_cmd);
|
||||
|
||||
@@ -541,7 +541,11 @@
|
||||
#define WORDS_BIGENDIAN 1
|
||||
#endif
|
||||
/* Define if unaligned word access is ok. */
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__m68k__)
|
||||
#define WORDS_UNALIGNED_OK 1
|
||||
#else
|
||||
#undef WORDS_UNALIGNED_OK
|
||||
#endif
|
||||
|
||||
/* Target: Standard X11. */
|
||||
/* #undef X11 */
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#if defined(__ANDROID__) || defined(ANDROID)
|
||||
#include <android/log.h>
|
||||
#define LOG_TAG "RetroArch.atari800"
|
||||
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
|
||||
#else
|
||||
#define LOGI printf
|
||||
#endif
|
||||
@@ -16,17 +16,6 @@ char DISKA_NAME[512]="\0";
|
||||
char DISKB_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);
|
||||
|
||||
long frame=0;
|
||||
@@ -103,36 +92,6 @@ void retro_set_input_poll(retro_input_poll_t 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;
|
||||
|
||||
#if defined(ANDROID) || defined(__ANDROID__)
|
||||
|
||||
+32
-14
@@ -1,3 +1,5 @@
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "libretro.h"
|
||||
|
||||
#include "libretro-core.h"
|
||||
@@ -11,6 +13,10 @@
|
||||
cothread_t mainThread;
|
||||
cothread_t emuThread;
|
||||
|
||||
static void fallback_log(enum retro_log_level level, const char *fmt, ...);
|
||||
|
||||
retro_log_printf_t log_cb = fallback_log;
|
||||
|
||||
int CROP_WIDTH;
|
||||
int CROP_HEIGHT;
|
||||
int VIRTUAL_WIDTH;
|
||||
@@ -31,6 +37,7 @@ int retrojoy_init=0,retro_ui_finalized=0;
|
||||
int retro_sound_finalized=0;
|
||||
|
||||
float retro_fps=49.8607597;
|
||||
long long retro_frame_counter;
|
||||
extern int ToggleTV;
|
||||
extern int CURRENT_TV;
|
||||
|
||||
@@ -58,7 +65,18 @@ static retro_video_refresh_t video_cb;
|
||||
static retro_audio_sample_t audio_cb;
|
||||
static retro_audio_sample_batch_t audio_batch_cb;
|
||||
static retro_environment_t environ_cb;
|
||||
retro_log_printf_t log_cb;
|
||||
|
||||
|
||||
static void fallback_log(enum retro_log_level level, const char *fmt, ...)
|
||||
{
|
||||
va_list va;
|
||||
|
||||
(void)level;
|
||||
|
||||
va_start(va, fmt);
|
||||
vfprintf(stderr, fmt, va);
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
void retro_set_environment(retro_environment_t cb)
|
||||
{
|
||||
@@ -359,11 +377,11 @@ static void update_variables(void)
|
||||
|
||||
static void retro_wrap_emulator()
|
||||
{
|
||||
LOGI("WRAP EMU THD\n");
|
||||
log_cb(RETRO_LOG_INFO, "WRAP EMU THD\n");
|
||||
pre_main(RPATH);
|
||||
|
||||
|
||||
LOGI("EXIT EMU THD\n");
|
||||
log_cb(RETRO_LOG_INFO, "EXIT EMU THD\n");
|
||||
pauseg=-1;
|
||||
|
||||
//environ_cb(RETRO_ENVIRONMENT_SHUTDOWN, 0);
|
||||
@@ -374,7 +392,7 @@ LOGI("EXIT EMU THD\n");
|
||||
// Dead emulator, but libco says not to return
|
||||
while(true)
|
||||
{
|
||||
LOGI("Running a dead emulator.");
|
||||
log_cb(RETRO_LOG_INFO, "Running a dead emulator.");
|
||||
co_switch(mainThread);
|
||||
}
|
||||
|
||||
@@ -407,7 +425,7 @@ void Emu_uninit(){
|
||||
|
||||
void retro_shutdown_core(void)
|
||||
{
|
||||
LOGI("SHUTDOWN\n");
|
||||
log_cb(RETRO_LOG_INFO, "SHUTDOWN\n");
|
||||
|
||||
texture_uninit();
|
||||
environ_cb(RETRO_ENVIRONMENT_SHUTDOWN, NULL);
|
||||
@@ -452,8 +470,6 @@ void retro_init(void)
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log))
|
||||
log_cb = log.log;
|
||||
else
|
||||
log_cb = NULL;
|
||||
|
||||
const char *system_dir = NULL;
|
||||
|
||||
@@ -489,9 +505,9 @@ void retro_init(void)
|
||||
|
||||
sprintf(retro_system_data_directory, "%s/data\0",RETRO_DIR);
|
||||
|
||||
LOGI("Retro SYSTEM_DIRECTORY %s\n",retro_system_directory);
|
||||
LOGI("Retro SAVE_DIRECTORY %s\n",retro_save_directory);
|
||||
LOGI("Retro CONTENT_DIRECTORY %s\n",retro_content_directory);
|
||||
log_cb(RETRO_LOG_INFO, "Retro SYSTEM_DIRECTORY %s\n",retro_system_directory);
|
||||
log_cb(RETRO_LOG_INFO, "Retro SAVE_DIRECTORY %s\n",retro_save_directory);
|
||||
log_cb(RETRO_LOG_INFO, "Retro CONTENT_DIRECTORY %s\n",retro_content_directory);
|
||||
|
||||
#ifndef RENDER16B
|
||||
enum retro_pixel_format fmt =RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
@@ -502,7 +518,7 @@ void retro_init(void)
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
{
|
||||
fprintf(stderr, "PIXEL FORMAT is not supported.\n");
|
||||
LOGI("PIXEL FORMAT is not supported.\n");
|
||||
log_cb(RETRO_LOG_INFO, "PIXEL FORMAT is not supported.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -539,17 +555,17 @@ void retro_deinit(void)
|
||||
|
||||
|
||||
co_switch(emuThread);
|
||||
LOGI("exit emu\n");
|
||||
log_cb(RETRO_LOG_INFO, "exit emu\n");
|
||||
// main_exit();
|
||||
co_switch(mainThread);
|
||||
LOGI("exit main\n");
|
||||
log_cb(RETRO_LOG_INFO, "exit main\n");
|
||||
if(emuThread)
|
||||
{
|
||||
co_delete(emuThread);
|
||||
emuThread = 0;
|
||||
}
|
||||
|
||||
LOGI("Retro DeInit\n");
|
||||
log_cb(RETRO_LOG_INFO, "Retro DeInit\n");
|
||||
}
|
||||
|
||||
unsigned retro_api_version(void)
|
||||
@@ -621,6 +637,8 @@ void retro_run(void)
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
|
||||
update_variables();
|
||||
|
||||
retro_frame_counter++;
|
||||
|
||||
if(pauseg==0){
|
||||
|
||||
if (ToggleTV == 1)
|
||||
|
||||
@@ -41,14 +41,6 @@ extern char Key_Sate2[512];
|
||||
|
||||
extern int pauseg;
|
||||
|
||||
#if defined(__ANDROID__) || defined(ANDROID)
|
||||
#include <android/log.h>
|
||||
#define LOG_TAG "RetroArch.Atari800"
|
||||
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
|
||||
#else
|
||||
#define LOGI printf
|
||||
#endif
|
||||
|
||||
#define NPLGN 12
|
||||
#define NLIGN 5
|
||||
#define NLETT 5
|
||||
|
||||
+4
-1
@@ -647,9 +647,12 @@ void PLATFORM_DisplayScreen(void)
|
||||
retro_Render();
|
||||
}
|
||||
|
||||
extern float retro_fps;
|
||||
extern long long retro_frame_counter;
|
||||
|
||||
double PLATFORM_Time(void)
|
||||
{
|
||||
return GetTicks()/1000 ;//* 1e-3;
|
||||
return retro_frame_counter * (1000.0 / retro_fps);
|
||||
}
|
||||
|
||||
void PLATFORM_PaletteUpdate(void)
|
||||
|
||||
Reference in New Issue
Block a user