mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
PACKAGE/DEFCONFIG: create&add libretro-fake08
(#155)
* PACKAGE: add & create `libretro-fake08` pkg * PACKAGE: optimize `libretro-fake08` on uClibc (patch) - disable audio by default here
This commit is contained in:
4
board/miyoo/main/gmenu2x/sections/cores/zblank.fake08.ra
Normal file
4
board/miyoo/main/gmenu2x/sections/cores/zblank.fake08.ra
Normal file
@@ -0,0 +1,4 @@
|
||||
title=fake08
|
||||
description=fake08 libretro core
|
||||
exec=/mnt/emus/retroarch/fake08.sh
|
||||
selectordir=/mnt/roms/PICO8
|
@@ -203,6 +203,7 @@ BR2_PACKAGE_LIBRETRO_CAP32=y
|
||||
BR2_PACKAGE_LIBRETRO_CHAILOVE=y
|
||||
BR2_PACKAGE_LIBRETRO_DINOTHAWR=y
|
||||
BR2_PACKAGE_LIBRETRO_ECWOLF=y
|
||||
BR2_PACKAGE_LIBRETRO_FAKE08=y
|
||||
BR2_PACKAGE_LIBRETRO_FCEUMM=y
|
||||
BR2_PACKAGE_LIBRETRO_FMSX=y
|
||||
BR2_PACKAGE_LIBRETRO_FREECHAF=y
|
||||
|
@@ -181,6 +181,7 @@ BR2_PACKAGE_LIBRETRO_CAP32=y
|
||||
BR2_PACKAGE_LIBRETRO_CHAILOVE=y
|
||||
BR2_PACKAGE_LIBRETRO_DINOTHAWR=y
|
||||
BR2_PACKAGE_LIBRETRO_ECWOLF=y
|
||||
BR2_PACKAGE_LIBRETRO_FAKE08=y
|
||||
BR2_PACKAGE_LIBRETRO_FCEUMM=y
|
||||
BR2_PACKAGE_LIBRETRO_FMSX=y
|
||||
BR2_PACKAGE_LIBRETRO_FREECHAF=y
|
||||
|
@@ -24,6 +24,7 @@ source "package/miyoo/retroarch/libretro-cap32/Config.in"
|
||||
source "package/miyoo/retroarch/libretro-chailove/Config.in"
|
||||
source "package/miyoo/retroarch/libretro-dinothawr/Config.in"
|
||||
source "package/miyoo/retroarch/libretro-ecwolf/Config.in"
|
||||
source "package/miyoo/retroarch/libretro-fake08/Config.in"
|
||||
source "package/miyoo/retroarch/libretro-fceumm/Config.in"
|
||||
source "package/miyoo/retroarch/libretro-fmsx/Config.in"
|
||||
source "package/miyoo/retroarch/libretro-freechaf/Config.in"
|
||||
|
@@ -0,0 +1,87 @@
|
||||
From fb59413d4d6897ac47862a47e5cf8a9fb30df107 Mon Sep 17 00:00:00 2001
|
||||
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
|
||||
Date: Thu, 20 Feb 2025 22:52:10 +0100
|
||||
Subject: [PATCH] LIBRETRO: add `audio_play` option
|
||||
|
||||
---
|
||||
platform/libretro/libretro.cpp | 20 ++++++++++++++++++--
|
||||
platform/libretro/libretro_core_options.h | 11 +++++++++++
|
||||
2 files changed, 29 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/platform/libretro/libretro.cpp b/platform/libretro/libretro.cpp
|
||||
index 47fa867..daeb526 100644
|
||||
--- a/platform/libretro/libretro.cpp
|
||||
+++ b/platform/libretro/libretro.cpp
|
||||
@@ -35,6 +35,7 @@ static retro_log_printf_t log_cb;
|
||||
const size_t audioBufferSize = SAMPLESPERFRAME * NUM_BUFFERS;
|
||||
|
||||
int16_t audioBuffer[audioBufferSize];
|
||||
+int16_t audioBufferNULL[audioBufferSize];
|
||||
|
||||
const int PicoScreenWidth = 128;
|
||||
const int PicoScreenHeight = 128;
|
||||
@@ -45,6 +46,8 @@ static int crop_h_right = 0;
|
||||
static int crop_v_top = 0;
|
||||
static int crop_v_bottom = 0;
|
||||
|
||||
+static bool option_audio_fill_buffer = true;
|
||||
+
|
||||
const size_t screenBufferSize = PicoScreenWidth*PicoScreenHeight;
|
||||
uint16_t screenBuffer[screenBufferSize];
|
||||
|
||||
@@ -72,6 +75,15 @@ static void check_variables(bool startup)
|
||||
struct retro_variable var = {0};
|
||||
int video_updated = 0;
|
||||
|
||||
+ var.key = "audio_play";
|
||||
+ if (enviro_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
+ {
|
||||
+ if (!strcmp(var.value, "enabled"))
|
||||
+ option_audio_fill_buffer = true;
|
||||
+ else if (!strcmp(var.value, "disabled"))
|
||||
+ option_audio_fill_buffer = false;
|
||||
+ }
|
||||
+
|
||||
var.key = "fake08_video_scale";
|
||||
if (enviro_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
@@ -404,8 +416,12 @@ EXPORT void retro_run()
|
||||
kDown = currKDown;
|
||||
|
||||
if (frame % 2 == 0) {
|
||||
- _audio->FillAudioBuffer(&audioBuffer, 0, SAMPLESPERFRAME);
|
||||
- audio_batch_cb(audioBuffer, SAMPLESPERFRAME);
|
||||
+ if (option_audio_fill_buffer) {
|
||||
+ _audio->FillAudioBuffer(&audioBuffer, 0, SAMPLESPERFRAME);
|
||||
+ audio_batch_cb(audioBuffer, SAMPLESPERFRAME);
|
||||
+ } else {
|
||||
+ audio_batch_cb(audioBufferNULL, SAMPLESPERFRAME);
|
||||
+ }
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/platform/libretro/libretro_core_options.h b/platform/libretro/libretro_core_options.h
|
||||
index 02c3a1a..af05ffc 100644
|
||||
--- a/platform/libretro/libretro_core_options.h
|
||||
+++ b/platform/libretro/libretro_core_options.h
|
||||
@@ -49,6 +49,17 @@ extern "C" {
|
||||
* frontend language definition */
|
||||
|
||||
struct retro_core_option_definition option_defs_us[] = {
|
||||
+ {
|
||||
+ "audio_play",
|
||||
+ "Audio playback",
|
||||
+ "Enable or disable Audio playback for performance sake",
|
||||
+ {
|
||||
+ { "enabled", NULL },
|
||||
+ { "disabled", NULL },
|
||||
+ { NULL, NULL },
|
||||
+ },
|
||||
+ "enabled"
|
||||
+ },
|
||||
{
|
||||
"fake08_video_scale",
|
||||
"Video Scale",
|
||||
--
|
||||
2.45.2.windows.1
|
||||
|
@@ -0,0 +1,29 @@
|
||||
From 9573ce039aa2ea1a9eb730b5b9e215cc7c4a9955 Mon Sep 17 00:00:00 2001
|
||||
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
|
||||
Date: Sat, 22 Feb 2025 15:02:35 +0100
|
||||
Subject: [PATCH] LIBRETRO: disable audio on UCLIBC
|
||||
|
||||
FillAudioBuffer() is botched here
|
||||
---
|
||||
platform/libretro/libretro_core_options.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/platform/libretro/libretro_core_options.h b/platform/libretro/libretro_core_options.h
|
||||
index af05ffc..5399c6d 100644
|
||||
--- a/platform/libretro/libretro_core_options.h
|
||||
+++ b/platform/libretro/libretro_core_options.h
|
||||
@@ -58,7 +58,11 @@ struct retro_core_option_definition option_defs_us[] = {
|
||||
{ "disabled", NULL },
|
||||
{ NULL, NULL },
|
||||
},
|
||||
+#if !defined(__UCLIBC__)
|
||||
"enabled"
|
||||
+#else
|
||||
+ "disabled"
|
||||
+#endif
|
||||
},
|
||||
{
|
||||
"fake08_video_scale",
|
||||
--
|
||||
2.45.2.windows.1
|
||||
|
11
package/miyoo/retroarch/libretro-fake08/Config.in
Normal file
11
package/miyoo/retroarch/libretro-fake08/Config.in
Normal file
@@ -0,0 +1,11 @@
|
||||
config BR2_PACKAGE_LIBRETRO_FAKE08
|
||||
bool "libretro-fake08"
|
||||
depends on BR2_PACKAGE_RETROARCH
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
help
|
||||
A libretro PICO-8 emulator core.
|
||||
|
||||
https://github.com/jtothebell/fake-08
|
||||
|
||||
comment "LIBRETRO_FAKE08 needs a toolchain w/ C++"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP
|
@@ -0,0 +1,2 @@
|
||||
# Locally calculated
|
||||
sha256 659d2d522620317eaf57f7cf257c2f68e8bc7baf72654c7ed3887c77571a0572 libretro-fake08-0d26fd59103941e5f95e0ee665c6e0fb8c6b6f03-br1.tar.gz
|
28
package/miyoo/retroarch/libretro-fake08/libretro-fake08.mk
Normal file
28
package/miyoo/retroarch/libretro-fake08/libretro-fake08.mk
Normal file
@@ -0,0 +1,28 @@
|
||||
################################################################################
|
||||
#
|
||||
# Fake-08
|
||||
#
|
||||
################################################################################
|
||||
|
||||
#Commit version of Sep 3, 2024
|
||||
LIBRETRO_FAKE08_VERSION = 0d26fd59103941e5f95e0ee665c6e0fb8c6b6f03
|
||||
LIBRETRO_FAKE08_SITE = https://github.com/jtothebell/fake-08.git
|
||||
LIBRETRO_FAKE08_SITE_METHOD = git
|
||||
LIBRETRO_FAKE08_GIT_SUBMODULES = YES
|
||||
LIBRETRO_FAKE08_LICENSE = MIT
|
||||
LIBRETRO_FAKE08_LICENSE_FILES = LICENSE.MD
|
||||
|
||||
define LIBRETRO_FAKE08_BUILD_CMDS
|
||||
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS) -D_NEED_FULL_PATH_" \
|
||||
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS)" \
|
||||
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/platform/libretro -f Makefile platform="unix"
|
||||
endef
|
||||
|
||||
define LIBRETRO_FAKE08_INSTALL_TARGET_CMDS
|
||||
mkdir -p "${BINARIES_DIR}/retroarch/cores"
|
||||
$(INSTALL) -D $(@D)/platform/libretro/fake08_libretro.so \
|
||||
$(TARGET_DIR)/usr/lib/libretro/fake08_libretro.so
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
Reference in New Issue
Block a user