01-06-2011, 07:59 AM
I'm trying to build a modded version of PCSX2 with EE being emulated at the full 300 MHz mostly just for giggles and to see just how badly my processor will scale. I think the code is from svn-r4177, although I'm not so sure. Anyways, it was checked out January 5, 2011 around 6AM (GMT+08:00).
The relevant code appears to be the following (iR5900-32.cpp):
I'm trying to analyze what happens when scalarLow, scalarMid & scalarHigh are all set to 2. From what I see that's basically going to be equivalent to:
which is, if I'm doing the calculations correctly, essentially the same as:
Is that correct? I was wondering, instead of replacing the values for the scalars to 2, can I just go straight to return s_nBlockCycles >> 4;?
Also, instead of simply replacing one of the EE speedhacks, I'm thinking of adding this as an option in the GUI in my custom build. So far, I've found that I would need to change SpeedhacksPanel.cpp
and ini.cpp
Are those the only things I would have to change? Did I miss anything else? It's been several years since my Introduction to Computer Science class and that's pretty much the extent of my training so my programming skills are practically non-existant. I apologize for all the questions and thank you very much for any help!
(10-26-2010, 09:23 PM)rama Wrote: Gee, guys
Current PCSX2 runs, by default, with an EE speed of ~240MHz.
It largely depends on the actual game code that is run though.
Saiki built PCSX2 for himself that has an EE speed of more than that, possibly ~400MHz
Saiki Wrote:ilovejedd Wrote:You mentioned you compiled custom versions with the EE running at full speed. Would you happen to have a list of what changes to the source code need to be made for this? Thanks!look for the speedhacks 2,2,2 is what you need one of them to be
The relevant code appears to be the following (iR5900-32.cpp):
Code:
static u32 scaleBlockCycles_helper()
{
// Note: s_nBlockCycles is 3 bit fixed point. Divide by 8 when done!
// Let's not scale blocks under 5-ish cycles. This fixes countless "problems"
// 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) )
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 )
{
case 0: return s_nBlockCycles >> 3;
case 1: // Sync hack x1.5!
scalarLow = 5;
scalarMid = 7;
scalarHigh = 5;
break;
case 2: // Sync hack x2
scalarLow = 7;
scalarMid = 9;
scalarHigh = 7;
break;
jNO_DEFAULT
}
const u32 temp = s_nBlockCycles * (
(s_nBlockCycles <= (10<<3)) ? scalarLow :
((s_nBlockCycles > (21<<3)) ? scalarHigh : scalarMid )
);
return temp >> (3+2);
}
I'm trying to analyze what happens when scalarLow, scalarMid & scalarHigh are all set to 2. From what I see that's basically going to be equivalent to:
Code:
const u32 temp = s_nBlockCycles * 2;
return temp >> (3+2);
which is, if I'm doing the calculations correctly, essentially the same as:
Code:
return s_nBlockCycles >> 4;
Is that correct? I was wondering, instead of replacing the values for the scalars to 2, can I just go straight to return s_nBlockCycles >> 4;?
Also, instead of simply replacing one of the EE speedhacks, I'm thinking of adding this as an option in the GUI in my custom build. So far, I've found that I would need to change SpeedhacksPanel.cpp
Code:
Line 22:
const wxChar* Panels::SpeedHacksPanel::GetEEcycleSliderMsg( int val ) // add a new case for the experimental EE Cycle Rate?
{
}
Line 122:
m_slider_eecycle = new wxSlider( eeSliderPanel, wxID_ANY, 1, 1, 3, // change to 1, 1, 4?
wxDefaultPosition, wxDefaultSize, wxHORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS );
}
and ini.cpp
Code:
Line 230:
Entry("EECycleRate", Config.Hacks.EECycleRate);
if (Config.Hacks.EECycleRate > 2) // change this to 3?
Config.Hacks.EECycleRate = 2; // change this to 3?
Are those the only things I would have to change? Did I miss anything else? It's been several years since my Introduction to Computer Science class and that's pretty much the extent of my training so my programming skills are practically non-existant. I apologize for all the questions and thank you very much for any help!