diff --git a/common/include/Utilities/FixedPointTypes.inl b/common/include/Utilities/FixedPointTypes.inl index 248d2d2838..5c1d1f7fe4 100644 --- a/common/include/Utilities/FixedPointTypes.inl +++ b/common/include/Utilities/FixedPointTypes.inl @@ -157,7 +157,7 @@ FixedInt& FixedInt::SetFraction( u32 fracpart ) template< int Precision > wxString FixedInt::ToString() const { - return wxsFormat( L"%d.%d", GetWhole(), (GetFraction() * 100) / Precision ); + return wxsFormat( L"%d.%02d", GetWhole(), (GetFraction() * 100) / Precision ); } template< int Precision > @@ -167,7 +167,8 @@ wxString FixedInt::ToString( int fracDigits ) const pxAssert( fracDigits <= 7 ); // higher numbers would just cause overflows and bad mojo. int mulby = (int)pow( 10.0, fracDigits ); - return wxsFormat( L"%d.%d", GetWhole(), (GetFraction() * mulby) / Precision ); + wxString fmt=wxsFormat(L"%%d.%%0%dd", fracDigits); + return wxsFormat( fmt, GetWhole(), (GetFraction() * mulby) / Precision ); } template< int Precision > diff --git a/news.txt b/news.txt new file mode 100644 index 0000000000..5c217a5c7e --- /dev/null +++ b/news.txt @@ -0,0 +1,11 @@ +Bug fix release 1.0.1: + +System: +Fixed incorrect handling of framerate adjustment percentage settings. +Fixed cases in which GS window settings do not apply until the PCSX2 is restarted. + +Core: +Fixed crash on startup when virtual memory for SuperVU cannot be allocated. + +SPU2-X: +Fixed out of bounds array access in ADPCM decoding causing bad audio. (Multiple Crash Bandicoot games.) \ No newline at end of file diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 6d74ef8ce1..6b681ee0c7 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -370,22 +370,18 @@ static const uint TitleBarUpdateMs = 333; GSFrame::GSFrame(wxWindow* parent, const wxString& title) - : wxFrame(parent, wxID_ANY, title, - g_Conf->GSWindow.WindowPos, wxSize( 640, 480 ), - (g_Conf->GSWindow.DisableResizeBorders ? 0 : wxRESIZE_BORDER) | wxCAPTION | wxCLIP_CHILDREN | - wxSYSTEM_MENU | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX - ) + : wxFrame(parent, wxID_ANY, title, g_Conf->GSWindow.WindowPos) , m_timer_UpdateTitle( this ) { SetIcons( wxGetApp().GetIconBundle() ); - SetClientSize( g_Conf->GSWindow.WindowSize ); SetBackgroundColour( *wxBLACK ); wxStaticText* label = new wxStaticText( this, wxID_ANY, _("GS Output is Disabled!") ); m_id_OutputDisabled = label->GetId(); label->SetFont( wxFont( 20, wxDEFAULT, wxNORMAL, wxBOLD ) ); label->SetForegroundColour( *wxWHITE ); - label->Show( EmuConfig.GS.DisableOutput ); + + AppStatusEvent_OnSettingsApplied(); GSPanel* gsPanel = new GSPanel( this ); gsPanel->Show( !EmuConfig.GS.DisableOutput ); @@ -498,6 +494,12 @@ void GSFrame::AppStatusEvent_OnSettingsApplied() { if( IsBeingDeleted() ) return; + SetWindowStyle((g_Conf->GSWindow.DisableResizeBorders ? 0 : wxRESIZE_BORDER) | wxCAPTION | wxCLIP_CHILDREN | + wxSYSTEM_MENU | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX); + if (!IsFullScreen() && !IsMaximized()) + SetClientSize(g_Conf->GSWindow.WindowSize); + Refresh(); + if( g_Conf->GSWindow.CloseOnEsc ) { if( IsShown() && !CorePlugins.IsOpen(PluginId_GS) ) diff --git a/pcsx2/x86/sVU_zerorec.cpp b/pcsx2/x86/sVU_zerorec.cpp index bcfc1aaa1c..ad5664d93a 100644 --- a/pcsx2/x86/sVU_zerorec.cpp +++ b/pcsx2/x86/sVU_zerorec.cpp @@ -350,7 +350,8 @@ static void SuperVUAlloc(int vuindex) { if (s_recVUMem[vuindex]) return; - s_recVUMem[vuindex] = new RecompiledCodeReserve( pxsFmt("SuperVU%u Recompiler Cache", vuindex), 0 ); + wxString mem_name = pxsFmt("SuperVU%u Recompiler Cache", vuindex); + s_recVUMem[vuindex] = new RecompiledCodeReserve( mem_name, 0 ); s_recVUMem[vuindex]->Reserve( sVU_EXESIZE, vuindex ? HostMemoryMap::sVU1rec : HostMemoryMap::sVU0rec, _256mb ); s_recVUMem[vuindex]->SetProfilerName(pxsFmt("sVU%urec",vuindex)); @@ -358,7 +359,7 @@ static void SuperVUAlloc(int vuindex) if (!s_recVUMem[vuindex]->IsOk()) { safe_delete(s_recVUMem[vuindex]); - throw Exception::VirtualMemoryMapConflict( s_recVUMem[vuindex]->GetName() ) + throw Exception::VirtualMemoryMapConflict(mem_name) .SetDiagMsg(pxsFmt( L"SuperVU failed to allocate virtual memory below 256MB." )) .SetUserMsg(pxE( "!Notice:superVU:VirtualMemoryAlloc", L"Out of Memory (sorta): The SuperVU recompiler was unable to reserve the specific memory " diff --git a/plugins/spu2-x/src/Mixer.cpp b/plugins/spu2-x/src/Mixer.cpp index d7ed0f406d..ee861a6801 100644 --- a/plugins/spu2-x/src/Mixer.cpp +++ b/plugins/spu2-x/src/Mixer.cpp @@ -19,7 +19,7 @@ void ADMAOutLogWrite(void *lpData, u32 ulSize); -static const s32 tbl_XA_Factor[5][2] = +static const s32 tbl_XA_Factor[16][2] = { { 0, 0 }, { 60, 0 }, @@ -76,8 +76,11 @@ static void __forceinline XA_decode_block(s16* buffer, const s16* block, s32& pr { const s32 header = *block; const s32 shift = (header&0xF)+16; - const s32 pred1 = tbl_XA_Factor[(header>> 4)&0xF][0]; - const s32 pred2 = tbl_XA_Factor[(header>> 4)&0xF][1]; + const int id = header >> 4 & 0xF; + if (id > 4 && MsgToConsole()) + ConLog("* SPU2-X: Unknown ADPCM coefficients table id %d\n", id); + const s32 pred1 = tbl_XA_Factor[id][0]; + const s32 pred2 = tbl_XA_Factor[id][1]; const s8* blockbytes = (s8*)&block[1]; const s8* blockend = &blockbytes[13]; @@ -156,11 +159,13 @@ static __forceinline s32 GetNextDataBuffered( V_Core& thiscore, uint voiceidx ) thiscore.Regs.ENDX |= (1 << voiceidx); vc.NextA = vc.LoopStartA | 1; if (!(vc.LoopFlags & XAFLAG_LOOP)) + { vc.Stop(); - if( IsDevBuild ) - { - if(MsgVoiceOff()) ConLog("* SPU2-X: Voice Off by EndPoint: %d \n", voiceidx); + if( IsDevBuild ) + { + if(MsgVoiceOff()) ConLog("* SPU2-X: Voice Off by EndPoint: %d \n", voiceidx); + } } } else