libretro: aw coin fix. screen rotation. disable loading notifications

This commit is contained in:
Flyinghead 2021-07-07 09:48:10 +02:00
parent ef506d49aa
commit 8e6bbed74f
3 changed files with 68 additions and 56 deletions

View File

@ -170,12 +170,16 @@ void MapleConfigMap::GetMouseInput(u8& buttons, int& x, int& y, int& wheel)
bool maple_atomiswave_coin_chute(int slot)
{
#ifdef LIBRETRO
return kcode[slot] & AWAVE_COIN_KEY;
#else
for (int i = 0; i < 16; i++)
{
if ((kcode[slot] & (1 << i)) == 0 && awave_button_mapping[i] == AWAVE_COIN_KEY)
return true;
}
return false;
#endif
}
void mcfg_Create(MapleDeviceType type, u32 bus, u32 port, s32 player_num = -1)

View File

@ -145,6 +145,8 @@ static double vib_delta[4];
unsigned per_content_vmus = 0;
static bool first_run = true;
static bool mute_messages;
static bool rotate_screen;
static retro_perf_callback perf_cb;
static retro_get_cpu_features_t perf_get_cpu_features_cb;
@ -785,7 +787,7 @@ void retro_run()
dc_run(nullptr);
}
int width = config::RenderResolution * 4 / 3;
if (config::Widescreen && !config::Rotate90)
if (config::Widescreen && !rotate_screen)
width = width * 4 / 3;
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(HAVE_VULKAN)
video_cb(is_dupe ? 0 : RETRO_HW_FRAME_BUFFER_VALID, width, config::RenderResolution, 0);
@ -1266,7 +1268,7 @@ static void retro_vk_context_reset()
return;
}
int width = config::RenderResolution * 4 / 3;
if (config::Widescreen && !config::Rotate90)
if (config::Widescreen && !rotate_screen)
width = width * 4 / 3;
theVulkanContext.SetWindowSize(width, config::RenderResolution);
theVulkanContext.Init((retro_hw_render_interface_vulkan *)vulkan);
@ -1579,10 +1581,17 @@ bool retro_load_game(const struct retro_game_info *game)
snprintf(nvmem_file2, sizeof(nvmem_file2), "%s%s.nvmem2", save_dir, g_base_name);
}
mute_messages = true;
dc_start_game(boot_to_bios ? nullptr : game->path);
mute_messages = false;
int rotation = config::Rotate90 ? 3 : 0;
int rotation = config::Rotate90 ? 1 : 0;
environ_cb(RETRO_ENVIRONMENT_SET_ROTATION, &rotation);
rotate_screen = config::Rotate90;
config::Rotate90 = false; // actual framebuffer rotation is done by frontend
if (rotate_screen)
config::Widescreen.override(false);
if (devices_need_refresh)
refresh_devices(true);
@ -1756,15 +1765,13 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
else
info->geometry.aspect_ratio = 4.0 / 3.0;
}
if (config::Rotate90)
if (rotate_screen)
info->geometry.aspect_ratio = 1 / info->geometry.aspect_ratio;
int maximum = width > config::RenderResolution ? width : config::RenderResolution;
info->geometry.base_width = width;
info->geometry.base_height = config::RenderResolution;
info->geometry.max_width = maximum;
info->geometry.max_height = maximum;
if (config::Rotate90)
info->geometry.aspect_ratio = 1 / info->geometry.aspect_ratio;
switch (pixel_clock)
{
@ -2889,6 +2896,8 @@ static bool read_m3u(const char *file)
void gui_display_notification(const char *msg, int duration)
{
if (mute_messages)
return;
retro_message retromsg;
retromsg.msg = msg;
retromsg.frames = duration / 17;

View File

@ -20,13 +20,12 @@
class Settings {
public:
void reset() {
// for (const auto& o : options)
// o->reset();
// gameId.clear();
}
void reset() {}
void load(bool gameSpecific) {
void load(bool gameSpecific)
{
if (gameSpecific)
return;
for (const auto& o : options)
o->load();
}