* Add yabasanshiroSA, thanks in part to @shantigilbert, @CoreELEC, and @351ELEC.

This commit is contained in:
fewtarius 2022-03-13 16:41:31 -04:00
parent 18afd3933e
commit b59112ff1c
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
11 changed files with 392 additions and 1 deletions

View file

@ -50,7 +50,9 @@ makeinstall_target() {
--with-date_time \
--with-filesystem \
--with-iostreams \
--with-program_options \
--with-python \
--with-locale \
--with-random \
--with-regex -sICU_PATH="${SYSROOT_PREFIX}/usr" \
--with-serialization \

View file

@ -0,0 +1,46 @@
PKG_NAME="yabasanshiroSA"
PKG_VERSION="f6f41dd6485c638ab661f3acd2951c9522f34450"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/devmiyax/yabause"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain SDL2 boost openal-soft ${OPENGLES} zlib"
PKG_LONGDESC="Yabause is a Sega Saturn emulator and took over as Yaba Sanshiro"
PKG_TOOLCHAIN="cmake-make"
GET_HANDLER_SUPPORT="git"
PKG_GIT_CLONE_BRANCH="pi4"
PKG_BUILD_FLAGS="+speed"
post_unpack() {
# use host versions
sed -i "s|COMMAND m68kmake|COMMAND ${PKG_BUILD}/m68kmake_host|" ${PKG_BUILD}/yabause/src/musashi/CMakeLists.txt
sed -i "s|COMMAND ./bin2c|COMMAND ${PKG_BUILD}/bin2c_host|" ${PKG_BUILD}/yabause/src/retro_arena/nanogui-sdl/CMakeLists.txt
}
pre_make_target() {
# runs on host so make them manually if package is not crosscompile friendly
${HOST_CC} ${PKG_BUILD}/yabause/src/retro_arena/nanogui-sdl/resources/bin2c.c -o ${PKG_BUILD}/bin2c_host
${HOST_CC} ${PKG_BUILD}/yabause/src/musashi/m68kmake.c -o ${PKG_BUILD}/m68kmake_host
}
pre_configure_target() {
PKG_CMAKE_OPTS_TARGET="${PKG_BUILD}/yabause \
-DYAB_PORTS=retro_arena \
-DYAB_WANT_DYNAREC_DEVMIYAX=ON \
-DYAB_WANT_ARM7=ON \
-DCMAKE_TOOLCHAIN_FILE=${PKG_BUILD}/yabause/src/retro_arena/n2.cmake \
-DYAB_WANT_VULKAN=OFF \
-DOPENGL_INCLUDE_DIR=${SYSROOT_PREFIX}/usr/include \
-DOPENGL_opengl_LIBRARY=${SYSROOT_PREFIX}/usr/lib \
-DOPENGL_glx_LIBRARY=${SYSROOT_PREFIX}/usr/lib \
-DLIBPNG_LIB_DIR=${SYSROOT_PREFIX}/usr/lib \
-Dpng_STATIC_LIBRARIES=${SYSROOT_PREFIX}/usr/lib/libpng16.so \
-DCMAKE_BUILD_TYPE=Release"
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
cp -a ${PKG_BUILD}/src/retro_arena/yabasanshiro ${INSTALL}/usr/bin
cp -a ${PKG_DIR}/sources/* ${INSTALL}/usr/bin
}

View file

@ -0,0 +1,11 @@
--- a/yabause/src/threads.h 2022-01-05 15:41:03.685887385 -0600
+++ b/yabause/src/threads.h 2022-01-05 15:43:05.404177636 -0600
@@ -115,6 +115,8 @@
int YabCopyFile(const char * src, const char * dst);
int YabMakeCleanDir( const char * dirname );
+
+#include <core.h>
int YabNanosleep(u64 ns);
///////////////////////////////////////////////////////////////////////////

View file

@ -0,0 +1,11 @@
--- a/yabause/src/retro_arena/CMakeLists.txt 2022-01-05 15:44:20.891135756 -0600
+++ b/yabause/src/retro_arena/CMakeLists.txt 2022-01-05 15:44:41.738849860 -0600
@@ -22,7 +22,7 @@
add_subdirectory(nanogui-sdl)
#include( ../glfw/external_zlib.cmake )
-include( ${CMAKE_SOURCE_DIR}/CMake/Packages/external_libpng.cmake )
+#include( ${CMAKE_SOURCE_DIR}/CMake/Packages/external_libpng.cmake )
#------------------------------------------------------------------------------
# nlohmann/json

View file

@ -0,0 +1,20 @@
--- a/yabause/src/ygl.h
+++ b/yabause/src/ygl.h
@@ -50,7 +50,6 @@
#include <glsm/glsm.h>
#elif defined(__ANDROID__)
#include <GLES3/gl31.h>
- #include <GLES3/gl3ext.h>
#include <EGL/egl.h>
--- a/yabause/src/nanovg/nanovg_osdcore.c
+++ b/yabause/src/nanovg/nanovg_osdcore.c
@@ -36,7 +36,6 @@
#if defined(_OGLES3_)
#include <GLES3/gl3.h>
-#include <GLES3/gl3ext.h>
#else
#include "ygl.h"
#endif

View file

@ -0,0 +1,85 @@
--- a/yabause/src/retro_arena/main.cpp
+++ b/yabause/src/retro_arena/main.cpp
@@ -286,12 +286,12 @@
// Inisialize home directory
std::string home_dir = getenv("HOME");
- home_dir += "/.yabasanshiro/";
+ home_dir = "/storage/roms/saturn/yabasanshiro/";
struct stat st = {0};
if (stat(home_dir.c_str(), &st) == -1) {
mkdir(home_dir.c_str(), 0700);
}
- std::string bckup_dir = home_dir + "backup.bin";
+ std::string bckup_dir = "/storage/roms/bios/yabasanshiro/backup.bin";
strcpy( buppath, bckup_dir.c_str() );
strcpy( s_savepath, home_dir.c_str() );
g_keymap_filename = home_dir + "keymapv2.json";
@@ -597,7 +597,7 @@
if( ret == 0 ){
char pngname[256];
snprintf(pngname,256,"%s/%s_%d.png", s_savepath, cdip->itemnum, e.user.code);
- fs::copy(tmpfilename, pngname, fs::copy_options::overwrite_existing );
+ system((std::string("cp -f ") + tmpfilename + " " + pngname).c_str());
}
hideMenuScreen();
}
--- a/yabause/src/retro_arena/Preference.cpp
+++ b/yabause/src/retro_arena/Preference.cpp
@@ -17,7 +17,7 @@
}
std::string home_dir = getenv("HOME");
- home_dir += "/.yabasanshiro/";
+ home_dir = "/storage/roms/saturn/yabasanshiro/";
this->filename = home_dir + input_trace_filename + ".config";
--- a/yabause/src/retro_arena/InputManager.cpp
+++ b/yabause/src/retro_arena/InputManager.cpp
@@ -213,7 +213,7 @@
if( SDL_NumJoysticks() == 0 ){
- PADLOG("No joy stic is found force to keyboard\n");
+ PADLOG("No joystick is found force to keyboard\n");
padbits = PerPadAdd(&PORTDATA1);
if( configs.find("player1") == configs.end() ){
return setDefalutSettings(padbits);
@@ -460,22 +460,22 @@
}
Input result;
- inputconfig->getInputByName("a", &result);
+ inputconfig->getInputByName("y", &result);
player[guid]["a"] ={ { "type", input_types[result.type] },{ "id", result.id },{ "value", result.value } };
inputconfig->getInputByName("b", &result);
player[guid]["b"] = { { "type", input_types[result.type] },{ "id", result.id },{ "value", result.value } };
- inputconfig->getInputByName("rightshoulder", &result);
+ inputconfig->getInputByName("a", &result);
player[guid]["c"] = { { "type", input_types[result.type] },{ "id", result.id },{ "value", result.value } } ;
inputconfig->getInputByName("x", &result);
player[guid]["x"] = { { "type", input_types[result.type] },{ "id", result.id },{ "value", result.value } };
- inputconfig->getInputByName("y", &result);
+ inputconfig->getInputByName("leftshoulder", &result);
player[guid]["y"] = { { "type", input_types[result.type] },{ "id", result.id },{ "value", result.value } };
- inputconfig->getInputByName("leftshoulder", &result);
+ inputconfig->getInputByName("rightshoulder", &result);
player[guid]["z"] = { { "type", input_types[result.type] },{ "id", result.id },{ "value", result.value } };
inputconfig->getInputByName("lefttrigger", &result);
@@ -1209,7 +1209,7 @@
std::string InputManager::getConfigPath()
{
std::string path = getenv("HOME");
- path += "/.emulationstation/es_temporaryinput.cfg";
+ path = "/storage/roms/saturn/yabasanshiro/input.cfg";
return path;
}

View file

@ -0,0 +1,169 @@
diff --git a/yabause/src/retro_arena/MenuScreen.cpp b/yabause/src/retro_arena/MenuScreen.cpp
index 33591a44..ccbdc843 100644
--- a/yabause/src/retro_arena/MenuScreen.cpp
+++ b/yabause/src/retro_arena/MenuScreen.cpp
@@ -77,7 +77,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
swindow = nullptr;
imageWindow = nullptr;
- int image_pix_size_w = this->width() / 2;
+/* int image_pix_size_w = this->width() / 2;
int image_pix_size_h = this->height() / 2;
imageWindow = new Window(this, "About");
imageWindow->setPosition(Vector2i(0, 0));
@@ -92,7 +92,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
imageView->setFixedWidth(image_pix_size_w);
imageView->setFixedHeight(image_pix_size_h);
imageWindow->center();
- //imageWindow->setModal(true);
+ //imageWindow->setModal(true);*/
std::string title = "Yaba Sanshiro "+ std::string(YAB_VERSION) +" Menu";
window = new Window(this, title);
@@ -102,7 +102,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
tools = new Widget(window);
pushActiveMenu(tools, nullptr );
tools->setLayout(new BoxLayout(Orientation::Vertical,Alignment::Middle, 0, 5));
- tools->setFixedWidth(256);
+ tools->setFixedWidth(560);
PlayerConfig tmp;
tmp.player = new PopupButton(tools, "Player1", ENTYPO_ICON_EXPORT);
@@ -114,14 +114,14 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
PopupButton * ps_config = new PopupButton(tools, "Config");
- ps_config->setFixedWidth(248);
+ ps_config->setFixedWidth(530);
showConfigDialog(ps_config);
ps_config->setCallback([this,ps_config]() {
pushActiveMenu(ps_config->popup(),ps_config);
});
Button *b0 = new Button(tools, "Exit");
- b0->setFixedWidth(248);
+ b0->setFixedWidth(530);
b0->setCallback([this]() {
MENU_LOG("Exit\n");
SDL_Event* quit = new SDL_Event();
@@ -130,7 +130,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
});
Button *b1 = new Button(tools, "Reset");
- b1->setFixedWidth(248);
+ b1->setFixedWidth(530);
b1->setCallback([this]() {
MENU_LOG("Reset\n");
SDL_Event event = {};
@@ -142,14 +142,14 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
});
PopupButton * ps = new PopupButton(tools, "Save State");
- ps->setFixedWidth(248);
+ ps->setFixedWidth(530);
ps->setCallback([this,ps]() {
showSaveStateDialog( ps->popup());
pushActiveMenu(ps->popup(),ps);
});
ps = new PopupButton(tools, "Load State");
- ps->setFixedWidth(248);
+ ps->setFixedWidth(530);
ps->setCallback([this,ps]() {
showLoadStateDialog( ps->popup());
pushActiveMenu(ps->popup(),ps);
@@ -158,7 +158,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
bCdTray = new Button(tools, "Open CD Tray");
- bCdTray->setFixedWidth(248);
+ bCdTray->setFixedWidth(530);
bCdTray->setCallback([this]() {
if( this->is_cdtray_open_ ){
MENU_LOG("Close CD Tray\n");
@@ -194,7 +194,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
Button *b2 = new Button(tools, "Show/Hide FPS");
- b2->setFixedWidth(248);
+ b2->setFixedWidth(530);
b2->setCallback([this]() {
MENU_LOG("Show/Hide FPS\n");
SDL_Event event = {};
@@ -206,7 +206,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
});
Button *b3 = new Button(tools, "Enable/Disable Frame Skip");
- b3->setFixedWidth(248);
+ b3->setFixedWidth(530);
b3->setCallback([this]() {
MENU_LOG("Reset\n");
SDL_Event event = {};
@@ -218,7 +218,7 @@ MenuScreen::MenuScreen( SDL_Window* pwindow, int rwidth, int rheight, const std:
});
#if 0
Button *b4 = new Button(tools, "About");
- b4->setFixedWidth(248);
+ b4->setFixedWidth(530);
b4->setCallback([this,b4]() {
int image_pix_size_w = this->width() / 2;
int image_pix_size_h = this->height() / 2;
@@ -600,7 +600,7 @@ void MenuScreen::getSelectedGUID( int user_index, std::string & selguid ){
void MenuScreen::setupPlayerPsuhButton( int user_index, PopupButton *player, const std::string & label, ComboBox **cbo ){
- player->setFixedWidth(248);
+ player->setFixedWidth(530);
Popup *popup = player->popup();
popup->setLayout(new GroupLayout(4,2,2,2));
new Label(popup, label);
diff --git a/yabause/src/retro_arena/nanogui-sdl/src/theme.cpp b/yabause/src/retro_arena/nanogui-sdl/src/theme.cpp
index 3d126ad2..a6689df4 100644
--- a/yabause/src/retro_arena/nanogui-sdl/src/theme.cpp
+++ b/yabause/src/retro_arena/nanogui-sdl/src/theme.cpp
@@ -18,20 +18,20 @@
NAMESPACE_BEGIN(nanogui)
Theme::Theme(NVGcontext *ctx) {
- mStandardFontSize = 16;
- mButtonFontSize = 20;
- mTextBoxFontSize = 20;
- mWindowCornerRadius = 2;
- mWindowHeaderHeight = 30;
- mWindowDropShadowSize = 10;
- mButtonCornerRadius = 2;
+ mStandardFontSize = 32;
+ mButtonFontSize = 40;
+ mTextBoxFontSize = 40;
+ mWindowCornerRadius = 4;
+ mWindowHeaderHeight = 60;
+ mWindowDropShadowSize = 20;
+ mButtonCornerRadius = 4;
mTabBorderWidth = 0.75f;
- mTabInnerMargin = 5;
+ mTabInnerMargin = 10;
mTabMinButtonWidth = 20;
- mTabMaxButtonWidth = 160;
- mTabControlWidth = 20;
- mTabButtonHorizontalPadding = 10;
- mTabButtonVerticalPadding = 2;
+ mTabMaxButtonWidth = 500;
+ mTabControlWidth = 40;
+ mTabButtonHorizontalPadding = 20;
+ mTabButtonVerticalPadding = 4;
mDropShadow = Color(0, 128);
mTransparent = Color(0, 0);
diff --git a/yabause/src/retro_arena/nanogui-sdl/src/window.cpp b/yabause/src/retro_arena/nanogui-sdl/src/window.cpp
index cf3998c5..51e02022 100644
--- a/yabause/src/retro_arena/nanogui-sdl/src/window.cpp
+++ b/yabause/src/retro_arena/nanogui-sdl/src/window.cpp
@@ -119,7 +119,7 @@ void Window::draw(NVGcontext *ctx) {
nvgStrokeColor(ctx, mTheme->mWindowHeaderSepBot);
nvgStroke(ctx);
- nvgFontSize(ctx, 18.0f);
+ nvgFontSize(ctx, 40.0f);
nvgFontFace(ctx, "sans-bold");
nvgTextAlign(ctx, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);

View file

@ -0,0 +1,38 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021-present Shanti Gilbert (https://github.com/shantigilbert)
# Copyright (C) 2022-present Fewtarius
# Source predefined functions and variables
. /etc/profile
ROM_DIR="/storage/roms/saturn/yabasanshiro"
CONFIG_DIR="/storage/.config/game/configs/yabasanshiro"
SOURCE_DIR="/usr/config/game/configs/yabasanshiro"
if [ ! -d "${ROM_DIR}" ]
then
mkdir -p "${ROM_DIR}"
fi
ROMNAME=$(basename "${1}")
BIOS=""
if [ ! -e "${ROM_DIR}/${ROM_DIR}/input.cfg" ]
then
GAMEPAD=$(grep -b4 $(readlink ${DEVICE_CONTROLLER_DEV} | sed "s#^.*/##") /proc/bus/input/devices | awk 'BEGIN {FS="\""}; /Name/ {printf $2}')
GAMEPADCONFIG=$(xmlstarlet sel -t -c '//inputList/inputConfig[@deviceName="'${GAMEPAD}'"]' -n /storage/.emulationstation/es_input.cfg)
if [ ! -z "${GAMEPADCONFIG}" ]
then
cat <<EOF >${ROM_DIR}/input.cfg
<?xml version="1.0"?>
<inputList>
${GAMEPADCONFIG}
</inputList>
EOF
fi
fi
yabasanshiro -r 2 -i "${1}" -b /storage/roms/bios/saturn_bios.bin >/var/log/exec.log 2>&1 ||:

View file

@ -21,7 +21,7 @@ PKG_BASEOS="plymouth-lite grep wget libjpeg-turbo util-linux xmlstarlet bluetool
PKG_UI="emulationstation"
PKG_EMUS="common-shaders glsl-shaders libretro-database retroarch advancemame hatarisa openbor \
scummvmsa PPSSPPSDL"
scummvmsa PPSSPPSDL yabasanshiroSA"
LIBRETRO_CORES="2048 81 atari800 beetle-gba beetle-lynx beetle-ngp beetle-pce beetle-pcfx \
beetle-supafaust beetle-supergrafx beetle-vb beetle-wswan bluemsx cannonball cap32 \

View file

@ -320,6 +320,10 @@ then
jslisten set "mpv"
RUNTHIS='${TBASH} /usr/bin/mpv_video.sh "${ROMNAME}"'
;;
"saturn")
jslisten set "yabasanshiro"
RUNTHIS='${TBASH} yabasanshiro.sh "${ROMNAME}"'
;;
"shell")
RUNTHIS='${TBASH} "${ROMNAME}"'
;;

View file

@ -1595,6 +1595,11 @@
<platform>saturn</platform>
<theme>saturn</theme>
<emulators>
<emulator name="yabasanshiroSA">
<cores>
<core default="true">yabasanshiroSA</core>
</cores>
</emulator>
<emulator name="retroarch">
<cores>
<core default="true">yabasanshiro</core>