Add workaround for hung music notes in Rockman Dash 2

Fixes #11442. Or at least should, I haven't tested this, just followed the
discussion in the issue.

According to this issue, this is a game bug that happens on real hardware
too, due to a lousy job porting the game to the PSP, most likely, which has
different ADSR (note envelope) behavior.
This commit is contained in:
Henrik Rydgård 2023-01-12 11:30:42 +01:00
parent d71c6a0e95
commit b118ffadea
4 changed files with 14 additions and 1 deletions

View File

@ -124,6 +124,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "OldAdrenoPixelDepthRoundingGL", &flags_.OldAdrenoPixelDepthRoundingGL);
CheckSetting(iniFile, gameID, "ForceCircleButtonConfirm", &flags_.ForceCircleButtonConfirm);
CheckSetting(iniFile, gameID, "DisallowFramebufferAtOffset", &flags_.DisallowFramebufferAtOffset);
CheckSetting(iniFile, gameID, "RockmanDash2SoundFix", &flags_.RockmanDash2SoundFix);
}
void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {

View File

@ -95,6 +95,7 @@ struct CompatFlags {
bool OldAdrenoPixelDepthRoundingGL;
bool ForceCircleButtonConfirm;
bool DisallowFramebufferAtOffset;
bool RockmanDash2SoundFix;
};
struct VRCompat {

View File

@ -25,6 +25,7 @@
#include "Core/Config.h"
#include "Core/Reporting.h"
#include "Core/Util/AudioFormat.h"
#include "Core/Core.h"
#include "SasAudio.h"
// #define AUDIO_TO_FILE
@ -894,7 +895,11 @@ inline void ADSREnvelope::Step() {
SetState(STATE_SUSTAIN);
break;
case STATE_SUSTAIN:
WalkCurve(sustainType, sustainRate);
if (PSP_CoreParameter().compat.flags().RockmanDash2SoundFix && sustainType == PSP_SAS_ADSR_CURVE_MODE_LINEAR_INCREASE) {
WalkCurve(PSP_SAS_ADSR_CURVE_MODE_LINEAR_DECREASE, sustainRate);
} else {
WalkCurve(sustainType, sustainRate);
}
if (height_ <= 0) {
height_ = 0;
SetState(STATE_RELEASE);

View File

@ -1424,3 +1424,9 @@ UCES01264 = true
UCJS10107 = true
NPJG00073 = true
UCAS40262 = true
[RockmanDash2SoundFix]
# Rockman Dash 2, see #11442
ULJM05037 = true
ULJM05216 = true
NPJH50181 = true