Restore DolphinSA Legacy

This commit is contained in:
mason 2023-02-17 03:52:24 +00:00
parent 78b1d4eef5
commit 78807e20ec
No known key found for this signature in database
GPG key ID: 84D9278A11FA112B
13 changed files with 669 additions and 8 deletions

View file

@ -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 = 4
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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,27 @@
[Wiimote1]
Device = evdev/0/retrogame_joypad
Extension = Classic
Source = 1
Classic/Buttons/A = Button 1
Classic/Buttons/B = Button 0
Classic/Buttons/X = Button 2
Classic/Buttons/Y = Button 3
Classic/Buttons/ZL = Button 6
Classic/Buttons/ZR = Button 7
Classic/Buttons/- = Button 8
Classic/Buttons/+ = Button 9
Classic/Left Stick/Up = Axis 1-
Classic/Left Stick/Down = Axis 1+
Classic/Left Stick/Left = Axis 0-
Classic/Left Stick/Right = Axis 0+
Classic/Right Stick/Up = Axis 3-
Classic/Right Stick/Down = Axis 3+
Classic/Right Stick/Left = Axis 2-
Classic/Right Stick/Right = Axis 2+
Classic/Triggers/L = Button 4
Classic/Triggers/R = Button 5
Classic/D-Pad/Up = Button 13
Classic/D-Pad/Down = Button 14
Classic/D-Pad/Left = Button 15
Classic/D-Pad/Right = Button 16

View file

@ -0,0 +1,25 @@
[Wiimote1]
Device = evdev/0/retrogame_joypad
Extension = Nunchuk
Buttons/A = Button 0
Buttons/B = Button 1
Buttons/1 = Button 3
Buttons/2 = Button 2
Buttons/- = Button 8
Buttons/+ = Button 9
D-Pad/Up = Button 13
D-Pad/Down = Button 14
D-Pad/Left = Button 15
D-Pad/Right = Button 16
Shake/X = Button 6
Shake/Y = Button 6
Shake/Z = Button 6
Nunchuk/Buttons/C = Button 5
Nunchuk/Buttons/Z = Button 4
Nunchuk/Stick/Up = Axis 1-
Nunchuk/Stick/Down = Axis 1+
Nunchuk/Stick/Left = Axis 0-
Nunchuk/Stick/Right = Axis 0+
Nunchuk/Shake/X = Button 7
Nunchuk/Shake/Y = Button 7
Nunchuk/Shake/Z = Button 7

View file

@ -0,0 +1,15 @@
[Wiimote1]
Device = evdev/0/retrogame_joypad
Buttons/A = Button 0
Buttons/B = Button 1
Buttons/1 = Button 3
Buttons/2 = Button 2
Buttons/- = Button 8
Buttons/+ = Button 9
D-Pad/Up = Button 13
D-Pad/Down = Button 14
D-Pad/Left = Button 15
D-Pad/Right = Button 16
Shake/X = Button 4
Shake/Y = Button 4
Shake/Z = Button 4

39
packages/games/emulators/dolphinsa/package.mk Executable file → Normal file
View file

@ -2,21 +2,35 @@
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)
PKG_NAME="dolphinsa"
PKG_VERSION="4d164fcb77487b0cb732e0423961fd042c3e7e3b"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/dolphin-emu/dolphin"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain libevdev libdrm ffmpeg zlib libpng lzo libusb zstd ecm"
PKG_LONGDESC="Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements. "
PKG_TOOLCHAIN="cmake"
PKG_PATCH_DIRS+="wayland"
case ${DEVICE} in
RK3588|handheld)
PKG_SITE="https://github.com/dolphin-emu/dolphin"
PKG_URL="${PKG_SITE}.git"
PKG_VERSION="4d164fcb77487b0cb732e0423961fd042c3e7e3b"
PKG_PATCH_DIRS+=" wayland"
;;
*)
PKG_SITE="https://github.com/rtissera/dolphin"
PKG_URL="${PKG_SITE}.git"
PKG_VERSION="0b160db48796f727311cea16072174d96b784f80"
PKG_GIT_CLONE_BRANCH="egldrm"
PKG_PATCH_DIRS+=" legacy"
;;
esac
if [ ! "${OPENGL}" = "no" ]; then
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_EGL=ON"
fi
if [ "${OPENGLES_SUPPORT}" = yes ]; then
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_EGL=ON"
fi
if [ "${DISPLAYSERVER}" = "wl" ]; then
@ -43,7 +57,7 @@ PKG_CMAKE_OPTS_TARGET+=" -DENABLE_HEADLESS=ON \
-DENABLE_QT=OFF \
-DENCODE_FRAMEDUMPS=OFF \
-DENABLE_CLI_TOOL=OFF \
-DENABLE_X11=OFF"
-DENABLE_X11=OFF"
makeinstall_target() {
@ -58,3 +72,18 @@ makeinstall_target() {
cp -rf ${PKG_BUILD}/Data/Sys/* ${INSTALL}/usr/config/dolphin-emu
cp -rf ${PKG_DIR}/config/${DEVICE}/* ${INSTALL}/usr/config/dolphin-emu
}
post_install() {
case ${DEVICE} in
RK3566)
DOLPHIN_PLATFORM="drm"
;;
*)
DOLPHIN_PLATFORM="wayland"
;;
esac
sed -e "s/@DOLPHIN_PLATFORM@/${DOLPHIN_PLATFORM}/g" \
-i ${INSTALL}/usr/bin/start_dolphin_gc.sh
sed -e "s/@DOLPHIN_PLATFORM@/${DOLPHIN_PLATFORM}/g" \
-i ${INSTALL}/usr/bin/start_dolphin_wii.sh
}

View file

@ -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

View file

@ -0,0 +1,12 @@
diff --git a/CMake/FindLibevdev.cmake b/CMake/FindLibevdev.cmake
index e89a5f229d..a7c73e0536 100644
--- a/CMake/FindLibevdev.cmake
+++ b/CMake/FindLibevdev.cmake
@@ -12,6 +12,7 @@ FIND_PATH(
HINTS ${PC_LIBEVDEV_INCLUDEDIR} ${PC_LIBEVDEV_INCLUDE_DIRS}
/usr/include
/usr/local/include
+ /usr/include/libevdev-1.0
${LIBEVDEV_PATH_INCLUDES}
)

View file

@ -0,0 +1,203 @@
diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp
index 2211d0d5fb..29004787e4 100644
--- a/Source/Core/Common/Config/Config.cpp
+++ b/Source/Core/Common/Config/Config.cpp
@@ -5,6 +5,7 @@
#include <algorithm>
#include <list>
#include <map>
+#include <mutex>
#include <shared_mutex>
#include "Common/Config/Config.h"
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp
index dc775ef607..0802a06039 100644
--- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp
+++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp
@@ -133,13 +133,13 @@ const OpArg& Arm64GPRCache::GetGuestGPROpArg(size_t preg) const
Arm64GPRCache::GuestRegInfo Arm64GPRCache::GetGuestGPR(size_t preg)
{
ASSERT(preg < GUEST_GPR_COUNT);
- return {32, PPCSTATE_OFF(gpr[preg]), m_guest_registers[GUEST_GPR_OFFSET + preg]};
+ return {32, PPCSTATE_OFF_GPR(preg), m_guest_registers[GUEST_GPR_OFFSET + preg]};
}
Arm64GPRCache::GuestRegInfo Arm64GPRCache::GetGuestCR(size_t preg)
{
ASSERT(preg < GUEST_CR_COUNT);
- return {64, PPCSTATE_OFF(cr.fields[preg]), m_guest_registers[GUEST_CR_OFFSET + preg]};
+ return {64, PPCSTATE_OFF_CR(preg), m_guest_registers[GUEST_CR_OFFSET + preg]};
}
Arm64GPRCache::GuestRegInfo Arm64GPRCache::GetGuestByIndex(size_t index)
@@ -450,8 +450,9 @@ ARM64Reg Arm64FPRCache::R(size_t preg, RegType type)
{
// Load the high 64bits from the file and insert them in to the high 64bits of the host
// register
- ARM64Reg tmp_reg = GetReg();
- m_float_emit->LDR(64, INDEX_UNSIGNED, tmp_reg, PPC_REG, u32(PPCSTATE_OFF(ps[preg].ps1)));
+ const ARM64Reg tmp_reg = GetReg();
+ m_float_emit->LDR(64, INDEX_UNSIGNED, tmp_reg, PPC_REG,
+ static_cast<s32>(PPCSTATE_OFF_PS1(preg)));
m_float_emit->INS(64, host_reg, 1, tmp_reg, 0);
UnlockRegister(tmp_reg);
@@ -505,7 +506,7 @@ ARM64Reg Arm64FPRCache::R(size_t preg, RegType type)
}
reg.SetDirty(false);
m_float_emit->LDR(load_size, INDEX_UNSIGNED, host_reg, PPC_REG,
- u32(PPCSTATE_OFF(ps[preg].ps0)));
+ static_cast<s32>(PPCSTATE_OFF_PS0(preg)));
return host_reg;
}
default:
@@ -553,7 +554,8 @@ ARM64Reg Arm64FPRCache::RW(size_t preg, RegType type)
// We are doing a full 128bit store because it takes 2 cycles on a Cortex-A57 to do a 128bit
// store.
// It would take longer to do an insert to a temporary and a 64bit store than to just do this.
- m_float_emit->STR(128, INDEX_UNSIGNED, flush_reg, PPC_REG, u32(PPCSTATE_OFF(ps[preg].ps0)));
+ m_float_emit->STR(128, INDEX_UNSIGNED, flush_reg, PPC_REG,
+ static_cast<s32>(PPCSTATE_OFF_PS0(preg)));
break;
case REG_DUP_SINGLE:
flush_reg = GetReg();
@@ -561,7 +563,8 @@ ARM64Reg Arm64FPRCache::RW(size_t preg, RegType type)
[[fallthrough]];
case REG_DUP:
// Store PSR1 (which is equal to PSR0) in memory.
- m_float_emit->STR(64, INDEX_UNSIGNED, flush_reg, PPC_REG, u32(PPCSTATE_OFF(ps[preg].ps1)));
+ m_float_emit->STR(64, INDEX_UNSIGNED, flush_reg, PPC_REG,
+ static_cast<s32>(PPCSTATE_OFF_PS1(preg)));
break;
default:
// All other types doesn't store anything in PSR1.
@@ -688,7 +691,7 @@ void Arm64FPRCache::FlushRegister(size_t preg, bool maintain_state)
if (dirty)
{
m_float_emit->STR(store_size, INDEX_UNSIGNED, host_reg, PPC_REG,
- u32(PPCSTATE_OFF(ps[preg].ps0)));
+ static_cast<s32>(PPCSTATE_OFF_PS0(preg)));
}
if (!maintain_state)
@@ -701,12 +704,18 @@ void Arm64FPRCache::FlushRegister(size_t preg, bool maintain_state)
{
if (dirty)
{
- // If the paired registers were at the start of ppcState we could do an STP here.
- // Too bad moving them would break savestate compatibility between x86_64 and AArch64
- // m_float_emit->STP(64, INDEX_SIGNED, host_reg, host_reg, PPC_REG,
- // PPCSTATE_OFF(ps[preg].ps0));
- m_float_emit->STR(64, INDEX_UNSIGNED, host_reg, PPC_REG, u32(PPCSTATE_OFF(ps[preg].ps0)));
- m_float_emit->STR(64, INDEX_UNSIGNED, host_reg, PPC_REG, u32(PPCSTATE_OFF(ps[preg].ps1)));
+ if (PPCSTATE_OFF_PS0(preg) <= 504)
+ {
+ m_float_emit->STP(64, INDEX_SIGNED, host_reg, host_reg, PPC_REG,
+ static_cast<s32>(PPCSTATE_OFF_PS0(preg)));
+ }
+ else
+ {
+ m_float_emit->STR(64, INDEX_UNSIGNED, host_reg, PPC_REG,
+ static_cast<s32>(PPCSTATE_OFF_PS0(preg)));
+ m_float_emit->STR(64, INDEX_UNSIGNED, host_reg, PPC_REG,
+ static_cast<s32>(PPCSTATE_OFF_PS1(preg)));
+ }
}
if (!maintain_state)
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.h b/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.h
index 9860e4843e..c1b71f1212 100644
--- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.h
+++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.h
@@ -22,6 +22,18 @@ static const Arm64Gen::ARM64Reg DISPATCHER_PC =
#define PPCSTATE_OFF(elem) (offsetof(PowerPC::PowerPCState, elem))
+#define PPCSTATE_OFF_ARRAY(elem, i) \
+ (offsetof(PowerPC::PowerPCState, elem[0]) + sizeof(PowerPC::PowerPCState::elem[0]) * (i))
+
+#define PPCSTATE_OFF_GPR(i) PPCSTATE_OFF_ARRAY(gpr, i)
+#define PPCSTATE_OFF_CR(i) PPCSTATE_OFF_ARRAY(cr.fields, i)
+#define PPCSTATE_OFF_SR(i) PPCSTATE_OFF_ARRAY(sr, i)
+#define PPCSTATE_OFF_SPR(i) PPCSTATE_OFF_ARRAY(spr, i)
+
+static_assert(std::is_same_v<decltype(PowerPC::PowerPCState::ps[0]), PowerPC::PairedSingle&>);
+#define PPCSTATE_OFF_PS0(i) (PPCSTATE_OFF_ARRAY(ps, i) + offsetof(PowerPC::PairedSingle, ps0))
+#define PPCSTATE_OFF_PS1(i) (PPCSTATE_OFF_ARRAY(ps, i) + offsetof(PowerPC::PairedSingle, ps1))
+
// Some asserts to make sure we will be able to load everything
static_assert(PPCSTATE_OFF(spr[1023]) <= 16380, "LDR(32bit) can't reach the last SPR");
static_assert((PPCSTATE_OFF(ps[0].ps0) % 8) == 0,
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp
index d5889fd62c..427afe8c15 100644
--- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp
+++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp
@@ -111,7 +111,7 @@ void JitArm64::mfsr(UGeckoInstruction inst)
JITDISABLE(bJITSystemRegistersOff);
gpr.BindToRegister(inst.RD, false);
- LDR(INDEX_UNSIGNED, gpr.R(inst.RD), PPC_REG, PPCSTATE_OFF(sr[inst.SR]));
+ LDR(INDEX_UNSIGNED, gpr.R(inst.RD), PPC_REG, PPCSTATE_OFF_SR(inst.SR));
}
void JitArm64::mtsr(UGeckoInstruction inst)
@@ -120,7 +120,7 @@ void JitArm64::mtsr(UGeckoInstruction inst)
JITDISABLE(bJITSystemRegistersOff);
gpr.BindToRegister(inst.RS, true);
- STR(INDEX_UNSIGNED, gpr.R(inst.RS), PPC_REG, PPCSTATE_OFF(sr[inst.SR]));
+ STR(INDEX_UNSIGNED, gpr.R(inst.RS), PPC_REG, PPCSTATE_OFF_SR(inst.SR));
}
void JitArm64::mfsrin(UGeckoInstruction inst)
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStorePaired.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStorePaired.cpp
index f6a63ee2e6..91da6b2643 100644
--- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStorePaired.cpp
+++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStorePaired.cpp
@@ -77,7 +77,7 @@ void JitArm64::psq_l(UGeckoInstruction inst)
}
else
{
- LDR(INDEX_UNSIGNED, scale_reg, PPC_REG, PPCSTATE_OFF(spr[SPR_GQR0 + inst.I]));
+ //LDR(INDEX_UNSIGNED, scale_reg, PPC_REG, PPCSTATE_OFF(spr[SPR_GQR0 + inst.I]));
UBFM(type_reg, scale_reg, 16, 18); // Type
UBFM(scale_reg, scale_reg, 24, 29); // Scale
@@ -179,7 +179,7 @@ void JitArm64::psq_st(UGeckoInstruction inst)
m_float_emit.FCVTN(32, D0, VS);
}
- LDR(INDEX_UNSIGNED, scale_reg, PPC_REG, PPCSTATE_OFF(spr[SPR_GQR0 + inst.I]));
+ //LDR(INDEX_UNSIGNED, scale_reg, PPC_REG, PPCSTATE_OFF(spr[SPR_GQR0 + inst.I]));
UBFM(type_reg, scale_reg, 0, 2); // Type
UBFM(scale_reg, scale_reg, 8, 13); // Scale
diff --git a/Source/Core/DiscIO/WIACompression.cpp b/Source/Core/DiscIO/WIACompression.cpp
index 20d19c4877..10d6d67c22 100644
--- a/Source/Core/DiscIO/WIACompression.cpp
+++ b/Source/Core/DiscIO/WIACompression.cpp
@@ -165,18 +165,18 @@ bool Bzip2Decompressor::Decompress(const DecompressionBuffer& in, DecompressionB
m_started = true;
}
- constexpr auto clamped_cast = [](size_t x) {
- return static_cast<unsigned int>(
- std::min<size_t>(std::numeric_limits<unsigned int>().max(), x));
- };
+ //constexpr auto clamped_cast = [](size_t x) {
+ //return static_cast<unsigned int>(
+ //std::min<size_t>(std::numeric_limits<unsigned int>().max(), x));
+ //};
char* const in_ptr = reinterpret_cast<char*>(const_cast<u8*>(in.data.data() + *in_bytes_read));
m_stream.next_in = in_ptr;
- m_stream.avail_in = clamped_cast(in.bytes_written - *in_bytes_read);
+ //m_stream.avail_in = clamped_cast(in.bytes_written - *in_bytes_read);
char* const out_ptr = reinterpret_cast<char*>(out->data.data() + out->bytes_written);
m_stream.next_out = out_ptr;
- m_stream.avail_out = clamped_cast(out->data.size() - out->bytes_written);
+ //m_stream.avail_out = clamped_cast(out->data.size() - out->bytes_written);
const int result = BZ2_bzDecompress(&m_stream);

View file

@ -142,4 +142,4 @@ rm -rf /storage/.local/share/dolphin-emu
ln -sf /storage/.config/dolphin-emu /storage/.local/share/dolphin-emu
#Run Dolphin emulator
/usr/bin/dolphin-emu-nogui -p wayland -a HLE -e "${1}"
/usr/bin/dolphin-emu-nogui -p @DOLPHIN_PLATFORM@ -a HLE -e "${1}"

View file

@ -153,4 +153,4 @@ rm -rf /storage/.local/share/dolphin-emu
ln -sf /storage/.config/dolphin-emu /storage/.local/share/dolphin-emu
#Run Dolphin emulator
/usr/bin/dolphin-emu-nogui -p wayland -a HLE -e "${1}"
/usr/bin/dolphin-emu-nogui -p @DOLPHIN_PLATFORM@ -a HLE -e "${1}"

View file

@ -37,7 +37,7 @@ case "${DEVICE}" in
;;
RK3566)
PKG_DEPENDS_TARGET+=" common-shaders glsl-shaders"
PKG_EMUS="moonlight openbor pico-8 PPSSPPSDL vicesa"
PKG_EMUS="moonlight openbor pico-8 PPSSPPSDL vicesa dolphinsa"
;;
esac