Commit 9e559263 authored by Adrien Plazas's avatar Adrien Plazas Committed by Alexander Mikhaylenko
Browse files

flatpak: Use the BlastEm core from Libretro

It should be in a good enough shape to be used now.

Fixes https://gitlab.gnome.org/GNOME/gnome-games/-/issues/74
parent 394cda15
Pipeline #239071 passed with stage
in 27 minutes and 55 seconds
From dc3a2e8fc3f9d0ea47c7775b89ee167f58a80b13 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Sat, 12 Dec 2020 09:48:29 +0100
Subject: [PATCH] Give a saner default button layout
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This gives a saner default layout for 99% of games as nobody wants to
jump with the R button. This is also better for the vast majority of
6-buttons games like Streets of Rage 3 or Ranger X, with the notable
exception of Super Street Fighter II, but who emulates it on the Genesis
anyways‽
---
libblastem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libblastem.c b/libblastem.c
index fb5979a7..280e72ef 100644
--- a/libblastem.c
+++ b/libblastem.c
@@ -413,8 +413,8 @@ void process_events()
{
static int16_t prev_state[2][RETRO_DEVICE_ID_JOYPAD_L2];
static const uint8_t map[] = {
- BUTTON_A, BUTTON_X, BUTTON_MODE, BUTTON_START, DPAD_UP, DPAD_DOWN,
- DPAD_LEFT, DPAD_RIGHT, BUTTON_B, BUTTON_Y, BUTTON_Z, BUTTON_C
+ BUTTON_B, BUTTON_A, BUTTON_MODE, BUTTON_START, DPAD_UP, DPAD_DOWN,
+ DPAD_LEFT, DPAD_RIGHT, BUTTON_C, BUTTON_Y, BUTTON_X, BUTTON_Z
};
//TODO: handle other input device types
//TODO: handle more than 2 ports when appropriate
--
2.28.0
From 8fd95a881fed8ff28b359b4c4d895fe94e7ed707 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Sat, 12 Dec 2020 09:48:29 +0100
Subject: [PATCH] libretro: Correctly calculate the aspect ratio
This ensures the aspect ratio is correctly calculated at all time, for
W40 and W32, for NTSC and PAL, and with any overscan.
The calculation was wrong in render_framebuffer_updated().
---
libblastem.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/libblastem.c b/libblastem.c
index 819f2fad..29dc54c6 100644
--- a/libblastem.c
+++ b/libblastem.c
@@ -129,6 +129,13 @@ static void update_overscan(void)
}
}
+static float get_aspect_ratio(void)
+{
+ float aspect_width = LINEBUF_SIZE - overscan_left - overscan_right;
+ float aspect_height = (video_standard == VID_NTSC ? 243 : 294) - overscan_top - overscan_bot;
+ return aspect_width / aspect_height;
+}
+
static int32_t sample_rate;
RETRO_API void retro_get_system_av_info(struct retro_system_av_info *info)
{
@@ -138,7 +145,7 @@ RETRO_API void retro_get_system_av_info(struct retro_system_av_info *info)
info->geometry.base_height = (video_standard == VID_NTSC ? 243 : 294) - (overscan_top + overscan_bot);
last_height = info->geometry.base_height;
info->geometry.max_height = info->geometry.base_height * 2;
- info->geometry.aspect_ratio = 0;
+ info->geometry.aspect_ratio = get_aspect_ratio();
double master_clock = video_standard == VID_NTSC ? 53693175 : 53203395;
double lines = video_standard == VID_NTSC ? 262 : 313;
info->timing.fps = master_clock / (3420.0 * lines);
@@ -368,7 +375,7 @@ void render_framebuffer_updated(uint8_t which, int width)
struct retro_game_geometry geometry = {
.base_width = width,
.base_height = height,
- .aspect_ratio = (float)LINEBUF_SIZE / base_height
+ .aspect_ratio = get_aspect_ratio()
};
retro_environment(RETRO_ENVIRONMENT_SET_GEOMETRY, &geometry);
last_width = width;
--
2.28.0
......@@ -5,15 +5,13 @@
"arm"
],
"no-autogen": true,
"install-rule": "install_libretro",
"make-args": [
"prefix=/app",
"core_installdir=/app/lib/libretro",
"libblastem.so"
"--makefile=Makefile.libretro",
"prefix=/app"
],
"make-install-args": [
"prefix=/app",
"core_installdir=/app/lib/libretro"
"--makefile=Makefile.libretro",
"prefix=/app"
],
"post-install": [
"mkdir -p /app/lib/libretro/",
......@@ -22,8 +20,16 @@
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/aplazas/blastem.git",
"branch": "gnome-games"
"url": "https://github.com/libretro/blastem.git",
"branch": "libretro"
},
{
"type": "patch",
"path": "blastem-Give-a-saner-default-button-layout.patch"
},
{
"type": "patch",
"path": "blastem-libretro-Correctly-calculate-the-aspect-ratio.patch"
},
{
"type": "file",
......
......@@ -51,6 +51,7 @@
"shared-modules/lua5.3/lua-5.3.5.json",
"shared-modules/SDL/SDL-1.2.15.json",
"shared-modules/SDL/SDL_net-1.2.8.json",
"libretro-cores/libretro-blastem.json",
"libretro-cores/libretro-bsnes-mercury.json",
"libretro-cores/libretro-citra.json",
"libretro-cores/libretro-desmume2015.json",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment