Experimental commit!

Hacked in a way to make GSdx change the renderer on the fly.
When you press F11 it will switch to DX9 sowftware rendering.
Press it again to get back to the setting you were using before.

Notes:
-For this change I had to modify a few lines in GSdx. If that's not acceptable
we can do more drastic measures and modify the gsdx.ini :p
-F11 is currently also used for doing gsstates in debug modes, it will likely be changed.
-When in dx10 hardware + fullscreen mode, pressing this key will crash GSdx. Sorry.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@689 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2009-03-05 20:00:41 +00:00
parent 8092692047
commit 5897d04917
3 changed files with 36 additions and 8 deletions

View File

@ -471,7 +471,7 @@ struct PacketTagType
u32 command;
u32 data[3];
};
extern bool renderswitch;
int mtgsThreadObject::Callback()
{
Console::WriteLn("MTGS > Thread Started, Opening GS Plugin...");
@ -480,7 +480,10 @@ int mtgsThreadObject::Callback()
GSsetBaseMem( m_gsMem );
GSirqCallback( NULL );
m_returncode = GSopen((void *)&pDsp, "PCSX2", 1);
//tells GSdx to go into dx9 sw if "renderswitch" is set. Abusing the isMultiThread int
//for that so we don't need a new callback
if (!renderswitch) m_returncode = GSopen((void *)&pDsp, "PCSX2", 1);
else if (renderswitch) m_returncode = GSopen((void *)&pDsp, "PCSX2", 2);
Console::WriteLn( "MTGS > GSopen Finished, return code: 0x%x", params m_returncode );

View File

@ -27,6 +27,7 @@
static bool sinit = false;
bool UseGui = true;
bool nDisableSC = false; // screensaver
bool renderswitch = 0;
// This instance is not modified by command line overrides so
@ -427,7 +428,7 @@ namespace HostGui
case VK_F1: case VK_F2: case VK_F3: case VK_F4:
case VK_F5: case VK_F6: case VK_F7: case VK_F8:
case VK_F9: case VK_F10: case VK_F11: case VK_F12:
case VK_F9: case VK_F10: case VK_F12:
try
{
ProcessFKeys(ev->key-VK_F1 + 1, shiftkey);
@ -442,6 +443,24 @@ namespace HostGui
}
break;
case VK_F11: //gsdx "on the fly" renderer switching
if (!renderswitch) {
StateRecovery::MakeGsOnly();
g_EmulationInProgress = false;
ClosePlugins( 1 );
renderswitch = true; //go to dx9 sw
StateRecovery::Recover();
HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later
}
else {
StateRecovery::MakeGsOnly();
g_EmulationInProgress = false;
ClosePlugins( 1 );
renderswitch = false; //return to default renderer
StateRecovery::Recover();
HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later
}
break;
case VK_TAB:
CycleFrameLimit(0);
break;

View File

@ -154,9 +154,15 @@ static INT32 GSopen(void* dsp, char* title, int mt, int renderer)
EXPORT_C_(INT32) GSopen(void* dsp, char* title, int mt)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
int renderer;
int renderer = AfxGetApp()->GetProfileInt(_T("Settings"), _T("renderer"), 0);
if (mt == 2){ //pcsx2 sent a switch renderer request
renderer = 1; //DX9 sw
mt = 1;
}
else { //normal init
renderer = AfxGetApp()->GetProfileInt(_T("Settings"), _T("renderer"), 0);
}
return GSopen(dsp, title, mt, renderer);
}