mirror of
https://github.com/libretro/beetle-pce-fast-libretro.git
synced 2024-11-26 17:40:40 +00:00
Add first runtime option to Mednafen core - Mednafen PCE_Fast -
pce_nospritelimit
This commit is contained in:
parent
c42ea98f06
commit
c06d14969b
33
libretro.cpp
33
libretro.cpp
@ -314,6 +314,23 @@ bool retro_load_game_special(unsigned, const struct retro_game_info *, size_t)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void check_variables(void)
|
||||
{
|
||||
struct retro_variable var = {0};
|
||||
|
||||
#if defined(WANT_PCE_FAST_EMU)
|
||||
var.key = "pce_nospritelimit";
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var))
|
||||
{
|
||||
if (strcmp(var.value, "disabled") == 0)
|
||||
setting_pce_fast_nospritelimit = 0;
|
||||
else if (strcmp(var.value, "enabled") == 0)
|
||||
setting_pce_fast_nospritelimit = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *info)
|
||||
{
|
||||
if (failed_init)
|
||||
@ -356,6 +373,8 @@ bool retro_load_game(const struct retro_game_info *info)
|
||||
deint.ClearState();
|
||||
#endif
|
||||
|
||||
check_variables();
|
||||
|
||||
return game;
|
||||
}
|
||||
|
||||
@ -743,6 +762,7 @@ static void update_input(void)
|
||||
|
||||
static uint64_t video_frames, audio_frames;
|
||||
|
||||
|
||||
void retro_run()
|
||||
{
|
||||
MDFNGI *curgame = game;
|
||||
@ -872,6 +892,10 @@ void retro_run()
|
||||
audio_frames += spec.SoundBufSize;
|
||||
|
||||
audio_batch_cb(spec.SoundBuf, spec.SoundBufSize);
|
||||
|
||||
bool updated = false;
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
|
||||
check_variables();
|
||||
}
|
||||
|
||||
void retro_get_system_info(struct retro_system_info *info)
|
||||
@ -947,6 +971,15 @@ void retro_set_controller_port_device(unsigned in_port, unsigned device)
|
||||
void retro_set_environment(retro_environment_t cb)
|
||||
{
|
||||
environ_cb = cb;
|
||||
|
||||
#if defined(WANT_PCE_FAST_EMU)
|
||||
static const struct retro_variable vars[] = {
|
||||
{ "pce_nospritelimit", "No Sprite Limit; disabled|enabled" },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
|
||||
#endif
|
||||
}
|
||||
|
||||
void retro_set_audio_sample(retro_audio_sample_t cb)
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <string>
|
||||
#include "settings.h"
|
||||
|
||||
uint32_t setting_pce_fast_nospritelimit = 0;
|
||||
|
||||
bool MDFN_SaveSettings(const char *path)
|
||||
{
|
||||
return(1);
|
||||
@ -137,7 +139,7 @@ bool MDFN_GetSettingB(const char *name)
|
||||
if (!strcmp("pce_fast.forcesgx", name))
|
||||
return 0;
|
||||
if (!strcmp("pce_fast.nospritelimit", name))
|
||||
return 0;
|
||||
return setting_pce_fast_nospritelimit;
|
||||
if (!strcmp("pce_fast.forcemono", name))
|
||||
return 0;
|
||||
if (!strcmp("pce_fast.disable_softreset", name))
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
extern uint32_t setting_pce_fast_nospritelimit;
|
||||
|
||||
bool MDFN_LoadSettings(const char *path, const char *section = NULL, bool override = false);
|
||||
bool MDFN_MergeSettings(const void*);
|
||||
bool MDFN_MergeSettings(const std::vector<void> &);
|
||||
|
Loading…
Reference in New Issue
Block a user