mirror of https://github.com/PCSX2/pcsx2.git
Fixed compilation errors in dev builds introduced in the last commit (Which, ironically, fixed compilation errors in the non-dev builds.. heh).
The Profiler is now toggleable via a menu option under Misc - below the Console/Patches toggles. Removed some more dead code and unused logging options. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@478 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
9d0c0ef2de
commit
dfec17bab2
|
@ -67,7 +67,6 @@ extern DisR5900CurrentState disR5900Current;
|
|||
//that way is slower but you now not need to compile every time ;P
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
|
||||
extern int Log;
|
||||
extern u32 varLog;
|
||||
|
||||
void SourceLog( u16 protocol, u8 source, u32 cpuPc, u32 cpuCycle, const char *fmt, ...);
|
||||
|
@ -146,7 +145,6 @@ extern void SrcLog_GPU( const char* fmt, ... );
|
|||
#else // PCSX2_DEVBUILD
|
||||
|
||||
#define varLog 0
|
||||
#define Log 0
|
||||
|
||||
#define CPU_LOG 0&&
|
||||
#define MEM_LOG 0&&
|
||||
|
|
|
@ -82,7 +82,7 @@ static u32 branchPC;
|
|||
#ifdef PCSX2_DEVBUILD
|
||||
static void debugI()
|
||||
{
|
||||
//if (Log) { CPU_LOG("%s\n", disR5900Current.getString()); }
|
||||
//CPU_LOG("%s\n", disR5900Current.getString());
|
||||
if (cpuRegs.GPR.n.r0.UD[0] || cpuRegs.GPR.n.r0.UD[1]) SysPrintf("R0 is not zero!!!!\n");
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -244,7 +244,7 @@ void memShutdown()
|
|||
VIRTUAL_FREE(PS2MEM_EROM, 0x001C0000);
|
||||
PHYSICAL_FREE(PS2MEM_SCRATCH, 0x00010000, s_psS);
|
||||
PHYSICAL_FREE(PS2MEM_HW, 0x00010000, s_psHw);
|
||||
PHYSICAL_FREE(PS2MEM_PSX, 0x00800000, s_psxM);
|
||||
PHYSICAL_FREE(PS2MEM_PSX, 0x00200000, s_psxM);
|
||||
PHYSICAL_FREE(PS2MEM_VU0MICRO, 0x00010000, s_psVuMem);
|
||||
|
||||
VIRTUAL_FREE(PS2MEM_VU0MICRO, 0x00010000); // allocate for all VUs
|
||||
|
|
|
@ -148,7 +148,10 @@ struct PcsxConfig {
|
|||
char BiosDir[g_MaxPath];
|
||||
char Lang[g_MaxPath];
|
||||
u32 Options; // PCSX2_X options
|
||||
int PsxOut;
|
||||
|
||||
bool PsxOut;
|
||||
bool Profiler;
|
||||
|
||||
int PsxType;
|
||||
int Cdda;
|
||||
int Mdec;
|
||||
|
|
|
@ -58,10 +58,6 @@ int psxInit()
|
|||
psxBreak = 0;
|
||||
psxCycleEE = -1;
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
Log=0;
|
||||
#endif
|
||||
|
||||
if (psxMemInit() == -1) return -1;
|
||||
|
||||
return psxCpu->Init();
|
||||
|
|
|
@ -100,10 +100,6 @@ int cpuInit()
|
|||
if (memInit() == -1) return -1;
|
||||
#endif
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
Log = 0;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
FILE *emuLog;
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
int Log;
|
||||
u32 varLog;
|
||||
|
||||
// these used by the depreciated _old_Log only
|
||||
|
|
|
@ -232,9 +232,7 @@ void _vu1Exec(VURegs* VU) {
|
|||
}
|
||||
}
|
||||
|
||||
if (Log) {
|
||||
VUM_LOG("VU->cycle = %d (flags st=%x;mac=%x;clip=%x,q=%f)\n", VU->cycle, VU->statusflag, VU->macflag, VU->clipflag, VU->q.F);
|
||||
}
|
||||
VUM_LOG("VU->cycle = %d (flags st=%x;mac=%x;clip=%x,q=%f)\n", VU->cycle, VU->statusflag, VU->macflag, VU->clipflag, VU->q.F);
|
||||
|
||||
VU->code = ptr[1];
|
||||
VU1regs_UPPER_OPCODE[VU->code & 0x3f](&uregs);
|
||||
|
|
|
@ -1242,9 +1242,9 @@ void (*PREFIX##_LOWER_OPCODE[128])(_VURegsNum *VUregsn) = { \
|
|||
#ifdef VUM_LOG
|
||||
|
||||
#define IdebugUPPER(VU) \
|
||||
if (Log) { VUM_LOG("%s\n", dis##VU##MicroUF(VU.code, VU.VI[REG_TPC].UL)); }
|
||||
VUM_LOG("%s\n", dis##VU##MicroUF(VU.code, VU.VI[REG_TPC].UL));
|
||||
#define IdebugLOWER(VU) \
|
||||
if (Log) { VUM_LOG("%s\n", dis##VU##MicroLF(VU.code, VU.VI[REG_TPC].UL)); }
|
||||
VUM_LOG("%s\n", dis##VU##MicroLF(VU.code, VU.VI[REG_TPC].UL));
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ void _vuFMACflush(VURegs * VU) {
|
|||
if (VU->fmac[i].enable == 0) continue;
|
||||
|
||||
if ((VU->cycle - VU->fmac[i].sCycle) >= VU->fmac[i].Cycle) {
|
||||
if (Log) { VUM_LOG("flushing FMAC pipe[%d] (macflag=%x)\n", i, VU->fmac[i].macflag); }
|
||||
VUM_LOG("flushing FMAC pipe[%d] (macflag=%x)\n", i, VU->fmac[i].macflag);
|
||||
|
||||
VU->fmac[i].enable = 0;
|
||||
VU->VI[REG_MAC_FLAG].UL = VU->fmac[i].macflag;
|
||||
|
@ -66,7 +66,7 @@ void _vuFDIVflush(VURegs * VU) {
|
|||
if (VU->fdiv.enable == 0) return;
|
||||
|
||||
if ((VU->cycle - VU->fdiv.sCycle) >= VU->fdiv.Cycle) {
|
||||
if (Log) { VUM_LOG("flushing FDIV pipe\n"); }
|
||||
VUM_LOG("flushing FDIV pipe\n");
|
||||
|
||||
VU->fdiv.enable = 0;
|
||||
VU->VI[REG_Q].UL = VU->fdiv.reg.UL;
|
||||
|
@ -78,7 +78,7 @@ void _vuEFUflush(VURegs * VU) {
|
|||
if (VU->efu.enable == 0) return;
|
||||
|
||||
if ((VU->cycle - VU->efu.sCycle) >= VU->efu.Cycle) {
|
||||
// if (Log) { VUM_LOG("flushing EFU pipe\n"); }
|
||||
// VUM_LOG("flushing EFU pipe\n");
|
||||
|
||||
VU->efu.enable = 0;
|
||||
VU->VI[REG_P].UL = VU->efu.reg.UL;
|
||||
|
@ -99,7 +99,7 @@ void _vuFlushAll(VURegs* VU)
|
|||
nRepeat = 1;
|
||||
|
||||
if ((VU->cycle - VU->fmac[i].sCycle) >= VU->fmac[i].Cycle) {
|
||||
if (Log) { VUM_LOG("flushing FMAC pipe[%d] (macflag=%x)\n", i, VU->fmac[i].macflag); }
|
||||
VUM_LOG("flushing FMAC pipe[%d] (macflag=%x)\n", i, VU->fmac[i].macflag);
|
||||
|
||||
VU->fmac[i].enable = 0;
|
||||
VU->VI[REG_MAC_FLAG].UL = VU->fmac[i].macflag;
|
||||
|
@ -113,7 +113,7 @@ void _vuFlushAll(VURegs* VU)
|
|||
nRepeat = 1;
|
||||
|
||||
if ((VU->cycle - VU->fdiv.sCycle) >= VU->fdiv.Cycle) {
|
||||
if (Log) { VUM_LOG("flushing FDIV pipe\n"); }
|
||||
VUM_LOG("flushing FDIV pipe\n");
|
||||
|
||||
nRepeat = 1;
|
||||
VU->fdiv.enable = 0;
|
||||
|
@ -127,7 +127,7 @@ void _vuFlushAll(VURegs* VU)
|
|||
nRepeat = 1;
|
||||
|
||||
if ((VU->cycle - VU->efu.sCycle) >= VU->efu.Cycle) {
|
||||
// if (Log) { VUM_LOG("flushing EFU pipe\n"); }
|
||||
// VUM_LOG("flushing EFU pipe\n");
|
||||
|
||||
nRepeat = 1;
|
||||
VU->efu.enable = 0;
|
||||
|
@ -163,7 +163,7 @@ void _vuFMACTestStall(VURegs * VU, int reg, int xyzw) {
|
|||
VU->VI[REG_MAC_FLAG].UL = VU->fmac[i].macflag;
|
||||
VU->VI[REG_STATUS_FLAG].UL = VU->fmac[i].statusflag;
|
||||
VU->VI[REG_CLIP_FLAG].UL = VU->fmac[i].clipflag;
|
||||
if (Log) { VUM_LOG("FMAC[%d] stall %d\n", i, cycle); }
|
||||
VUM_LOG("FMAC[%d] stall %d\n", i, cycle);
|
||||
|
||||
VU->cycle+= cycle;
|
||||
_vuTestPipes(VU);
|
||||
|
@ -181,7 +181,7 @@ void _vuFMACAdd(VURegs * VU, int reg, int xyzw) {
|
|||
// SysPrintf("*PCSX2*: error , out of fmacs %d\n", VU->cycle);
|
||||
}
|
||||
|
||||
if (Log) { VUM_LOG("adding FMAC pipe[%d]; xyzw=%x\n", i, xyzw); }
|
||||
VUM_LOG("adding FMAC pipe[%d]; xyzw=%x\n", i, xyzw);
|
||||
|
||||
VU->fmac[i].enable = 1;
|
||||
VU->fmac[i].sCycle = VU->cycle;
|
||||
|
@ -194,7 +194,7 @@ void _vuFMACAdd(VURegs * VU, int reg, int xyzw) {
|
|||
}
|
||||
|
||||
void _vuFDIVAdd(VURegs * VU, int cycles) {
|
||||
if (Log) { VUM_LOG("adding FDIV pipe\n"); }
|
||||
VUM_LOG("adding FDIV pipe\n");
|
||||
|
||||
VU->fdiv.enable = 1;
|
||||
VU->fdiv.sCycle = VU->cycle;
|
||||
|
@ -204,7 +204,7 @@ void _vuFDIVAdd(VURegs * VU, int cycles) {
|
|||
}
|
||||
|
||||
void _vuEFUAdd(VURegs * VU, int cycles) {
|
||||
// if (Log) { VUM_LOG("adding EFU pipe\n"); }
|
||||
// VUM_LOG("adding EFU pipe\n");
|
||||
|
||||
VU->efu.enable = 1;
|
||||
VU->efu.sCycle = VU->cycle;
|
||||
|
@ -218,7 +218,7 @@ void _vuFlushFDIV(VURegs * VU) {
|
|||
if (VU->fdiv.enable == 0) return;
|
||||
|
||||
cycle = VU->fdiv.Cycle - (VU->cycle - VU->fdiv.sCycle);
|
||||
if (Log) { VUM_LOG("waiting FDIV pipe %d\n", cycle); }
|
||||
VUM_LOG("waiting FDIV pipe %d\n", cycle);
|
||||
|
||||
VU->fdiv.enable = 0;
|
||||
VU->cycle+= cycle;
|
||||
|
@ -232,7 +232,7 @@ void _vuFlushEFU(VURegs * VU) {
|
|||
if (VU->efu.enable == 0) return;
|
||||
|
||||
cycle = VU->efu.Cycle - (VU->cycle - VU->efu.sCycle);
|
||||
// if (Log) { VUM_LOG("waiting EFU pipe %d\n", cycle); }
|
||||
// VUM_LOG("waiting EFU pipe %d\n", cycle);
|
||||
|
||||
VU->efu.enable = 0;
|
||||
VU->cycle+= cycle;
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Console
|
|||
|
||||
__forceinline bool __fastcall WriteLn()
|
||||
{
|
||||
if (Config.PsxOut != 0)
|
||||
if (hConsole != NULL)
|
||||
{
|
||||
DWORD tmp;
|
||||
WriteConsole(hConsole, "\r\n", 2, &tmp, 0);
|
||||
|
@ -80,7 +80,7 @@ namespace Console
|
|||
|
||||
__forceinline bool __fastcall Write( const char* fmt )
|
||||
{
|
||||
if (Config.PsxOut != 0)
|
||||
if (hConsole != NULL)
|
||||
{
|
||||
DWORD tmp;
|
||||
WriteConsole(hConsole, fmt, (DWORD)strlen(fmt), &tmp, 0);
|
||||
|
|
|
@ -561,7 +561,10 @@ BOOL APIENTRY DebuggerProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
|
|||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
case IDC_DEBUG_LOG:
|
||||
Log = 1 - Log;
|
||||
if( varLog )
|
||||
varLog &= ~0x80000000;
|
||||
else
|
||||
varLog |= 0x80000000;
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -118,18 +118,22 @@ static volatile bool ProfRunning=false;
|
|||
|
||||
void ProfilerRegisterSource(const char* Name,void* buff,u32 sz)
|
||||
{
|
||||
EnterCriticalSection( &ProfModulesLock );
|
||||
if( ProfRunning )
|
||||
EnterCriticalSection( &ProfModulesLock );
|
||||
Module tmp(Name,buff,sz);
|
||||
ProfModules.push_back(tmp);
|
||||
LeaveCriticalSection( &ProfModulesLock );
|
||||
if( ProfRunning )
|
||||
LeaveCriticalSection( &ProfModulesLock );
|
||||
}
|
||||
|
||||
void ProfilerRegisterSource(const char* Name,void* function)
|
||||
{
|
||||
EnterCriticalSection( &ProfModulesLock );
|
||||
if( ProfRunning )
|
||||
EnterCriticalSection( &ProfModulesLock );
|
||||
Module tmp(Name,function);
|
||||
ProfModules.push_back(tmp);
|
||||
LeaveCriticalSection( &ProfModulesLock );
|
||||
if( ProfRunning )
|
||||
LeaveCriticalSection( &ProfModulesLock );
|
||||
}
|
||||
|
||||
int __stdcall ProfilerThread(void* nada)
|
||||
|
@ -139,8 +143,7 @@ int __stdcall ProfilerThread(void* nada)
|
|||
|
||||
while(ProfRunning)
|
||||
{
|
||||
_loopstart:
|
||||
Sleep(7);
|
||||
Sleep(6);
|
||||
|
||||
if (tick_count>400)
|
||||
{
|
||||
|
@ -205,7 +208,7 @@ _loopstart:
|
|||
if (iter!=ProfUnknownHash.end())
|
||||
{
|
||||
iter->second.ticks++;
|
||||
goto _loopstart;
|
||||
continue;
|
||||
}
|
||||
|
||||
Module tmp(sz==0?modulenam.c_str():0,(void*)ctx.Eip);
|
||||
|
|
|
@ -629,7 +629,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
|
||||
// [TODO] : Add the other plugin overrides here...
|
||||
|
||||
ProfilerInit();
|
||||
if( Config.Profiler )
|
||||
ProfilerInit();
|
||||
|
||||
InitCPUTicks();
|
||||
if (SysInit() == -1) return 1;
|
||||
|
||||
|
@ -683,6 +685,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
|
||||
VirtualFree(PS2MEM_BASE, 0, MEM_RELEASE);
|
||||
#endif
|
||||
|
||||
// Don't check Config.Profiler here -- the Profiler will know if it's running or not.
|
||||
ProfilerTerm();
|
||||
return 0;
|
||||
}
|
||||
|
@ -801,8 +805,7 @@ BOOL APIENTRY LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
|||
case WM_INITDIALOG:
|
||||
for (i=0; i<32; i++)
|
||||
if (varLog & (1<<i))
|
||||
CheckDlgButton(hDlg, IDC_LOG+i, TRUE);
|
||||
if (Log) CheckDlgButton(hDlg, IDC_LOGS, TRUE);
|
||||
CheckDlgButton(hDlg, IDC_CPULOG+i, TRUE);
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -810,13 +813,10 @@ BOOL APIENTRY LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
|||
|
||||
if (LOWORD(wParam) == IDOK) {
|
||||
for (i=0; i<32; i++) {
|
||||
int ret = Button_GetCheck(GetDlgItem(hDlg, IDC_LOG+i));
|
||||
int ret = Button_GetCheck(GetDlgItem(hDlg, IDC_CPULOG+i));
|
||||
if (ret) varLog|= 1<<i;
|
||||
else varLog&=~(1<<i);
|
||||
}
|
||||
if (Button_GetCheck(GetDlgItem(hDlg, IDC_LOGS)))
|
||||
Log = 1;
|
||||
else Log = 0;
|
||||
|
||||
SaveConfig();
|
||||
|
||||
|
@ -831,18 +831,13 @@ BOOL APIENTRY LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
|||
#endif
|
||||
|
||||
BOOL APIENTRY AdvancedProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
//char str[256];
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
//CheckDlgButton(hDlg, IDC_REGCACHING, CHECK_REGCACHING ? TRUE : FALSE);
|
||||
//if (Config.SafeCnts) CheckDlgButton(hDlg, IDC_SAFECOUNTERS, TRUE);
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK) {
|
||||
//Config.Options &= ~PCSX2_REGCACHING;
|
||||
//Config.Options |= IsDlgButtonChecked(hDlg, IDC_REGCACHING) ? PCSX2_REGCACHING : 0;
|
||||
SaveConfig();
|
||||
EndDialog(hDlg, TRUE);
|
||||
}
|
||||
|
@ -1299,36 +1294,46 @@ LRESULT WINAPI MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||
CheckMenuItem(gApp.hMenu,ID_PROCESSNORMAL,MF_UNCHECKED);
|
||||
CheckMenuItem(gApp.hMenu,ID_PROCESSLOW,MF_UNCHECKED);
|
||||
return TRUE;
|
||||
|
||||
case ID_CONSOLE:
|
||||
Config.PsxOut = !Config.PsxOut;
|
||||
if(Config.PsxOut)
|
||||
{
|
||||
CheckMenuItem(gApp.hMenu,ID_CONSOLE,MF_UNCHECKED);
|
||||
Console::Close();
|
||||
Config.PsxOut=0;
|
||||
SaveConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckMenuItem(gApp.hMenu,ID_CONSOLE,MF_CHECKED);
|
||||
Console::Open();
|
||||
Config.PsxOut=1;
|
||||
SaveConfig();
|
||||
}
|
||||
SaveConfig();
|
||||
return TRUE;
|
||||
|
||||
case ID_PATCHES:
|
||||
if(Config.Patch)
|
||||
Config.Patch = !Config.Patch;
|
||||
CheckMenuItem(gApp.hMenu,ID_PATCHES,Config.Patch ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
SaveConfig();
|
||||
return TRUE;
|
||||
|
||||
#ifndef _DEBUG
|
||||
case ID_PROFILER:
|
||||
Config.Profiler = !Config.Profiler;
|
||||
if( Config.Profiler )
|
||||
{
|
||||
CheckMenuItem(gApp.hMenu,ID_PATCHES,MF_UNCHECKED);
|
||||
Config.Patch=0;
|
||||
SaveConfig();
|
||||
CheckMenuItem(gApp.hMenu,ID_PROFILER,MF_CHECKED);
|
||||
ProfilerInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckMenuItem(gApp.hMenu,ID_PATCHES,MF_CHECKED);
|
||||
Config.Patch=1;
|
||||
SaveConfig();
|
||||
CheckMenuItem(gApp.hMenu,ID_PROFILER,MF_UNCHECKED);
|
||||
ProfilerTerm();
|
||||
}
|
||||
return TRUE;
|
||||
SaveConfig();
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
default:
|
||||
if (LOWORD(wParam) >= ID_LANGS && LOWORD(wParam) <= (ID_LANGS + langsMax)) {
|
||||
AccBreak = 1;
|
||||
|
@ -1483,8 +1488,11 @@ void CreateMainMenu() {
|
|||
#endif
|
||||
|
||||
ADDSUBMENU(0, _("&Misc"));
|
||||
//ADDMENUITEM(0,_("Enable &Profiler"), ID_PROFILER);
|
||||
ADDSEPARATOR(0);
|
||||
if( !IsDebugBuild )
|
||||
{
|
||||
ADDMENUITEM(0,_("Enable &Profiler"), ID_PROFILER);
|
||||
ADDSEPARATOR(0);
|
||||
}
|
||||
ADDMENUITEM(0,_("Enable &Patches"), ID_PATCHES);
|
||||
ADDMENUITEM(0,_("Enable &Console"), ID_CONSOLE);
|
||||
ADDSEPARATOR(0);
|
||||
|
@ -1558,8 +1566,9 @@ void CreateMainWindow(int nCmdShow) {
|
|||
if(Config.ThPriority==THREAD_PRIORITY_NORMAL) CheckMenuItem(gApp.hMenu,ID_PROCESSNORMAL,MF_CHECKED);
|
||||
if(Config.ThPriority==THREAD_PRIORITY_HIGHEST) CheckMenuItem(gApp.hMenu,ID_PROCESSHIGH,MF_CHECKED);
|
||||
if(Config.ThPriority==THREAD_PRIORITY_LOWEST) CheckMenuItem(gApp.hMenu,ID_PROCESSLOW,MF_CHECKED);
|
||||
if(Config.PsxOut) CheckMenuItem(gApp.hMenu,ID_CONSOLE,MF_CHECKED);
|
||||
if(Config.Patch) CheckMenuItem(gApp.hMenu,ID_PATCHES,MF_CHECKED);
|
||||
if(Config.PsxOut) CheckMenuItem(gApp.hMenu,ID_CONSOLE,MF_CHECKED);
|
||||
if(Config.Patch) CheckMenuItem(gApp.hMenu,ID_PATCHES,MF_CHECKED);
|
||||
if(Config.Profiler) CheckMenuItem(gApp.hMenu,ID_PROFILER,MF_CHECKED);
|
||||
hStatusWnd = CreateStatusWindow(WS_CHILD | WS_VISIBLE, "", hWnd, 100);
|
||||
sprintf(buf, "PCSX2 %s", PCSX2_VERSION);
|
||||
StatusSet(buf);
|
||||
|
@ -2254,7 +2263,7 @@ void SysVirtualFree(void* lpMemReserved, u32 size)
|
|||
// unmap
|
||||
if( MapUserPhysicalPages( lpMemReserved, (size+s_dwPageSize-1)/s_dwPageSize, NULL ) != TRUE )
|
||||
{
|
||||
Console::FormatLn("MapUserPhysicalPages failed to unmap, error %u.", GetLastError() );
|
||||
Console::FormatLn("VirtualMemory Error %u > MapUserPhysicalPages failed to unmap", GetLastError() );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ void GetConfigFilename( char* dest )
|
|||
int LoadConfig()
|
||||
{
|
||||
FILE *fp;
|
||||
PcsxConfig* Conf = &winConfig;
|
||||
PcsxConfig& Conf = winConfig;
|
||||
|
||||
char szIniFile[g_MaxPath], szValue[g_MaxPath];
|
||||
|
||||
|
@ -87,84 +87,87 @@ int LoadConfig()
|
|||
fclose(fp);
|
||||
//interface
|
||||
GetPrivateProfileString("Interface", "Bios", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->Bios, szValue);
|
||||
strcpy(Conf.Bios, szValue);
|
||||
GetPrivateProfileString("Interface", "Lang", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->Lang, szValue);
|
||||
strcpy(Conf.Lang, szValue);
|
||||
GetPrivateProfileString("Interface", "Ps2Out", NULL, szValue, 20, szIniFile);
|
||||
Conf->PsxOut = strtoul(szValue, NULL, 10);
|
||||
Conf.PsxOut = !!strtoul(szValue, NULL, 10);
|
||||
GetPrivateProfileString("Interface", "Profiler", NULL, szValue, 20, szIniFile);
|
||||
Conf.Profiler = !!strtoul(szValue, NULL, 10);
|
||||
GetPrivateProfileString("Interface", "ThPriority", NULL, szValue, 20, szIniFile);
|
||||
Conf->ThPriority = strtoul(szValue, NULL, 10);
|
||||
Conf.ThPriority = strtoul(szValue, NULL, 10);
|
||||
GetPrivateProfileString("Interface", "PluginsDir", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->PluginsDir, szValue);
|
||||
strcpy(Conf.PluginsDir, szValue);
|
||||
GetPrivateProfileString("Interface", "BiosDir", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->BiosDir, szValue);
|
||||
strcpy(Conf.BiosDir, szValue);
|
||||
GetPrivateProfileString("Interface", "Mcd1", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->Mcd1, szValue);
|
||||
strcpy(Conf.Mcd1, szValue);
|
||||
GetPrivateProfileString("Interface", "Mcd2", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->Mcd2, szValue);
|
||||
Conf->CustomFps = GetPrivateProfileInt("Interface", "CustomFps", 0, szIniFile);
|
||||
Conf->CustomFrameSkip = GetPrivateProfileInt("Interface", "CustomFrameskip", 0, szIniFile);
|
||||
Conf->CustomConsecutiveFrames = GetPrivateProfileInt("Interface", "CustomConsecutiveFrames", 0, szIniFile);
|
||||
Conf->CustomConsecutiveSkip = GetPrivateProfileInt("Interface", "CustomConsecutiveSkip", 0, szIniFile);
|
||||
//plugins
|
||||
strcpy(Conf.Mcd2, szValue);
|
||||
Conf.CustomFps = GetPrivateProfileInt("Interface", "CustomFps", 0, szIniFile);
|
||||
Conf.CustomFrameSkip = GetPrivateProfileInt("Interface", "CustomFrameskip", 0, szIniFile);
|
||||
Conf.CustomConsecutiveFrames = GetPrivateProfileInt("Interface", "CustomConsecutiveFrames", 0, szIniFile);
|
||||
Conf.CustomConsecutiveSkip = GetPrivateProfileInt("Interface", "CustomConsecutiveSkip", 0, szIniFile);
|
||||
|
||||
//plugins
|
||||
GetPrivateProfileString("Plugins", "GS", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->GS, szValue);
|
||||
strcpy(Conf.GS, szValue);
|
||||
GetPrivateProfileString("Plugins", "SPU2", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->SPU2, szValue);
|
||||
strcpy(Conf.SPU2, szValue);
|
||||
GetPrivateProfileString("Plugins", "CDVD", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->CDVD, szValue);
|
||||
strcpy(Conf.CDVD, szValue);
|
||||
GetPrivateProfileString("Plugins", "PAD1", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->PAD1, szValue);
|
||||
strcpy(Conf.PAD1, szValue);
|
||||
GetPrivateProfileString("Plugins", "PAD2", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->PAD2, szValue);
|
||||
strcpy(Conf.PAD2, szValue);
|
||||
GetPrivateProfileString("Plugins", "DEV9", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->DEV9, szValue);
|
||||
strcpy(Conf.DEV9, szValue);
|
||||
GetPrivateProfileString("Plugins", "USB", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->USB, szValue);
|
||||
strcpy(Conf.USB, szValue);
|
||||
GetPrivateProfileString("Plugins", "FW", NULL, szValue, g_MaxPath, szIniFile);
|
||||
strcpy(Conf->FW, szValue);
|
||||
strcpy(Conf.FW, szValue);
|
||||
//cpu
|
||||
GetPrivateProfileString("Cpu Options", "Options", NULL, szValue, 20, szIniFile);
|
||||
Conf->Options= (u32)strtoul(szValue, NULL, 10);
|
||||
Conf.Options= (u32)strtoul(szValue, NULL, 10);
|
||||
|
||||
if ( GetPrivateProfileString("Cpu Options", "sseMXCSR", NULL, szValue, 20, szIniFile) ) {
|
||||
Conf->sseMXCSR = strtoul(szValue, NULL, 0);
|
||||
g_sseMXCSR = Conf->sseMXCSR;
|
||||
Conf.sseMXCSR = strtoul(szValue, NULL, 0);
|
||||
g_sseMXCSR = Conf.sseMXCSR;
|
||||
}
|
||||
else Config.sseMXCSR = g_sseMXCSR;
|
||||
|
||||
if ( GetPrivateProfileString("Cpu Options", "sseVUMXCSR", NULL, szValue, 20, szIniFile) ) {
|
||||
Conf->sseVUMXCSR = strtoul(szValue, NULL, 0);
|
||||
g_sseVUMXCSR = Conf->sseVUMXCSR;
|
||||
Conf.sseVUMXCSR = strtoul(szValue, NULL, 0);
|
||||
g_sseVUMXCSR = Conf.sseVUMXCSR;
|
||||
}
|
||||
else Config.sseVUMXCSR = g_sseVUMXCSR;
|
||||
|
||||
GetPrivateProfileString("Cpu Options", "eeOptions", NULL, szValue, 20, szIniFile);
|
||||
Conf->eeOptions = strtoul(szValue, NULL, 0);
|
||||
Conf.eeOptions = strtoul(szValue, NULL, 0);
|
||||
GetPrivateProfileString("Cpu Options", "vuOptions", NULL, szValue, 20, szIniFile);
|
||||
Conf->vuOptions = strtoul(szValue, NULL, 0);
|
||||
Conf.vuOptions = strtoul(szValue, NULL, 0);
|
||||
|
||||
//Misc
|
||||
GetPrivateProfileString("Misc", "Patch", NULL, szValue, 20, szIniFile);
|
||||
Conf->Patch = strtoul(szValue, NULL, 10);
|
||||
Conf.Patch = !!strtoul(szValue, NULL, 10);
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
GetPrivateProfileString("Misc", "varLog", NULL, szValue, 20, szIniFile);
|
||||
varLog = strtoul(szValue, NULL, 16);
|
||||
#endif
|
||||
GetPrivateProfileString("Misc", "Hacks", NULL, szValue, 20, szIniFile);
|
||||
Conf->Hacks = strtoul(szValue, NULL, 0);
|
||||
Conf.Hacks = strtoul(szValue, NULL, 0);
|
||||
GetPrivateProfileString("Misc", "GameFixes", NULL, szValue, 20, szIniFile);
|
||||
Conf->GameFixes = strtoul(szValue, NULL, 0);
|
||||
Conf.GameFixes = strtoul(szValue, NULL, 0);
|
||||
|
||||
// Remove Fast Branches hack for now:
|
||||
Conf->Hacks &= ~0x80;
|
||||
Conf.Hacks &= ~0x80;
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
{
|
||||
char text[256];
|
||||
extern int _nl_msg_cat_cntr;
|
||||
sprintf_s(text, 256, "LANGUAGE=%s", Conf->Lang);
|
||||
sprintf_s(text, 256, "LANGUAGE=%s", Conf.Lang);
|
||||
gettext_putenv(text);
|
||||
}
|
||||
#endif
|
||||
|
@ -176,7 +179,7 @@ int LoadConfig()
|
|||
|
||||
void SaveConfig()
|
||||
{
|
||||
const PcsxConfig* Conf = &Config;
|
||||
const PcsxConfig& Conf = Config;
|
||||
char szIniFile[g_MaxPath], szValue[g_MaxPath];
|
||||
|
||||
//GetModuleFileName(GetModuleHandle((LPCSTR)gApp.hInstance), szIniFile, 256);
|
||||
|
@ -189,29 +192,31 @@ void SaveConfig()
|
|||
if( g_Error_PathTooLong ) return;
|
||||
|
||||
//interface
|
||||
sprintf(szValue,"%s",Conf->Bios);
|
||||
sprintf(szValue,"%s",Conf.Bios);
|
||||
WritePrivateProfileString("Interface","Bios",szValue,szIniFile);
|
||||
sprintf(szValue,"%s",Conf->Lang);
|
||||
sprintf(szValue,"%s",Conf.Lang);
|
||||
WritePrivateProfileString("Interface","Lang",szValue,szIniFile);
|
||||
sprintf(szValue,"%s",Conf->PluginsDir);
|
||||
sprintf(szValue,"%s",Conf.PluginsDir);
|
||||
WritePrivateProfileString("Interface","PluginsDir",szValue,szIniFile);
|
||||
sprintf(szValue,"%s",Conf->BiosDir);
|
||||
sprintf(szValue,"%s",Conf.BiosDir);
|
||||
WritePrivateProfileString("Interface","BiosDir",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->PsxOut);
|
||||
sprintf(szValue,"%u",(int)Conf.PsxOut);
|
||||
WritePrivateProfileString("Interface","Ps2Out",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->ThPriority);
|
||||
WritePrivateProfileString("Interface","ThPriority",szValue,szIniFile);
|
||||
sprintf(szValue,"%s",Conf->Mcd1);
|
||||
sprintf(szValue,"%u",(int)Conf.Profiler);
|
||||
WritePrivateProfileString("Interface","Profiler",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf.ThPriority);
|
||||
WritePrivateProfileString("Interface","ThPriority",szValue,szIniFile);
|
||||
sprintf(szValue,"%s",Conf.Mcd1);
|
||||
WritePrivateProfileString("Interface","Mcd1",szValue,szIniFile);
|
||||
sprintf(szValue,"%s",Conf->Mcd2);
|
||||
sprintf(szValue,"%s",Conf.Mcd2);
|
||||
WritePrivateProfileString("Interface","Mcd2",szValue,szIniFile);
|
||||
sprintf(szValue,"%d",Conf->CustomFps);
|
||||
sprintf(szValue,"%d",Conf.CustomFps);
|
||||
WritePrivateProfileString("Interface", "CustomFps", szValue, szIniFile);
|
||||
sprintf(szValue,"%d",Conf->CustomFrameSkip);
|
||||
sprintf(szValue,"%d",Conf.CustomFrameSkip);
|
||||
WritePrivateProfileString("Interface", "CustomFrameskip", szValue, szIniFile);
|
||||
sprintf(szValue,"%d",Conf->CustomConsecutiveFrames);
|
||||
sprintf(szValue,"%d",Conf.CustomConsecutiveFrames);
|
||||
WritePrivateProfileString("Interface", "CustomConsecutiveFrames", szValue, szIniFile);
|
||||
sprintf(szValue,"%d",Conf->CustomConsecutiveSkip);
|
||||
sprintf(szValue,"%d",Conf.CustomConsecutiveSkip);
|
||||
WritePrivateProfileString("Interface", "CustomConsecutiveSkip", szValue, szIniFile);
|
||||
|
||||
// Plugins are saved from the winConfig struct.
|
||||
|
@ -236,25 +241,25 @@ void SaveConfig()
|
|||
WritePrivateProfileString("Plugins","FW",szValue,szIniFile);
|
||||
|
||||
//cpu
|
||||
sprintf(szValue,"%u", Conf->Options);
|
||||
sprintf(szValue,"%u", Conf.Options);
|
||||
WritePrivateProfileString("Cpu Options","Options",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->sseMXCSR);
|
||||
sprintf(szValue,"%u",Conf.sseMXCSR);
|
||||
WritePrivateProfileString("Cpu Options","sseMXCSR",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->sseVUMXCSR);
|
||||
sprintf(szValue,"%u",Conf.sseVUMXCSR);
|
||||
WritePrivateProfileString("Cpu Options","sseVUMXCSR",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->eeOptions);
|
||||
sprintf(szValue,"%u",Conf.eeOptions);
|
||||
WritePrivateProfileString("Cpu Options","eeOptions",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->vuOptions);
|
||||
sprintf(szValue,"%u",Conf.vuOptions);
|
||||
WritePrivateProfileString("Cpu Options","vuOptions",szValue,szIniFile);
|
||||
|
||||
//Misc
|
||||
sprintf(szValue,"%u",Conf->Patch);
|
||||
sprintf(szValue,"%u",(int)Conf.Patch);
|
||||
WritePrivateProfileString("Misc","Patch",szValue,szIniFile);
|
||||
sprintf(szValue,"%x",varLog);
|
||||
WritePrivateProfileString("Misc","varLog",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->Hacks);
|
||||
sprintf(szValue,"%u",Conf.Hacks);
|
||||
WritePrivateProfileString("Misc","Hacks",szValue,szIniFile);
|
||||
sprintf(szValue,"%u",Conf->GameFixes);
|
||||
sprintf(szValue,"%u",Conf.GameFixes);
|
||||
WritePrivateProfileString("Misc","GameFixes",szValue,szIniFile);
|
||||
|
||||
}
|
||||
|
|
|
@ -1577,10 +1577,9 @@ BEGIN
|
|||
CONTROL "VUMicro log",IDC_VUMICROLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,110,55,10
|
||||
CONTROL "RPC services log",IDC_RPCSERVICES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,125,67,10
|
||||
CONTROL "Log to STDOUT",IDC_STDOUTPUTLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,125,68,10
|
||||
CONTROL "Log",IDC_LOGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,140,28,10
|
||||
CONTROL "Symbols log",IDC_SYMLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,140,53,10
|
||||
CONTROL "Counters log",IDC_IOPCNTLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,165,118,55,10
|
||||
CONTROL "EE Counters log",IDC_EECNTLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,165,139,73,11
|
||||
CONTROL "EE Counters log",IDC_EECNTLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,140,64,11
|
||||
END
|
||||
|
||||
IDD_IOP_DEBUG DIALOGEX 0, 0, 358, 107
|
||||
|
|
|
@ -705,6 +705,7 @@
|
|||
#define ID_SPU2HACK 40061
|
||||
#define ID_VSYNCRATE 40062
|
||||
#define ID_HELP_HELP 40063
|
||||
#define ID_PROFILER 40066
|
||||
#define ID_CHEAT_FINDER_SHOW 40100
|
||||
#define ID_CHEAT_BROWSER_SHOW 40101
|
||||
#define ID_HACKS 40102
|
||||
|
@ -719,6 +720,6 @@
|
|||
#define _APS_NEXT_RESOURCE_VALUE 141
|
||||
#define _APS_NEXT_COMMAND_VALUE 40018
|
||||
#define _APS_NEXT_CONTROL_VALUE 1309
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#define _APS_NEXT_SYMED_VALUE 103
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -114,7 +114,7 @@ void _recvuFMACflush(VURegs * VU) {
|
|||
if (VU->fmac[i].enable == 0) continue;
|
||||
|
||||
if ((vucycle - VU->fmac[i].sCycle) >= VU->fmac[i].Cycle) {
|
||||
// if (Log) { VUM_LOG("flushing FMAC pipe[%d]\n", i); }
|
||||
// VUM_LOG("flushing FMAC pipe[%d]\n", i);
|
||||
VU->fmac[i].enable = 0;
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ void _recvuFMACAdd(VURegs * VU, int reg, int xyzw) {
|
|||
}
|
||||
|
||||
if (i==8) SysPrintf("*PCSX2*: error , out of fmacs\n");
|
||||
// if (Log) { VUM_LOG("adding FMAC pipe[%d]; reg %d\n", i, reg); }
|
||||
// VUM_LOG("adding FMAC pipe[%d]; reg %d\n", i, reg);
|
||||
|
||||
VU->fmac[i].enable = 1;
|
||||
VU->fmac[i].sCycle = vucycle;
|
||||
|
|
Loading…
Reference in New Issue