Undo Daxter's rotation of the analog input. See #17015

I think this is quite a bit better actually. Appears to be exactly 15 degrees.
This commit is contained in:
Henrik Rydgård committed 2023-02-27 11:10:47 +01:00
1 parent ca8af6f4c7
commit 1071d0808c
4 files changed
+25

No files matched your search

+1
View File
@@ -127,6 +127,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "RockmanDash2SoundFix", &flags_.RockmanDash2SoundFix);
CheckSetting(iniFile, gameID, "ReadbackDepth", &flags_.ReadbackDepth);
CheckSetting(iniFile, gameID, "BlockTransferDepth", &flags_.BlockTransferDepth);
CheckSetting(iniFile, gameID, "DaxterRotatedAnalogStick", &flags_.DaxterRotatedAnalogStick);
}
void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {
+1
View File
@@ -98,6 +98,7 @@ struct CompatFlags {
bool RockmanDash2SoundFix;
bool ReadbackDepth;
bool BlockTransferDepth;
bool DaxterRotatedAnalogStick;
};
struct VRCompat {
+16
View File
@@ -20,6 +20,7 @@
#include "Common/Serialize/Serializer.h"
#include "Common/Serialize/SerializeFuncs.h"
#include "Common/Math/math_util.h"
#include "Core/CoreTiming.h"
#include "Core/HLE/HLE.h"
#include "Core/HLE/FunctionWrappers.h"
@@ -28,6 +29,7 @@
#include "Core/HLE/sceKernelThread.h"
#include "Core/HLE/sceKernelInterrupt.h"
#include "Core/HW/Display.h"
#include "Core/System.h"
#include "Core/MemMapHelpers.h"
#include "Core/MIPS/MIPS.h"
#include "Core/Replay.h"
@@ -118,6 +120,20 @@ static void __CtrlUpdateLatch()
// Copy in the current data to the current buffer.
ctrlBufs[ctrlBuf] = ctrlCurrent;
if (PSP_CoreParameter().compat.flags().DaxterRotatedAnalogStick) {
// For some reason, Daxter rotates the analog input. See #17015
float angle = (15.0f / 360.0f) * (2.0f * M_PI);
float cosAngle = cosf(angle);
float sinAngle = sinf(angle);
float x = ctrlBufs[ctrlBuf].analog[0][0] - 128;
float y = ctrlBufs[ctrlBuf].analog[0][1] - 128;
float rX = x * cosAngle - y * sinAngle;
float rY = x * sinAngle + y * cosAngle;
ctrlBufs[ctrlBuf].analog[0][0] = (u8)Clamp(rX + 128, 0.0f, 255.0f);
ctrlBufs[ctrlBuf].analog[0][1] = (u8)Clamp(rY + 128, 0.0f, 255.0f);
}
ctrlBufs[ctrlBuf].buttons = buttons;
u32 changed = buttons ^ ctrlOldButtons;
+7
View File
@@ -1479,3 +1479,10 @@ NPEG00004 = true
ULES01070 = true
ULES01071 = true
ULUS10347 = true
[DaxterRotatedAnalogStick]
# Daxter (see issue #17015)
UCUS98618 = true
UCES00044 = true
NPUG80329 = true
NPEG00025 = true