mirror of https://github.com/PCSX2/pcsx2.git
Improved the MTGS enable/disable option, so that it only resets the GS plugin now, instead of everything. Using File->RunCD performs a full reset now, as it should.
CDVDiso: The last used directory is now saved correctly. You won't have to re-nav to your iso folder constantly anymore. :) CDVDiso: Added missing resource file to the project (configure boxes appear/work now). git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@496 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
f93e8c1beb
commit
af14756352
|
@ -909,7 +909,7 @@ void gsReset()
|
|||
}
|
||||
else
|
||||
{
|
||||
SysPrintf("GIF reset\n");
|
||||
Console::Notice( "GIF reset");
|
||||
GSreset();
|
||||
GSsetFrameSkip(0);
|
||||
}
|
||||
|
|
45
pcsx2/Hw.c
45
pcsx2/Hw.c
|
@ -84,31 +84,29 @@ u8 hwRead8(u32 mem)
|
|||
{
|
||||
u8 ret;
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
if( mem >= 0x10000000 && mem < 0x10008000 )
|
||||
SysPrintf("hwRead8 to %x\n", mem);
|
||||
#endif
|
||||
DevCon::Notice("hwRead8 to %x", mem);
|
||||
|
||||
SPR_LOG("Hardware read 8bit at %lx, ret %lx\n", mem, psHu8(mem));
|
||||
SPR_LOG("Hardware read 8bit at %lx, ret %lx\n", mem, psHu8(mem));
|
||||
|
||||
// switch (mem) {
|
||||
// default:
|
||||
if ((mem & 0xffffff0f) == 0x1000f200) {
|
||||
if(mem == 0x1000f260) ret = 0;
|
||||
else if(mem == 0x1000F240) {
|
||||
ret = psHu32(mem);
|
||||
//psHu32(mem) &= ~0x4000;
|
||||
}
|
||||
else ret = psHu32(mem);
|
||||
return (u8)ret;
|
||||
}
|
||||
|
||||
if (mem < 0x10010000)
|
||||
{
|
||||
ret = psHu8(mem);
|
||||
}
|
||||
else ret = 0;
|
||||
HW_LOG("Unknown Hardware Read 8 at %x\n",mem);
|
||||
if ((mem & 0xffffff0f) == 0x1000f200) {
|
||||
if(mem == 0x1000f260) ret = 0;
|
||||
else if(mem == 0x1000F240) {
|
||||
ret = psHu32(mem);
|
||||
//psHu32(mem) &= ~0x4000;
|
||||
}
|
||||
else ret = psHu32(mem);
|
||||
return (u8)ret;
|
||||
}
|
||||
|
||||
if (mem < 0x10010000)
|
||||
{
|
||||
ret = psHu8(mem);
|
||||
}
|
||||
else ret = 0;
|
||||
HW_LOG("Unknown Hardware Read 8 at %x\n",mem);
|
||||
// break;
|
||||
// }
|
||||
|
||||
|
@ -119,11 +117,10 @@ u16 hwRead16(u32 mem)
|
|||
{
|
||||
u16 ret;
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
if( mem >= 0x10002000 && mem < 0x10008000 )
|
||||
SysPrintf("hwRead16 to %x\n", mem);
|
||||
#endif
|
||||
SPR_LOG("Hardware read 16bit at %lx, ret %lx\n", mem, psHu16(mem));
|
||||
Console::Notice("hwRead16 to %x", mem);
|
||||
|
||||
SPR_LOG("Hardware read 16bit at %lx, ret %lx\n", mem, psHu16(mem));
|
||||
|
||||
switch (mem) {
|
||||
case 0x10000000: ret = (u16)rcntRcount(0); break;
|
||||
|
|
|
@ -624,6 +624,8 @@ int InitPlugins() {
|
|||
|
||||
void ShutdownPlugins()
|
||||
{
|
||||
ClosePlugins();
|
||||
|
||||
// GS is a special case: It needs closed first usually.
|
||||
// (the GS isn't closed during emulation pauses)
|
||||
if( OpenStatus.GS )
|
||||
|
@ -632,8 +634,6 @@ void ShutdownPlugins()
|
|||
OpenStatus.GS = false;
|
||||
}
|
||||
|
||||
ClosePlugins();
|
||||
|
||||
GSshutdown();
|
||||
PAD1shutdown();
|
||||
PAD2shutdown();
|
||||
|
@ -690,7 +690,8 @@ int OpenPlugins(const char* pTitleFilename) {
|
|||
GSdriverInfo info;
|
||||
int ret;
|
||||
|
||||
if (!loadp) return -1;
|
||||
if ( !loadp )
|
||||
throw Exception::InvalidOperation( "OpenPlugins cannot be called while the plugin state is uninitialized." );
|
||||
|
||||
#ifndef _WIN32
|
||||
// change dir so that CDVD can find its config file
|
||||
|
@ -863,3 +864,17 @@ void ReleasePlugins()
|
|||
SysCloseLibrary(FWplugin); FWplugin = NULL;
|
||||
loadp = false;
|
||||
}
|
||||
|
||||
void PluginsResetGS()
|
||||
{
|
||||
if( OpenStatus.GS )
|
||||
{
|
||||
gsClose();
|
||||
OpenStatus.GS = false;
|
||||
}
|
||||
|
||||
GSshutdown();
|
||||
|
||||
int ret = GSinit();
|
||||
if (ret != 0) { SysMessage (_("GSinit error: %d"), ret); }
|
||||
}
|
|
@ -38,4 +38,6 @@ void ClosePlugins();
|
|||
// take effect. Use a manual set oc alls to ReleasePlugins and LoadPlugins for that.
|
||||
void ResetPlugins();
|
||||
|
||||
void PluginsResetGS();
|
||||
|
||||
#endif /* __PLUGINS_H__ */
|
||||
|
|
|
@ -150,8 +150,12 @@ BOOL CALLBACK CpuDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if( (Config.Options&PCSX2_GSMULTITHREAD) ^ (newopts&PCSX2_GSMULTITHREAD) )
|
||||
{
|
||||
// gotta shut down *all* the plugins.
|
||||
ResetPlugins();
|
||||
// Need the MTGS setting to take effect, so close out the plugins:
|
||||
PluginsResetGS();
|
||||
if( CHECK_MULTIGS )
|
||||
Console::Notice( "MTGS mode disabled.\n\tEnjoy the fruits of single-threaded simpicity." );
|
||||
else
|
||||
Console::Notice( "MTGS mode enabled.\n\tWelcome to multi-threaded awesomeness." );
|
||||
}
|
||||
Config.Options = newopts;
|
||||
}
|
||||
|
|
|
@ -1163,6 +1163,7 @@ LRESULT WINAPI MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case ID_FILE_RUNCD:
|
||||
safe_free( g_RecoveryState );
|
||||
ResetPlugins();
|
||||
RunExecute( NULL );
|
||||
return FALSE;
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ extern _cdIso cdIso[8];
|
|||
#define MSF2SECT(m,s,f) (((m)*60+(s)-2)*75+(f))
|
||||
|
||||
extern char IsoFile[256];
|
||||
extern char IsoCWD[256];
|
||||
extern char CdDev[256];
|
||||
|
||||
extern int BlockDump;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "CDVDiso.h"
|
||||
#include "Config.h"
|
||||
|
@ -14,6 +15,7 @@
|
|||
#endif
|
||||
|
||||
char IsoFile[256];
|
||||
char IsoCWD[256];
|
||||
char CdDev[256];
|
||||
|
||||
_cdIso cdIso[8];
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
EnableFunctionLevelLinking="false"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
|
@ -310,6 +310,10 @@
|
|||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\CDVDiso.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="bzip2"
|
||||
|
|
|
@ -23,6 +23,7 @@ void SaveConf() {
|
|||
RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\PS2Eplugin\\CDVD\\CDVDiso", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &myKey, &myDisp);
|
||||
|
||||
SetKeyV("IsoFile", IsoFile, sizeof(IsoFile), REG_BINARY);
|
||||
SetKeyV("CurrentWorkingFolder", IsoCWD, sizeof(IsoCWD), REG_BINARY);
|
||||
SetKeyVdw("BlockDump", &BlockDump);
|
||||
|
||||
RegCloseKey(myKey);
|
||||
|
@ -39,6 +40,7 @@ void LoadConf() {
|
|||
}
|
||||
|
||||
GetKeyV("IsoFile", IsoFile, sizeof(IsoFile), REG_BINARY);
|
||||
GetKeyV("CurrentWorkingFolder", IsoCWD, sizeof(IsoCWD), REG_BINARY);
|
||||
GetKeyVdw("BlockDump", &BlockDump);
|
||||
|
||||
RegCloseKey(myKey);
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
#include <commctrl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <direct.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "zlib/zlib.h"
|
||||
|
||||
|
||||
|
@ -43,7 +45,14 @@ int _GetFile(char *out) {
|
|||
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = GetActiveWindow();
|
||||
ofn.lpstrFilter = "Supported Formats\0*.bin;*.iso;*.img;*.nrg;*.mdf;*.Z;*.Z2;*.BZ2;*.dump\0Cd Iso Format (*.bin;*.iso;*.img;*.nrg;*.mdf)\0*.bin;*.iso;*.img;*.nrg;*.mdf\0Compressed Z Iso Format (*.Z;*.Z2)\0*.Z;*.Z2\0Compressed BZ Iso Format (*.BZ2)\0*.BZ2\0Block Dumps (*.dump)\0*.dump\0All Files\0*.*\0";
|
||||
ofn.lpstrFilter =
|
||||
"Supported Formats\0*.bin;*.iso;*.img;*.nrg;*.mdf;*.Z;*.Z2;*.BZ2;*.dump\0"
|
||||
"Cd Iso Format (*.bin;*.iso;*.img;*.nrg;*.mdf)\0"
|
||||
"*.bin;*.iso;*.img;*.nrg;*.mdf\0"
|
||||
"Compressed Z Iso Format (*.Z;*.Z2)\0"
|
||||
"*.Z;*.Z2\0Compressed BZ Iso Format (*.BZ2)\0"
|
||||
"*.BZ2\0Block Dumps (*.dump)\0*.dump\0All Files\0*.*\0";
|
||||
|
||||
ofn.lpstrCustomFilter = NULL;
|
||||
ofn.nMaxCustFilter = 0;
|
||||
ofn.nFilterIndex = 1;
|
||||
|
@ -54,9 +63,10 @@ int _GetFile(char *out) {
|
|||
ofn.nMaxFileTitle = MAXFILENAME;
|
||||
ofn.lpstrTitle = NULL;
|
||||
ofn.lpstrDefExt = NULL;
|
||||
ofn.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
|
||||
ofn.Flags = OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName ((LPOPENFILENAME)&ofn)) {
|
||||
if(GetOpenFileName ((LPOPENFILENAME)&ofn))
|
||||
{
|
||||
strcpy(out, szFileName);
|
||||
return 1;
|
||||
}
|
||||
|
@ -64,9 +74,40 @@ int _GetFile(char *out) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void CfgOpenFile() {
|
||||
int _OpenFile( int saveConf ) {
|
||||
|
||||
int retval = 0;
|
||||
|
||||
// for saving the pcsx2 current working directory;
|
||||
char* cwd_pcsx2 = _getcwd( NULL, MAXFILENAME );
|
||||
|
||||
if( IsoCWD[0] != 0 )
|
||||
_chdir( IsoCWD );
|
||||
|
||||
if (_GetFile(IsoFile) == 1)
|
||||
SaveConf();
|
||||
{
|
||||
// Save the user's new cwd:
|
||||
if( _getcwd( IsoCWD, MAXFILENAME ) == NULL )
|
||||
IsoCWD[0] = 0;
|
||||
|
||||
if( saveConf )
|
||||
SaveConf();
|
||||
|
||||
retval = 1;
|
||||
}
|
||||
|
||||
// Restore Pcsx2's path.
|
||||
if( cwd_pcsx2 != NULL )
|
||||
{
|
||||
_chdir( cwd_pcsx2 );
|
||||
free( cwd_pcsx2 );
|
||||
cwd_pcsx2 = NULL;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void CfgOpenFile() {
|
||||
_OpenFile( TRUE );
|
||||
}
|
||||
|
||||
void UpdZmode() {
|
||||
|
@ -242,7 +283,7 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)) {
|
||||
case IDC_SELECTISO:
|
||||
if (_GetFile(IsoFile) == 1)
|
||||
if( _OpenFile(FALSE) == 1 )
|
||||
Edit_SetText(hIsoFile, IsoFile);
|
||||
return TRUE;
|
||||
|
||||
|
@ -261,6 +302,7 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case IDCANCEL:
|
||||
EndDialog(hW, TRUE);
|
||||
return TRUE;
|
||||
|
||||
case IDOK:
|
||||
Edit_GetText(hIsoFile, IsoFile, 256);
|
||||
BlockDump = Button_GetCheck(hBlockDump);
|
||||
|
@ -288,8 +330,8 @@ BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
|||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
EndDialog(hW, FALSE);
|
||||
return TRUE;
|
||||
EndDialog(hW, TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in New Issue