mirror of https://github.com/snes9xgit/snes9x.git
Merge commit 'a47d93f86ae8613095a6bfe2676d3be80bfdc7bc'
This commit is contained in:
commit
210645634c
|
@ -619,6 +619,9 @@ void S9xAPUSaveState (uint8 *block)
|
||||||
SNES::set_le32(ptr, SNES::dsp.clock);
|
SNES::set_le32(ptr, SNES::dsp.clock);
|
||||||
ptr += sizeof(int32);
|
ptr += sizeof(int32);
|
||||||
memcpy (ptr, SNES::cpu.registers, 4);
|
memcpy (ptr, SNES::cpu.registers, 4);
|
||||||
|
ptr += sizeof(int32);
|
||||||
|
|
||||||
|
memset (ptr, 0, SPC_SAVE_STATE_BLOCK_SIZE-(ptr-block));
|
||||||
}
|
}
|
||||||
|
|
||||||
void S9xAPULoadState (uint8 *block)
|
void S9xAPULoadState (uint8 *block)
|
||||||
|
|
|
@ -1754,12 +1754,12 @@ static void OpC8Slow (void)
|
||||||
|
|
||||||
if (CheckIndex())
|
if (CheckIndex())
|
||||||
{
|
{
|
||||||
Registers.YL--;
|
Registers.YL++;
|
||||||
SetZN(Registers.YL);
|
SetZN(Registers.YL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Registers.Y.W--;
|
Registers.Y.W++;
|
||||||
SetZN(Registers.Y.W);
|
SetZN(Registers.Y.W);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ ifeq ($(platform), unix)
|
||||||
SHARED := -shared -Wl,--version-script=link.T
|
SHARED := -shared -Wl,--version-script=link.T
|
||||||
else ifeq ($(platform), osx)
|
else ifeq ($(platform), osx)
|
||||||
TARGET := $(TARGET_NAME)_libretro.dylib
|
TARGET := $(TARGET_NAME)_libretro.dylib
|
||||||
fpic := -fPIC
|
fpic := -fPIC -mmacosx-version-min=10.6
|
||||||
SHARED := -dynamiclib
|
SHARED := -dynamiclib
|
||||||
else ifeq ($(platform), ios)
|
else ifeq ($(platform), ios)
|
||||||
TARGET := $(TARGET_NAME)_libretro_ios.dylib
|
TARGET := $(TARGET_NAME)_libretro_ios.dylib
|
||||||
|
|
|
@ -168,11 +168,6 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
|
||||||
info->timing.fps = retro_get_region() == RETRO_REGION_NTSC ? 21477272.0 / 357366.0 : 21281370.0 / 425568.0;
|
info->timing.fps = retro_get_region() == RETRO_REGION_NTSC ? 21477272.0 / 357366.0 : 21281370.0 / 425568.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *retro_library_id()
|
|
||||||
{
|
|
||||||
return "SNES9x v" VERSION;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned retro_api_version()
|
unsigned retro_api_version()
|
||||||
{
|
{
|
||||||
return RETRO_API_VERSION;
|
return RETRO_API_VERSION;
|
||||||
|
@ -627,11 +622,6 @@ void* retro_get_memory_data(unsigned type)
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void retro_unload_cartridge()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t retro_get_memory_size(unsigned type)
|
size_t retro_get_memory_size(unsigned type)
|
||||||
{
|
{
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
|
@ -564,6 +564,10 @@ enum retro_mod
|
||||||
// as certain platforms cannot use use stderr for logging. It also allows the frontend to
|
// as certain platforms cannot use use stderr for logging. It also allows the frontend to
|
||||||
// show logging information in a more suitable way.
|
// show logging information in a more suitable way.
|
||||||
// If this interface is not used, libretro cores should log to stderr as desired.
|
// If this interface is not used, libretro cores should log to stderr as desired.
|
||||||
|
#define RETRO_ENVIRONMENT_GET_PERF_INTERFACE 28
|
||||||
|
// struct retro_perf_callback * --
|
||||||
|
// Gets an interface for performance counters. This is useful for performance logging in a
|
||||||
|
// cross-platform way and for detecting architecture-specific features, such as SIMD support.
|
||||||
|
|
||||||
enum retro_log_level
|
enum retro_log_level
|
||||||
{
|
{
|
||||||
|
@ -583,6 +587,92 @@ struct retro_log_callback
|
||||||
retro_log_printf_t log;
|
retro_log_printf_t log;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Performance related functions
|
||||||
|
//
|
||||||
|
// ID values for SIMD CPU features
|
||||||
|
#define RETRO_SIMD_SSE (1 << 0)
|
||||||
|
#define RETRO_SIMD_SSE2 (1 << 1)
|
||||||
|
#define RETRO_SIMD_VMX (1 << 2)
|
||||||
|
#define RETRO_SIMD_VMX128 (1 << 3)
|
||||||
|
#define RETRO_SIMD_AVX (1 << 4)
|
||||||
|
#define RETRO_SIMD_NEON (1 << 5)
|
||||||
|
#define RETRO_SIMD_SSE3 (1 << 6)
|
||||||
|
#define RETRO_SIMD_SSSE3 (1 << 7)
|
||||||
|
|
||||||
|
typedef uint64_t retro_perf_tick_t;
|
||||||
|
typedef int64_t retro_time_t;
|
||||||
|
|
||||||
|
struct retro_perf_counter
|
||||||
|
{
|
||||||
|
const char *ident;
|
||||||
|
retro_perf_tick_t start;
|
||||||
|
retro_perf_tick_t total;
|
||||||
|
retro_perf_tick_t call_cnt;
|
||||||
|
|
||||||
|
bool registered;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns current time in microseconds. Tries to use the most accurate timer available.
|
||||||
|
typedef retro_time_t (*retro_perf_get_time_usec_t)(void);
|
||||||
|
// A simple counter. Usually nanoseconds, but can also be CPU cycles.
|
||||||
|
// Can be used directly if desired (when creating a more sophisticated performance counter system).
|
||||||
|
typedef retro_perf_tick_t (*retro_perf_get_counter_t)(void);
|
||||||
|
// Returns a bit-mask of detected CPU features (RETRO_SIMD_*).
|
||||||
|
typedef uint64_t (*retro_get_cpu_features_t)(void);
|
||||||
|
// Asks frontend to log and/or display the state of performance counters.
|
||||||
|
// Performance counters can always be poked into manually as well.
|
||||||
|
typedef void (*retro_perf_log_t)(void);
|
||||||
|
// Register a performance counter.
|
||||||
|
// ident field must be set with a discrete value and other values in retro_perf_counter must be 0.
|
||||||
|
// Registering can be called multiple times. To avoid calling to frontend redundantly, you can check registered field first.
|
||||||
|
typedef void (*retro_perf_register_t)(struct retro_perf_counter *counter);
|
||||||
|
// Starts and stops a registered counter.
|
||||||
|
typedef void (*retro_perf_start_t)(struct retro_perf_counter *counter);
|
||||||
|
typedef void (*retro_perf_stop_t)(struct retro_perf_counter *counter);
|
||||||
|
|
||||||
|
// For convenience it can be useful to wrap register, start and stop in macros.
|
||||||
|
// E.g.:
|
||||||
|
// #ifdef LOG_PERFORMANCE
|
||||||
|
// #define RETRO_PERFORMANCE_INIT(perf_cb, name) static struct retro_perf_counter name = {#name}; if (!name.registered) perf_cb.perf_register(&(name))
|
||||||
|
// #define RETRO_PERFORMANCE_START(perf_cb, name) perf_cb.perf_start(&(name))
|
||||||
|
// #define RETRO_PERFORMANCE_STOP(perf_cb, name) perf_cb.perf_stop(&(name))
|
||||||
|
// #else
|
||||||
|
// ... Blank macros ...
|
||||||
|
// #endif
|
||||||
|
// These can then be used mid-functions around code snippets.
|
||||||
|
//
|
||||||
|
// extern struct retro_perf_callback perf_cb; // Somewhere in the core.
|
||||||
|
//
|
||||||
|
// void do_some_heavy_work(void)
|
||||||
|
// {
|
||||||
|
// RETRO_PERFORMANCE_INIT(cb, work_1);
|
||||||
|
// RETRO_PERFORMANCE_START(cb, work_1);
|
||||||
|
// heavy_work_1();
|
||||||
|
// RETRO_PERFORMANCE_STOP(cb, work_1);
|
||||||
|
//
|
||||||
|
// RETRO_PERFORMANCE_INIT(cb, work_2);
|
||||||
|
// RETRO_PERFORMANCE_START(cb, work_2);
|
||||||
|
// heavy_work_2();
|
||||||
|
// RETRO_PERFORMANCE_STOP(cb, work_2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void retro_deinit(void)
|
||||||
|
// {
|
||||||
|
// perf_cb.perf_log(); // Log all perf counters here for example.
|
||||||
|
// }
|
||||||
|
|
||||||
|
struct retro_perf_callback
|
||||||
|
{
|
||||||
|
retro_perf_get_time_usec_t get_time_usec;
|
||||||
|
retro_get_cpu_features_t get_cpu_features;
|
||||||
|
|
||||||
|
retro_perf_get_counter_t get_perf_counter;
|
||||||
|
retro_perf_register_t perf_register;
|
||||||
|
retro_perf_start_t perf_start;
|
||||||
|
retro_perf_stop_t perf_stop;
|
||||||
|
retro_perf_log_t perf_log;
|
||||||
|
};
|
||||||
|
|
||||||
// FIXME: Document the sensor API and work out behavior.
|
// FIXME: Document the sensor API and work out behavior.
|
||||||
// It will be marked as experimental until then.
|
// It will be marked as experimental until then.
|
||||||
enum retro_sensor_action
|
enum retro_sensor_action
|
||||||
|
|
Loading…
Reference in New Issue