Add atrac hack setting

This commit is contained in:
sum2012 2022-08-14 09:51:49 +08:00
parent 4d096925fd
commit 965daea455
7 changed files with 11 additions and 0 deletions

View file

@ -956,6 +956,7 @@ static ConfigSetting soundSettings[] = {
ConfigSetting("AltSpeedVolume", &g_Config.iAltSpeedVolume, -1, true, true),
ConfigSetting("AudioDevice", &g_Config.sAudioDevice, "", true, false),
ConfigSetting("AutoAudioDevice", &g_Config.bAutoAudioDevice, true, true, false),
ConfigSetting("HackSound", &g_Config.bHackSound, false, true, false),
ConfigSetting(false),
};

View file

@ -256,6 +256,7 @@ public:
bool bExtraAudioBuffering; // For bluetooth
std::string sAudioDevice;
bool bAutoAudioDevice;
bool bHackSound;
// UI
bool bShowDebuggerOnLoad;

View file

@ -1170,6 +1170,11 @@ static u32 sceAtracAddStreamData(int atracID, u32 bytesToAdd) {
atrac->first_.offset += bytesToAdd;
atrac->bufferValidBytes_ += bytesToAdd;
if (g_Config.bHackSound && atrac->bufferState_ == ATRAC_STATUS_STREAMED_LOOP_FROM_END && atrac->RemainingFrames() > 2) { // Code Lyoko don't like SeekToSample for unknown reason
atrac->loopNum_++;
atrac->SeekToSample(atrac->loopStartSample_ - atrac->FirstOffsetExtra() - atrac->firstSampleOffset_);
}
return hleLogSuccessI(ME, 0);
}

View file

@ -693,6 +693,7 @@ void GameSettingsScreen::CreateViews() {
PopupMultiChoiceDynamic *MicChoice = audioSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sMicDevice, a->T("Microphone Device"), micList, nullptr, screenManager()));
MicChoice->OnChoice.Handle(this, &GameSettingsScreen::OnMicDeviceChange);
}
audioSettings->Add(new CheckBox(&g_Config.bHackSound, a->T("Hack sound")));
// Control
LinearLayout *controlsSettings = AddTab("GameSettingsControls", ms->T("Controls"));

View file

@ -33,6 +33,7 @@ Disabled = Disabled
DSound (compatible) = DSound (compatible)
Enable Sound = Enable sound
Global volume = Global volume
Hack sound = Hack sound
Microphone = Microphone
Microphone Device = Microphone device
Mute = Mute

View file

@ -9,6 +9,7 @@ Disabled = 禁用
DSound (compatible) = DirectSound(兼容)
Enable Sound = 开启声音
Global volume = 全局音量
Hack sound = 破解声音修复
Microphone = 麦克风
Microphone Device = 麦克风设备
Mute = 静音

View file

@ -9,6 +9,7 @@ Disabled = Disabled
DSound (compatible) = DirectSound(兼容)
Enable Sound = 啟用音效
Global volume = 全局音量
Hack sound = 破解聲音修復
Microphone = Microphone
Microphone Device = 麥克風裝置
Mute = 靜音