Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Adding Dolphin Gamecube support for the RG353P and RG503 #318

Merged
merged 3 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
148 changes: 148 additions & 0 deletions packages/games/emulators/dolphinsa/config/Dolphin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
[General]
LastFilename =
ShowLag = False
ShowFrameCount = False
ISOPaths = 1
RecursiveISOPaths = False
NANDRootPath =
WirelessMac =
[Interface]
ConfirmStop = True
UsePanicHandlers = True
OnScreenDisplayMessages = True
HideCursor = False
AutoHideCursor = False
MainWindowPosX = 403
MainWindowPosY = 148
MainWindowWidth = 800
MainWindowHeight = 600
Language = 0
ShowToolbar = True
ShowStatusbar = True
ShowLogWindow = False
ShowLogConfigWindow = False
ExtendedFPSInfo = False
ThemeName40 = Clean Blue
PauseOnFocusLost = False
[Display]
FullscreenResolution = Auto
Fullscreen = True
RenderToMain = False
RenderWindowXPos = -1
RenderWindowYPos = -1
RenderWindowWidth = 640
RenderWindowHeight = 480
RenderWindowAutoSize = False
KeepWindowOnTop = False
ProgressiveScan = False
PAL60 = True
DisableScreenSaver = True
ForceNTSCJ = False
[GameList]
ListDrives = False
ListWad = True
ListElfDol = True
ListWii = True
ListGC = True
ListJap = True
ListPal = True
ListUsa = True
ListAustralia = True
ListFrance = True
ListGermany = True
ListItaly = True
ListKorea = True
ListNetherlands = True
ListRussia = True
ListSpain = True
ListTaiwan = True
ListWorld = True
ListUnknown = True
ListSort = 3
ListSortSecondary = 0
ColorCompressed = True
ColumnPlatform = True
ColumnBanner = True
ColumnNotes = True
ColumnFileName = False
ColumnID = False
ColumnRegion = True
ColumnSize = True
ColumnState = True
[Core]
HLE_BS2 = False
TimingVariance = 40
CPUCore = 1
Fastmem = True
CPUThread = True
DSPHLE = True
SkipIdle = True
SyncOnSkipIdle = True
SyncGPU = False
SyncGpuMaxDistance = 200000
SyncGpuMinDistance = -200000
SyncGpuOverclock = 1.00000000
FPRF = False
AccurateNaNs = False
DefaultISO =
DVDRoot =
Apploader =
EnableCheats = True
SelectedLanguage = 0
OverrideGCLang = False
DPL2Decoder = False
Latency = 2
MemcardAPath =
MemcardBPath =
AgpCartAPath =
AgpCartBPath =
SlotA = 1
SlotB = 255
SerialPort1 = 255
BBA_MAC =
SIDevice0 = 6
AdapterRumble0 = True
SimulateKonga0 = False
SIDevice1 = 6
AdapterRumble1 = True
SimulateKonga1 = False
SIDevice2 = 0
AdapterRumble2 = True
SimulateKonga2 = False
SIDevice3 = 0
AdapterRumble3 = True
SimulateKonga3 = False
WiiSDCard = False
WiiKeyboard = False
WiimoteContinuousScanning = False
WiimoteEnableSpeaker = False
RunCompareServer = False
RunCompareClient = False
EmulationSpeed = 1.00000000
FrameSkip = 0x00000003
Overclock = 4.00000000
OverclockEnable = False
GFXBackend =
GPUDeterminismMode = auto
PerfMapDir =
[Movie]
PauseMovie = False
Author =
DumpFrames = False
DumpFramesSilent = False
ShowInputDisplay = False
[DSP]
EnableJIT = True
DumpAudio = False
DumpUCode = False
Backend = ALSA
Volume = 100
CaptureLog = False
[Input]
BackgroundInput = False
[FifoPlayer]
LoopReplay = True
[Analytics]
ID = 5082f0c30a7e422b1220107f69d6c108
Enabled = False
PermissionAsked = True
29 changes: 29 additions & 0 deletions packages/games/emulators/dolphinsa/config/GCPadNew.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[GCPad1]
Device = evdev/0/retrogame_joypad
Buttons/A = Button 0
Buttons/B = Button 1
Buttons/Start = Button 9
Buttons/X = Button 3
Buttons/Y = Button 2
Buttons/Z = Button 7
Buttons/Hotkey = Button 8
C-Stick/Dead Zone = 25.000000000000000
C-Stick/Down = Axis 3+
C-Stick/Left = Axis 2-
C-Stick/Modifier = Control_L
C-Stick/Modifier/Range = 50.000000000000000
C-Stick/Right = Axis 2+
C-Stick/Up = Axis 3-
D-Pad/Down = Button 14
D-Pad/Left = Button 15
D-Pad/Right = Button 16
D-Pad/Up = Button 13
Main Stick/Dead Zone = 25.000000000000000
Main Stick/Down = Axis 1+
Main Stick/Left = Axis 0-
Main Stick/Modifier = Shift_L
Main Stick/Modifier/Range = 50.000000000000000
Main Stick/Right = Axis 0+
Main Stick/Up = Axis 1-
Triggers/L = Button 4
Triggers/R = Button 5
55 changes: 55 additions & 0 deletions packages/games/emulators/dolphinsa/config/GFX.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[Hardware]
VSync = False
Adapter = 0
[Settings]
AspectRatio = 2
Crop = False
wideScreenHack = False
UseXFB = False
UseRealXFB = False
SafeTextureCacheColorSamples = 128
ShowFPS = False
LogRenderTimeToFile = False
OverlayStats = False
OverlayProjStats = False
DumpTextures = False
HiresTextures = False
ConvertHiresTextures = False
CacheHiresTextures = False
DumpEFBTarget = False
FreeLook = False
UseFFV1 = False
EnablePixelLighting = False
FastDepthCalc = True
MSAA = 1
SSAA = False
EFBScale = 2
TexFmtOverlayEnable = False
TexFmtOverlayCenter = False
Wireframe = False
DisableFog = False
EnableShaderDebugging = False
BorderlessFullscreen = False
SWZComploc = True
SWZFreeze = True
SWDumpObjects = False
SWDumpTevStages = False
SWDumpTevTexFetches = False
SWDrawStart = 0
SWDrawEnd = 100000
[Enhancements]
ForceFiltering = False
MaxAnisotropy = 0
PostProcessingShader =
[Stereoscopy]
StereoMode = 0
StereoDepth = 20
StereoConvergencePercentage = 100
StereoSwapEyes = False
[Hacks]
EFBAccessEnable = False
BBoxEnable = False
ForceProgressive = True
EFBToTextureEnable = True
EFBScaledCopy = False
EFBEmulateFormatChanges = False
37 changes: 37 additions & 0 deletions packages/games/emulators/dolphinsa/package.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)

PKG_NAME="dolphinsa"
PKG_VERSION="0b160db48796f727311cea16072174d96b784f80"
PKG_GIT_CLONE_BRANCH="egldrm"
PKG_ARCH="aarch64"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/rtissera/dolphin"
PKG_URL="$PKG_SITE.git"
PKG_DEPENDS_TARGET="toolchain libevdev libdrm ffmpeg zlib libpng lzo libusb"
PKG_LONGDESC="Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements. "

PKG_CMAKE_OPTS_TARGET=" -DENABLE_HEADLESS=ON \
-DENABLE_EGL=ON \
-DENABLE_EVDEV=ON \
-DLINUX_LOCAL_DEV=ON \
-DOpenGL_GL_PREFERENCE=GLVND \
-DENABLE_TESTS=OFF \
-DENABLE_LLVM=OFF \
-DENABLE_ANALYTICS=OFF \
-DENABLE_X11=OFF \
-DENABLE_LTO=ON \
-DENABLE_QT=OFF \
-DENCODE_FRAMEDUMPS=OFF"

makeinstall_target() {
mkdir -p $INSTALL/usr/bin
cp -rf $PKG_BUILD/.${TARGET_NAME}/Binaries/dolphin* $INSTALL/usr/bin
cp -rf $PKG_DIR/scripts/* $INSTALL/usr/bin

chmod +x ${INSTALL}/usr/bin/dolphin.sh

mkdir -p $INSTALL/usr/config/dolphin-emu
cp -rf $PKG_BUILD/Data/Sys/* $INSTALL/usr/config/dolphin-emu
cp -rf $PKG_DIR/config/* $INSTALL/usr/config/dolphin-emu
}
118 changes: 118 additions & 0 deletions packages/games/emulators/dolphinsa/patches/000-hotkeys.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
diff --git a/Source/Core/Core/HW/GCPadEmu.cpp b/Source/Core/Core/HW/GCPadEmu.cpp
index c8e7016..fb089c4 100644
--- a/Source/Core/Core/HW/GCPadEmu.cpp
+++ b/Source/Core/Core/HW/GCPadEmu.cpp
@@ -26,6 +26,7 @@ static const u16 button_bitmasks[] = {
PAD_BUTTON_Y,
PAD_TRIGGER_Z,
PAD_BUTTON_START,
+ PAD_BUTTON_HOTKEY,
0 // MIC HAX
};

@@ -37,7 +38,7 @@ static const u16 trigger_bitmasks[] = {
static const u16 dpad_bitmasks[] = {PAD_BUTTON_UP, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT,
PAD_BUTTON_RIGHT};

-static const char* const named_buttons[] = {"A", "B", "X", "Y", "Z", "Start"};
+static const char* const named_buttons[] = {"A", "B", "X", "Y", "Z", "Start", "Hotkey"};

static const char* const named_triggers[] = {
// i18n: The left trigger button (labeled L on real controllers)
diff --git a/Source/Core/DolphinNoGUI/PlatformDRM.cpp b/Source/Core/DolphinNoGUI/PlatformDRM.cpp
index b210cea..77d4e86 100644
--- a/Source/Core/DolphinNoGUI/PlatformDRM.cpp
+++ b/Source/Core/DolphinNoGUI/PlatformDRM.cpp
@@ -11,6 +11,12 @@
#include "Core/Core.h"
#include "Core/State.h"

+#include "Core/HW/GCPad.h"
+#include "InputCommon/GCPadStatus.h"
+#include <fmt/format.h>
+#include "Core/Config/GraphicsSettings.h"
+#include "VideoCommon/VideoConfig.h"
+
#include <climits>
#include <cstdio>

@@ -54,9 +60,67 @@ void PlatformDRM::MainLoop()
{
while (IsRunning())
{
+ static int hotkey = 0;
+ static int slot = 0;
+ static int stereo = 0;
+
UpdateRunningFlag();
Core::HostDispatchJobs();

+ if(Pad::IsInitialized()) {
+ GCPadStatus x = Pad::GetStatus(0);
+
+ if( (x.button & PAD_BUTTON_HOTKEY) == PAD_BUTTON_HOTKEY) { // hotkey pressed
+ if(hotkey == 1) {
+ hotkey = 2;
+ }
+ } else {
+ hotkey = 1; // assure hotkey is released between actions
+ }
+
+ if(hotkey == 2) { // hotkey pressed
+ if( (x.button & PAD_BUTTON_START) == PAD_BUTTON_START) {
+ RequestShutdown();
+ hotkey = 0;
+ }
+
+ if( (x.button & PAD_TRIGGER_L) == PAD_TRIGGER_L) {
+ State::Load(slot);
+ hotkey = 0;
+ }
+ if( (x.button & PAD_TRIGGER_R) == PAD_TRIGGER_R) {
+ State::Save(slot);
+ hotkey = 0;
+ }
+ if( (x.button & PAD_BUTTON_DOWN) == PAD_BUTTON_DOWN) {
+ if(slot > 0) slot--;
+ Core::DisplayMessage(fmt::format("Slot {} selected", slot), 4000);
+ hotkey = 0;
+ }
+ if( (x.button & PAD_BUTTON_UP) == PAD_BUTTON_UP) {
+ if(slot < 10) slot++;
+ Core::DisplayMessage(fmt::format("Slot {} selected", slot), 4000);
+ hotkey = 0;
+ }
+ if( (x.button & PAD_BUTTON_Y) == PAD_BUTTON_Y) {
+ Core::SaveScreenShot();
+ hotkey = 0;
+ }
+ if( (x.button & PAD_BUTTON_X) == PAD_BUTTON_X) {
+ if(stereo == 0) {
+ Config::SetCurrent(Config::GFX_STEREO_MODE, StereoMode::SBS);
+ stereo = 1;
+ } else {
+ Config::SetCurrent(Config::GFX_STEREO_MODE, StereoMode::Off);
+ stereo = 0;
+ }
+ hotkey = 0;
+ }
+ }
+
+ }
+ //
+
// TODO: Is this sleep appropriate?
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
diff --git a/Source/Core/InputCommon/GCPadStatus.h b/Source/Core/InputCommon/GCPadStatus.h
index 7da1bbd..57d294d 100644
--- a/Source/Core/InputCommon/GCPadStatus.h
+++ b/Source/Core/InputCommon/GCPadStatus.h
@@ -27,6 +27,7 @@ enum PadButton
PAD_BUTTON_X = 0x0400,
PAD_BUTTON_Y = 0x0800,
PAD_BUTTON_START = 0x1000,
+ PAD_BUTTON_HOTKEY = 0x2000,
};

struct GCPadStatus