Skip to content

Commit

Permalink
Update EE slider to both over and underclock
Browse files Browse the repository at this point in the history
This causes confuses with the current INI set up as I explained in the
issue. Hopefully someone can figure out how to make the slider go from
-2 to +2
  • Loading branch information
Sarania committed Jan 31, 2015
1 parent b2576cd commit 4e7d96e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 35 deletions.
39 changes: 26 additions & 13 deletions pcsx2/gui/Panels/SpeedhacksPanel.cpp
Expand Up @@ -19,24 +19,37 @@

using namespace pxSizerFlags;

const wxChar* Panels::SpeedHacksPanel::GetEEcycleSliderMsg( int val )
const wxChar* Panels::SpeedHacksPanel::GetEEcycleSliderMsg(int val)
{
switch( val )
switch (val)
{
case 1:
return pxEt( L"1 - Default cyclerate. This closely matches the actual speed of a real PS2 EmotionEngine."

case 1:
return pxEt(L"1 - Reduces the EE's cyclerate by about 50%. Moderate speedup, but *will* cause stuttering audio on many FMVs."
);

case 2:
return pxEt( L"2 - Reduces the EE's cyclerate by about 33%. Mild speedup for most games with high compatibility."
case 2:
return pxEt(L"2 - Reduces the EE's cyclerate by about 33%. Mild speedup for most games with high compatibility."
);

case 3:
return pxEt( L"3 - Reduces the EE's cyclerate by about 50%. Moderate speedup, but *will* cause stuttering audio on many FMVs."
case 3:
return pxEt(L"3 - Default cyclerate. This closely matches the actual speed of a real PS2 EmotionEngine."
);

default:
break;
case 4:
return pxEt(L"4 - Increases the EE's cyclerate by about 33%. Increases system requirements. May increase in-game FPS."
);

case 5:
return pxEt(L"5 - Increases the EE's cyclerate by about 50%. Greatly increases system requirements. May noticably increase in-game FPS."
);





default:
break;
}

return L"Unreachable Warning Suppressor!!";
Expand Down Expand Up @@ -106,16 +119,16 @@ Panels::SpeedHacksPanel::SpeedHacksPanel( wxWindow* parent )
// Cycle stealing works by 'fast-forwarding' the EE by an arbitrary number of cycles whenever VU1 micro-programs
// are run, which works as a rough-guess skipping of what would normally be idle time spent running on the EE.

wxPanelWithHelpers* eeSliderPanel = new wxPanelWithHelpers( left, wxVERTICAL, _("EE Cyclerate [Not Recommended]") );
wxPanelWithHelpers* eeSliderPanel = new wxPanelWithHelpers( left, wxVERTICAL, _("EE Clock control [Not Recommended]") );

m_slider_eecycle = new wxSlider( eeSliderPanel, wxID_ANY, 1, 1, 3,
m_slider_eecycle = new wxSlider( eeSliderPanel, wxID_ANY, 3, 1, 5,
wxDefaultPosition, wxDefaultSize, wxHORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS );

m_msg_eecycle = new pxStaticHeading( eeSliderPanel );
m_msg_eecycle->SetForegroundColour( wxColour( L"Red" ) );
m_msg_eecycle->SetHeight(3);

const wxChar* ee_tooltip = pxEt( L"Setting higher values on this slider effectively reduces the clock speed of the EmotionEngine's R5900 core cpu, and typically brings big speedups to games that fail to utilize the full potential of the real PS2 hardware."
const wxChar* ee_tooltip = pxEt( L"Values less than 3 effectively reduce the clock rate of the EmotionEngine. Values greater than 3 increase it."
);

pxSetToolTip( m_slider_eecycle, ee_tooltip );
Expand Down
56 changes: 34 additions & 22 deletions pcsx2/x86/ix86-32/iR5900-32.cpp
Expand Up @@ -1102,42 +1102,54 @@ static u32 scaleBlockCycles_helper()
// caused by sync hacks and such, since games seem to care a lot more about
// these small blocks having accurate cycle counts.

if( s_nBlockCycles <= (5<<3) || (EmuConfig.Speedhacks.EECycleRate == 0) )
if( s_nBlockCycles <= (5<<3) || (EmuConfig.Speedhacks.EECycleRate == 2) )
return s_nBlockCycles >> 3;

uint scalarLow, scalarMid, scalarHigh;

// Note: larger blocks get a smaller scalar, to help keep
// them from becoming "too fat" and delaying branch tests.

switch( EmuConfig.Speedhacks.EECycleRate )
switch (EmuConfig.Speedhacks.EECycleRate)
{
case 0: return s_nBlockCycles >> 3;

case 1: // Sync hack x1.5!
scalarLow = 5;
scalarMid = 7;
scalarHigh = 5;
case 0: // EE clock 50%
scalarLow = 7;
scalarMid = 9;
scalarHigh = 7;
break;

case 2: // Sync hack x2
scalarLow = 7;
scalarMid = 9;
scalarHigh = 7;
case 1: // EE clock 70%
scalarLow = 5;
scalarMid = 7;
scalarHigh = 5;
break;

case 2: return s_nBlockCycles >> 3; // default cycle rate

case 3: // EE clock 130%
scalarLow = 1;
scalarMid = 2;
scalarHigh = 1;
break;

case 4: // EE clock 150%
scalarLow = 0;
scalarMid = 1;
scalarHigh = 0;
break;
// Added insane rates on popular request (rama)
//jNO_DEFAULT
default:
scalarLow = 2;
scalarMid = 3;
scalarHigh = 2;
if (EmuConfig.Speedhacks.EECycleRate > 2 && EmuConfig.Speedhacks.EECycleRate < 100) {
scalarLow *= EmuConfig.Speedhacks.EECycleRate;
scalarMid *= EmuConfig.Speedhacks.EECycleRate;
scalarHigh *= EmuConfig.Speedhacks.EECycleRate;
}
//NO_DEFAULT
default:
scalarLow = 2;
scalarMid = 3;
scalarHigh = 2;

//if (EmuConfig.Speedhacks.EECycleRate > 2 && EmuConfig.Speedhacks.EECycleRate < 100) {
//scalarLow *= EmuConfig.Speedhacks.EECycleRate;
//scalarMid *= EmuConfig.Speedhacks.EECycleRate;
//scalarHigh *= EmuConfig.Speedhacks.EECycleRate;
//}
}

const u32 temp = s_nBlockCycles * (
Expand Down

0 comments on commit 4e7d96e

Please sign in to comment.