From 3957d1520cbcfda340176da92a0dd4f69f5bdee6 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Fri, 2 Jan 2009 21:27:11 +0000 Subject: [PATCH] Win32: Green colors now work in the console! Yay! (so important! heh) Fixed some project file options in the plugins, and started converting all the old SysPrintf's over to color coded Console messages. (but there's... so... many... >_<) Also, interchanged the meanings of WriteLn and MsgLn since I kind of had them backwards from what I originally intended. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@543 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/CDVD.cpp | 30 +-- pcsx2/CDVDiso.cpp | 29 +-- pcsx2/COP0.cpp | 2 +- pcsx2/Counters.cpp | 2 +- pcsx2/Elfheader.cpp | 18 +- pcsx2/FiFo.cpp | 2 +- pcsx2/GS.cpp | 6 +- pcsx2/Interpreter.cpp | 4 +- pcsx2/Linux/LnxConsole.cpp | 38 ++-- pcsx2/Linux/LnxMain.cpp | 2 +- pcsx2/MTGS.cpp | 8 +- pcsx2/Memory.cpp | 4 +- pcsx2/Misc.cpp | 12 +- pcsx2/Patch.cpp | 16 +- pcsx2/Patch.h | 2 +- pcsx2/PsxBios.cpp | 6 +- pcsx2/PsxInterpreter.cpp | 6 +- pcsx2/SaveState.cpp | 12 +- pcsx2/Sif.cpp | 17 +- pcsx2/SourceLog.cpp | 4 +- pcsx2/System.cpp | 12 +- pcsx2/System.h | 22 +- pcsx2/VU0micro.cpp | 2 +- pcsx2/windows/ConfigDlg.cpp | 209 +++++++++++------- pcsx2/windows/Console.cpp | 53 +++-- pcsx2/windows/McdsDlg.cpp | 4 +- pcsx2/windows/SamplProf.cpp | 8 +- pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 12 +- pcsx2/windows/WinMain.cpp | 8 +- pcsx2/windows/WinSysExec.cpp | 7 +- pcsx2/windows/WinVM.cpp | 12 +- pcsx2/x86/iCore.cpp | 2 +- pcsx2/x86/iFPU.cpp | 38 ++-- pcsx2/x86/iHw.cpp | 18 +- pcsx2/x86/iMMI.cpp | 2 +- pcsx2/x86/iR3000A.cpp | 7 +- pcsx2/x86/iVUzerorec.cpp | 4 +- pcsx2/x86/ir5900tables.cpp | 6 +- pcsx2/x86/ix86-32/iCore-32.cpp | 4 +- pcsx2/x86/ix86-32/iR5900-32.cpp | 22 +- pcsx2/x86/ix86-32/iR5900Branch.cpp | 7 - pcsx2/x86/ix86-32/iR5900LoadStore.cpp | 2 +- pcsx2/x86/ix86/ix86.cpp | 12 +- pcsx2/xmlpatchloader.cpp | 2 - .../CDVDiso/src/Win32/CDVDiso_vs2008.vcproj | 8 - plugins/spu2ghz/SPU2ghz_vs2008.vcproj | 8 - plugins/zerogs/dx/Win32/aviUtil.h | 10 +- plugins/zerogs/dx/Win32/zerogs_2008.vcproj | 11 - plugins/zerospu2/ZeroSPU2_2008.vcproj | 8 - 49 files changed, 380 insertions(+), 360 deletions(-) diff --git a/pcsx2/CDVD.cpp b/pcsx2/CDVD.cpp index 3383172839..1034734b61 100644 --- a/pcsx2/CDVD.cpp +++ b/pcsx2/CDVD.cpp @@ -208,7 +208,7 @@ static void cdvdSetIrq( uint id = (1<filename, localTocEntry.filename); memcpy(tocEntry->date, localTocEntry.date, 7); -#ifdef DEBUG - SysPrintf("CDVD_findfile: found file\n"); -#endif + DbgCon::MsgLn("CDVD_findfile: found file"); return TRUE; } @@ -477,7 +474,7 @@ int CDVD_findfile(const char* fname, TocEntry* tocEntry){ dir_lba++; if (CdRead(dir_lba,1,toc,&cdReadMode) != TRUE){ - SysPrintf("Couldn't Read from CD !\n"); + Console::Error("Couldn't Read from CD !"); return -1; } // CdSync(0x00); @@ -486,9 +483,7 @@ int CDVD_findfile(const char* fname, TocEntry* tocEntry){ } } -#ifdef DEBUG - SysPrintf("CDVD_findfile: could not find file\n"); -#endif + DbgCon::Notice("CDVD_findfile: could not find file"); return FALSE; } diff --git a/pcsx2/COP0.cpp b/pcsx2/COP0.cpp index 0c3f57d5f1..f31f322398 100644 --- a/pcsx2/COP0.cpp +++ b/pcsx2/COP0.cpp @@ -226,7 +226,7 @@ void MapTLB(int i) u32 saddr, eaddr; #ifndef PCSX2_VIRTUAL_MEM - DevCon::MsgLn("MAP TLB %d: %08x-> [%08x %08x] S=%d G=%d ASID=%d Mask= %03X", + DevCon::WriteLn("MAP TLB %d: %08x-> [%08x %08x] S=%d G=%d ASID=%d Mask= %03X", i,tlb[i].VPN2,tlb[i].PFN0,tlb[i].PFN1,tlb[i].S,tlb[i].G,tlb[i].ASID,tlb[i].Mask); if (tlb[i].S) diff --git a/pcsx2/Counters.cpp b/pcsx2/Counters.cpp index 8fbf43fb89..a7a40ee3e2 100644 --- a/pcsx2/Counters.cpp +++ b/pcsx2/Counters.cpp @@ -332,7 +332,7 @@ void vSyncDebugStuff() { if( --g_nLeftGSFrames <= 0 ) { safe_delete( g_fGSSave ); g_SaveGSStream = 0; - Console::WriteLn("Done saving GS stream"); + Console::MsgLn("Done saving GS stream"); } } #endif diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp index f12438b7dd..aef4facfb9 100644 --- a/pcsx2/Elfheader.cpp +++ b/pcsx2/Elfheader.cpp @@ -487,7 +487,7 @@ struct ElfObject SymNames = (char*)data.GetPtr( secthead[ i_dt ].sh_offset ); eS = (Elf32_Sym*)data.GetPtr( secthead[ i_st ].sh_offset ); - Console::MsgLn("found %d symbols", secthead[ i_st ].sh_size / sizeof( Elf32_Sym )); + Console::WriteLn("found %d symbols", secthead[ i_st ].sh_size / sizeof( Elf32_Sym )); for( uint i = 1; i < ( secthead[ i_st ].sh_size / sizeof( Elf32_Sym ) ); i++ ) { if ( ( eS[ i ].st_value != 0 ) && ( ELF32_ST_TYPE( eS[ i ].st_info ) == 2 ) ) { @@ -511,11 +511,11 @@ void ElfApplyPatches() if(LoadPatch( str ) != 0) { - Console::WriteLn("XML Loader returned an error. Trying to load a pnatch..."); + Console::MsgLn("XML Loader returned an error. Trying to load a pnatch..."); inifile_read(str); } else - Console::WriteLn("XML Loading success. Will not load from pnatch..."); + Console::MsgLn("XML Loading success. Will not load from pnatch..."); applypatch( 0 ); } @@ -529,9 +529,9 @@ void loadElfCRC( const char* filename ) if ( CDVD_findfile( filename + strlen( "cdromN:" ), &toc ) == -1 ) return; - DevCon::MsgLn( Color_Green, "loadElfFile: %d bytes", toc.fileSize); + DevCon::WriteLn( Color_Green, "loadElfFile: %d bytes", toc.fileSize); ElfCRC = ElfObject( filename, toc.fileSize ).GetCRC(); - Console::MsgLn( Color_Green, "loadElfFile: %s; CRC = %8.8X\n", filename, ElfCRC); + Console::WriteLn( Color_Green, "loadElfFile: %s; CRC = %8.8X\n", filename, ElfCRC); ElfApplyPatches(); LoadGameSpecificSettings(); @@ -547,7 +547,7 @@ int loadElfFile(const char *filename) int elfsize; - Console::MsgLn("loadElfFile: %s", filename); + Console::WriteLn("loadElfFile: %s", filename); if (strnicmp( filename, "cdrom0:", strlen( "cdromN:" ) ) && strnicmp( filename, "cdrom1:", strlen( "cdromN:" ) ) ) { @@ -567,7 +567,7 @@ int loadElfFile(const char *filename) elfsize = toc.fileSize; } - Console::MsgLn( Color_Green, "loadElfFile: %d", elfsize); + Console::WriteLn( Color_Green, "loadElfFile: %d", elfsize); ElfObject elfobj( filename, elfsize ); //2002-09-19 (Florin) @@ -586,12 +586,12 @@ int loadElfFile(const char *filename) for ( uint i = 0; i < 0x100000; i++ ) { if ( strcmp( "rom0:OSDSYS", (char*)PSM( i ) ) == 0 ) { strcpy( (char*)PSM( i ), filename ); - SysPrintf( "addr %x \"%s\" -> \"%s\"\n", i, "rom0:OSDSYS", filename ); + Console::WriteLn( Color_Green, "addr %x \"%s\" -> \"%s\"", i, "rom0:OSDSYS", filename ); } } ElfCRC = elfobj.GetCRC(); - Console::MsgLn( Color_Green, "loadElfFile: %s; CRC = %8.8X\n", filename, ElfCRC); + Console::WriteLn( Color_Green, "loadElfFile: %s; CRC = %8.8X\n", filename, ElfCRC); ElfApplyPatches(); LoadGameSpecificSettings(); diff --git a/pcsx2/FiFo.cpp b/pcsx2/FiFo.cpp index 7e22e73160..f40f981f78 100644 --- a/pcsx2/FiFo.cpp +++ b/pcsx2/FiFo.cpp @@ -139,7 +139,7 @@ void WriteFIFO(u32 mem, const u64 *value) { //commiting every 16 bytes while( FIFOto_write((u32*)value, 1) == 0 ) { - Console::WriteLn("IPU sleeping"); + Console::MsgLn("IPU sleeping"); Threading::Timeslice(); } } else { diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index 69ce546eb5..29fc77d77b 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -167,14 +167,14 @@ void gsSetVideoRegionType( u32 isPal ) if( isPal ) { if( Config.PsxType & 1 ) return; - Console::WriteLn( "PAL Display Mode Initialized." ); + Console::MsgLn( "PAL Display Mode Initialized." ); Config.PsxType |= 1; framerate = FRAMERATE_PAL; } else { if( !(Config.PsxType & 1 ) ) return; - Console::WriteLn( "NTSC Display Mode Initialized." ); + Console::MsgLn( "NTSC Display Mode Initialized." ); Config.PsxType &= ~1; framerate = FRAMERATE_NTSC; } @@ -194,7 +194,7 @@ void gsInit() if( GSsetFrameSkip == NULL ) { Config.Options &= ~PCSX2_FRAMELIMIT_MASK; - Console::WriteLn("Notice: Disabling frameskip -- GS plugin does not support it."); + Console::MsgLn("Notice: Disabling frameskip -- GS plugin does not support it."); } break; } diff --git a/pcsx2/Interpreter.cpp b/pcsx2/Interpreter.cpp index 3979321c86..fc375877d5 100644 --- a/pcsx2/Interpreter.cpp +++ b/pcsx2/Interpreter.cpp @@ -834,7 +834,7 @@ int __Deci2Call(int call, u32 *addr) { return 1; case 0x10://kputs - Console::Msg( Color_Cyan, "%s", PSM(*addr)); + Console::Write( Color_Cyan, "%s", PSM(*addr)); return 1; } @@ -851,7 +851,7 @@ void SYSCALL() { else call = cpuRegs.GPR.n.v1.UC[0]; BIOS_LOG("Bios call: %s (%x)\n", bios[call], call); if (call == 0x7c && cpuRegs.GPR.n.a0.UL[0] == 0x10) { - Console::Msg( Color_Cyan, "%s", PSM(PSMu32(cpuRegs.GPR.n.a1.UL[0]))); + Console::Write( Color_Cyan, "%s", PSM(PSMu32(cpuRegs.GPR.n.a1.UL[0]))); } else //if (call == 0x7c) SysPrintf("Deci2Call: %x\n", cpuRegs.GPR.n.a0.UL[0]); if (call == 0x7c) __Deci2Call(cpuRegs.GPR.n.a0.UL[0], (u32*)PSM(cpuRegs.GPR.n.a1.UL[0])); diff --git a/pcsx2/Linux/LnxConsole.cpp b/pcsx2/Linux/LnxConsole.cpp index d83af06bbe..cf89c807e0 100644 --- a/pcsx2/Linux/LnxConsole.cpp +++ b/pcsx2/Linux/LnxConsole.cpp @@ -49,7 +49,7 @@ namespace Console { } - __forceinline bool __fastcall WriteLn() + __forceinline bool __fastcall Newline() { if (Config.PsxOut != 0) puts( "\n" ); @@ -63,7 +63,7 @@ namespace Console return false; } - __forceinline bool __fastcall Write( const char* fmt ) + __forceinline bool __fastcall Msg( const char* fmt ) { if (Config.PsxOut != 0) puts( fmt ); @@ -77,22 +77,22 @@ namespace Console void __fastcall SetColor( Colors color ) { - Write( tbl_color_codes[color] ); + Msg( tbl_color_codes[color] ); } void ClearColor() { - Write( COLOR_RESET ); + Msg( COLOR_RESET ); } - __forceinline bool __fastcall WriteLn( const char* fmt ) + __forceinline bool __fastcall MsgLn( const char* fmt ) { - Write( fmt ); - WriteLn(); + Msg( fmt ); + Newline(); return false; } - static __forceinline void __fastcall _MsgLn( Colors color, const char* fmt, va_list args ) + static __forceinline void __fastcall _WriteLn( Colors color, const char* fmt, va_list args ) { char msg[2048]; @@ -100,7 +100,7 @@ namespace Console msg[2044] = '\0'; strcat( msg, "\n" ); SetColor( color ); - Write( msg ); + Msg( msg ); ClearColor(); if( emuLog != NULL ) @@ -108,16 +108,16 @@ namespace Console } // Writes a line of colored text to the console, with automatic newline appendage. - bool MsgLn( Colors color, const char* fmt, ... ) + bool WriteLn( Colors color, const char* fmt, ... ) { va_list list; va_start(list,fmt); - _MsgLn( Color_White, fmt, list ); + _WriteLn( Color_White, fmt, list ); va_end(list); return false; } - bool Msg( Colors color, const char* fmt, ... ) + bool Write( Colors color, const char* fmt, ... ) { va_list list; char msg[2048]; @@ -128,12 +128,12 @@ namespace Console va_end(list); SetColor( color ); - Write( msg ); + Msg( msg ); ClearColor(); return false; } - bool Msg( const char* fmt, ... ) + bool Write( const char* fmt, ... ) { va_list list; char msg[2048]; @@ -143,11 +143,11 @@ namespace Console msg[2047] = '\0'; va_end(list); - Write( msg ); + Msg( msg ); return false; } - bool MsgLn( const char* fmt, ... ) + bool WriteLn( const char* fmt, ... ) { va_list list; char msg[2048]; @@ -157,7 +157,7 @@ namespace Console va_end(list); strcat( msg, "\n" ); // yeah, that newline! - Write( msg ); + Msg( msg ); if( emuLog != NULL ) fflush( emuLog ); // manual flush to accomany manual newline return false; @@ -169,7 +169,7 @@ namespace Console { va_list list; va_start(list,fmt); - _MsgLn( Color_Red, fmt, list ); + _WriteLn( Color_Red, fmt, list ); va_end(list); return false; } @@ -180,7 +180,7 @@ namespace Console { va_list list; va_start(list,fmt); - _MsgLn( Color_Yellow, fmt, list ); + _WriteLn( Color_Yellow, fmt, list ); va_end(list); return false; } diff --git a/pcsx2/Linux/LnxMain.cpp b/pcsx2/Linux/LnxMain.cpp index bfdeeb5836..0247fe87c7 100644 --- a/pcsx2/Linux/LnxMain.cpp +++ b/pcsx2/Linux/LnxMain.cpp @@ -470,7 +470,7 @@ void SysPrintf(const char *fmt, ...) { msg[511] = '\0'; va_end(list); - Console::Write( msg ); + Console::Msg( msg ); } void *SysLoadLibrary(const char *lib) { diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index ca4c617ff8..46f02edc25 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -217,7 +217,7 @@ mtgsThreadObject::mtgsThreadObject() : mtgsThreadObject::~mtgsThreadObject() { - Console::WriteLn( "MTGS > Closing GS thread..." ); + Console::MsgLn( "MTGS > Closing GS thread..." ); SetEvent(); // rest of the cleanup will be handled by the inherited object destructors... @@ -395,7 +395,7 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u if(!path.tag.eop && path.tag.nloop > 0) { path.tag.nloop = 0; - DevCon::Write( "path1 hack! " ); + DevCon::Msg( "path1 hack! " ); } } @@ -404,12 +404,12 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u int mtgsThreadObject::Callback() { - Console::WriteLn("MTGS > Thread Started, Opening GS Plugin..."); + Console::MsgLn("MTGS > Thread Started, Opening GS Plugin..."); m_returncode = GSopen((void *)&pDsp, "PCSX2", 1); GSCSRr = 0x551B400F; // 0x55190000 m_wait_InitDone.Set(); if (m_returncode != 0) { return m_returncode; } // error msg will be issued to the user by Plugins.c - Console::WriteLn("MTGS > GSopen Finished."); + Console::MsgLn("MTGS > GSopen Finished."); #ifdef RINGBUF_DEBUG_STACK u32 prevCmd=0; diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index e90238eb16..b0f82b3bb9 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -2807,7 +2807,7 @@ void memReset() fclose(fp); BiosVersion = GetBiosVersion(); - Console::MsgLn("Bios Version %d.%d", BiosVersion >> 8, BiosVersion & 0xff); + Console::WriteLn("Bios Version %d.%d", BiosVersion >> 8, BiosVersion & 0xff); //injectIRX("host.irx"); //not fully tested; still buggy @@ -2881,7 +2881,7 @@ void mmap_MarkCountedRamPage(void* ptr,u32 vaddr) } void mmap_ResetBlockTracking() { - Console::WriteLn("vtlb/mmap: Block Tracking reseted .."); + Console::MsgLn("vtlb/mmap: Block Tracking reseted .."); memset(psMPWC,0,sizeof(psMPWC)); for(u32 i=0;i<(Ps2MemSize::Base>>12);i++) { diff --git a/pcsx2/Misc.cpp b/pcsx2/Misc.cpp index b3a39f48ca..dc0e768be7 100644 --- a/pcsx2/Misc.cpp +++ b/pcsx2/Misc.cpp @@ -351,7 +351,7 @@ int GetPS2ElfName(char *name){ u32 addr; - Console::WriteLn("Loading System.map..."); + Console::MsgLn("Loading System.map..."); while (!feof(fp)) { fseek(fp, 8, SEEK_CUR); buffer[0] = '0'; buffer[1] = 'x'; @@ -381,7 +381,7 @@ void SaveGSState(const char *file) { if( g_SaveGSStream ) return; - Console::Write( "SaveGSState: " ); Console::WriteLn( file ); + Console::Msg( "SaveGSState: " ); Console::MsgLn( file ); g_fGSSave = new gzSavingState( file ); g_SaveGSStream = 1; @@ -396,12 +396,12 @@ void LoadGSState(const char *file) int ret; gzLoadingState* f; - Console::Write( "LoadGSState: " ); + Console::Msg( "LoadGSState: " ); try { f = new gzLoadingState( file ); - Console::WriteLn( file ); + Console::MsgLn( file ); } catch( Exception::FileNotFound& ) { @@ -411,7 +411,7 @@ void LoadGSState(const char *file) char strfile[g_MaxPath]; CombinePaths( strfile, SSTATES_DIR, file ); f = new gzLoadingState( file ); - Console::WriteLn( strfile ); + Console::MsgLn( strfile ); // If this load attempt fails, then let the exception bubble up to // the caller to deal with... @@ -654,7 +654,7 @@ void ProcessFKeys(int fkey, int shift) ppblocks++; } fclose(f); - SysPrintf("perflog.txt written\n"); + Console::Status( "perflog.txt written" ); break; } diff --git a/pcsx2/Patch.cpp b/pcsx2/Patch.cpp index 18fc1fa6a9..256dd3118a 100644 --- a/pcsx2/Patch.cpp +++ b/pcsx2/Patch.cpp @@ -346,7 +346,7 @@ void applypatch(int place) { int i; if (place == 0) { - SysPrintf(" patchnumber: %d\n", patchnumber); + Console::WriteLn(" patchnumber: %d", patchnumber); } for ( i = 0; i < patchnumber; i++ ) { @@ -356,13 +356,13 @@ void applypatch(int place) { void patchFunc_comment( char * text1, char * text2 ) { - SysPrintf( "comment: %s \n", text2 ); + Console::WriteLn( "comment: %s", text2 ); } void patchFunc_gametitle( char * text1, char * text2 ) { - SysPrintf( "gametitle: %s \n", text2 ); + Console::WriteLn( "gametitle: %s", text2 ); sprintf(strgametitle,"%s",text2); Console::SetTitle(strgametitle); } @@ -373,7 +373,7 @@ void patchFunc_patch( char * cmd, char * param ) if ( patchnumber >= MAX_PATCH ) { - SysPrintf( "Patch ERROR: Maximum number of patches reached: %s=%s\n", cmd, param ); + Console::Error( "Patch ERROR: Maximum number of patches reached: %s=%s", cmd, param ); return; } @@ -387,7 +387,7 @@ void patchFunc_patch( char * cmd, char * param ) patch[ patchnumber ].cpu = (patch_cpu_type)PatchTableExecute( pText, NULL, cpuCore ); if ( patch[ patchnumber ].cpu == 0 ) { - SysPrintf( "Unrecognized patch '%s'\n", pText ); + Console::Error( "Unrecognized patch '%s'", pText ); return; } @@ -400,7 +400,7 @@ void patchFunc_patch( char * cmd, char * param ) patch[ patchnumber ].type = (patch_data_type)PatchTableExecute( pText, NULL, dataType ); if ( patch[ patchnumber ].type == 0 ) { - SysPrintf( "Unrecognized patch '%s'\n", pText ); + Console::Error( "Unrecognized patch '%s'", pText ); return; } @@ -522,7 +522,7 @@ void inifile_read( char * name ) if( !f1 ) { - SysPrintf( _( "No patch found.Resuming execution without a patch (this is NOT an error).\n" )); + Console::MsgLn( _( "No patch found.Resuming execution without a patch (this is NOT an error)." )); return; } @@ -541,7 +541,7 @@ int AddPatch(int Mode, int Place, int Address, int Size, u64 data) if ( patchnumber >= MAX_PATCH ) { - SysPrintf( "Patch ERROR: Maximum number of patches reached.\n"); + Console::Error( "Patch ERROR: Maximum number of patches reached."); return -1; } diff --git a/pcsx2/Patch.h b/pcsx2/Patch.h index 4aa365dd90..80db33d882 100644 --- a/pcsx2/Patch.h +++ b/pcsx2/Patch.h @@ -35,7 +35,7 @@ while ( *param && ( *param != ',' ) ) param++; \ if ( *param ) param++; \ while ( *param && ( *param == ' ' ) ) param++; \ - if ( *param == 0 ) { SysPrintf( _( "Not enough params for inicommand\n" ) ); return; } + if ( *param == 0 ) { Console::Error( _( "Not enough params for inicommand" ) ); return; } // // Enums diff --git a/pcsx2/PsxBios.cpp b/pcsx2/PsxBios.cpp index 4546fd244e..e821d5a5fc 100644 --- a/pcsx2/PsxBios.cpp +++ b/pcsx2/PsxBios.cpp @@ -249,18 +249,18 @@ _start: memcpy((char*)PSXM(sp), save, 4*4); - Console::Msg( Color_Cyan, "%s", tmp); + Console::Write( Color_Cyan, "%s", tmp); pc0 = ra; } void bios_putchar () { // 3d - Console::Msg( Color_Cyan, "%c", a0 ); + Console::Write( Color_Cyan, "%c", a0 ); pc0 = ra; } void bios_puts () { // 3e/3f - Console::Msg( Color_Cyan, Ra0 ); + Console::Write( Color_Cyan, Ra0 ); pc0 = ra; } diff --git a/pcsx2/PsxInterpreter.cpp b/pcsx2/PsxInterpreter.cpp index 91d24c4bad..81437a94bc 100644 --- a/pcsx2/PsxInterpreter.cpp +++ b/pcsx2/PsxInterpreter.cpp @@ -270,15 +270,15 @@ void zeroEx() } if (!strncmp(lib, "loadcore", 8) && code == 6) { - DevCon::MsgLn("loadcore RegisterLibraryEntries (%x): %8.8s", psxRegs.pc, PSXM(psxRegs.GPR.n.a0+12)); + DevCon::WriteLn("loadcore RegisterLibraryEntries (%x): %8.8s", psxRegs.pc, PSXM(psxRegs.GPR.n.a0+12)); } if (!strncmp(lib, "intrman", 7) && code == 4) { - DevCon::MsgLn("intrman RegisterIntrHandler (%x): intr %s, handler %x", psxRegs.pc, intrname[psxRegs.GPR.n.a0], psxRegs.GPR.n.a2); + DevCon::WriteLn("intrman RegisterIntrHandler (%x): intr %s, handler %x", psxRegs.pc, intrname[psxRegs.GPR.n.a0], psxRegs.GPR.n.a2); } if (!strncmp(lib, "sifcmd", 6) && code == 17) { - DevCon::MsgLn("sifcmd sceSifRegisterRpc (%x): rpc_id %x", psxRegs.pc, psxRegs.GPR.n.a1); + DevCon::WriteLn("sifcmd sceSifRegisterRpc (%x): rpc_id %x", psxRegs.pc, psxRegs.GPR.n.a1); } if (!strncmp(lib, "sysclib", 8)) diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index bf7b74537b..1f64700662 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -76,7 +76,7 @@ void SaveState::GetFilename( char* dest, int slot ) SaveState::SaveState( const char* msg, const char* destination ) : m_version( g_SaveVersion ) { - Console::MsgLn( "%s %s", msg, destination ); + Console::WriteLn( "%s %s", msg, destination ); } void SaveState::FreezeAll() @@ -199,7 +199,7 @@ gzLoadingState::gzLoadingState( const char* filename ) : // pcsx2 vm supports opening these formats if( m_version < 0x7a30000d ) { - Console::MsgLn( "Unsupported or unrecognized savestate version: %x.", m_version ); + Console::WriteLn( "Unsupported or unrecognized savestate version: %x.", m_version ); throw Exception::UnsupportedStateVersion(); } #else @@ -231,7 +231,7 @@ void gzLoadingState::FreezeMem( void* data, int size ) void gzSavingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int mode, freezeData *data) ) { - Console::MsgLn( "\tSaving %s", name ); + Console::WriteLn( "\tSaving %s", name ); freezeData fP = { 0, NULL }; if (freezer(FREEZE_SIZE, &fP) == -1) @@ -257,7 +257,7 @@ void gzSavingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int void gzLoadingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int mode, freezeData *data) ) { freezeData fP = { 0, NULL }; - Console::MsgLn( "\tLoading %s", name ); + Console::WriteLn( "\tLoading %s", name ); gzread(m_file, &fP.size, sizeof(fP.size)); if( fP.size == 0 ) return; @@ -326,7 +326,7 @@ void memLoadingState::FreezeMem( void* data, int size ) void memSavingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int mode, freezeData *data) ) { freezeData fP = { 0, NULL }; - Console::MsgLn( "\tSaving %s", name ); + Console::WriteLn( "\tSaving %s", name ); if( freezer(FREEZE_SIZE, &fP) == -1 ) throw Exception::FreezePluginFailure( name, "saving" ); @@ -347,7 +347,7 @@ void memSavingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int void memLoadingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int mode, freezeData *data) ) { freezeData fP; - Console::MsgLn( "\tLoading %s", name ); + Console::WriteLn( "\tLoading %s", name ); Freeze( fP.size ); if( fP.size == 0 ) return; diff --git a/pcsx2/Sif.cpp b/pcsx2/Sif.cpp index 4cea2309db..3782f6cbe9 100644 --- a/pcsx2/Sif.cpp +++ b/pcsx2/Sif.cpp @@ -196,7 +196,11 @@ __forceinline void SIF0Dma() //HW_DMA9_CHCR &= ~0x01000000; //reset TR flag //psxDmaInterrupt2(2); iopsifbusy[0] = 0; - PSX_INT(IopEvt_SIF0, psxCycles); + + // iop is 1/8th the clock rate of the EE and psxcycles is in words (not quadwords) + // So when we're all done, the equation looks like thus: + PSX_INT(IopEvt_SIF0, ( ( psxCycles*BIAS ) / 4 ) / 8); + //hwIntcIrq(INTC_SBUS); sif0.sifData.data = 0; notDone = 0; @@ -234,14 +238,14 @@ __forceinline void SIF0Dma() SIF0write((u32*)PSXM(HW_DMA9_MADR), wTransfer); HW_DMA9_MADR += wTransfer << 2; //HW_DMA9_BCR = (HW_DMA9_BCR & 0xFFFF) | (((HW_DMA9_BCR >> 16) - wTransfer)<<16); - psxCycles += (wTransfer / 4) * BIAS; // fixme : should be / 16 + psxCycles += wTransfer; sif0.counter -= wTransfer; //notDone = 1; } } - if(eesifbusy[0] == 1) // If EE SIF enabled and there's something to transfer + if(eesifbusy[0] == 1) // If EE SIF enabled and there's something to transfer { int size = sif0dma->qwc; if ((psHu32(DMAC_CTRL) & 0x30) == 0x10) { // STS == fromSIF0 @@ -268,7 +272,7 @@ __forceinline void SIF0Dma() Cpu->Clear(sif0dma->madr, readSize*4); - cycles += readSize * BIAS; // fixme : BIAS is factored in below + cycles += readSize; sif0dma->qwc -= readSize; sif0dma->madr += readSize << 4; @@ -340,7 +344,8 @@ __forceinline void SIF1Dma() if(eesifbusy[1] == 1) // If EE SIF1 is enabled { - if ((psHu32(DMAC_CTRL) & 0xC0) == 0xC0) SIF_LOG("SIF1 stall control\n"); // STS == fromSIF1 + if ((psHu32(DMAC_CTRL) & 0xC0) == 0xC0) + SIF_LOG("SIF1 stall control\n"); // STS == fromSIF1 if(sif1dma->qwc == 0) // If there's no more to transfer { @@ -430,7 +435,7 @@ __forceinline void SIF1Dma() SIF1write(data, qwTransfer << 2); sif1dma->madr += qwTransfer << 4; - cycles += qwTransfer * BIAS; // fixme : BIAS is factored in above + cycles += qwTransfer; // 1 cycle per quadword (BIAS is factored later) sif1dma->qwc -= qwTransfer; } } diff --git a/pcsx2/SourceLog.cpp b/pcsx2/SourceLog.cpp index ba490de7f0..9f657b9fbb 100644 --- a/pcsx2/SourceLog.cpp +++ b/pcsx2/SourceLog.cpp @@ -65,7 +65,7 @@ void __Log( const char* fmt, ... ) if (varLog & 0x80000000) // log to console enabled? { - Console::Write(tmp); + Console::Msg(tmp); } else if( emuLog != NULL ) // manually write to the logfile. { @@ -102,7 +102,7 @@ static __forceinline void _vSourceLog( u16 protocol, u8 source, u32 cpuPc, u32 c if (varLog & 0x80000000) // log to console enabled? { - Console::WriteLn(tmp); + Console::MsgLn(tmp); } else if( emuLog != NULL ) // manually write to the logfile. { diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 98e6826318..3228419134 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -98,8 +98,8 @@ void SysDetect() SetColor( Console::Color_White ); - WriteLn( "x86Init:" ); - MsgLn( + MsgLn( "x86Init:" ); + WriteLn( "\tCPU vendor name = %s\n" "\tFamilyID = %x\n" "\tx86Family = %s\n" @@ -115,8 +115,8 @@ void SysDetect() cpuinfo.x86EFlags ); - WriteLn( "Features:" ); - MsgLn( + MsgLn( "Features:" ); + WriteLn( "\t%sDetected MMX\n" "\t%sDetected SSE\n" "\t%sDetected SSE2\n" @@ -131,8 +131,8 @@ void SysDetect() if ( cpuinfo.x86ID[0] == 'A' ) //AMD cpu { - WriteLn( " Extended AMD Features:" ); - MsgLn( + MsgLn( " Extended AMD Features:" ); + WriteLn( "\t%sDetected MMX2\n" "\t%sDetected 3DNOW\n" "\t%sDetected 3DNOW2\n", diff --git a/pcsx2/System.h b/pcsx2/System.h index e81afb48c0..56844b4c37 100644 --- a/pcsx2/System.h +++ b/pcsx2/System.h @@ -99,29 +99,33 @@ namespace Console // them from different buildypes. The return values are always zero. // Writes a newline to the console. - extern bool __fastcall WriteLn(); + extern bool __fastcall Newline(); // Writes an unformatted string of text to the console (fast!) // No newline is appended. - extern bool __fastcall Write( const char* fmt ); + extern bool __fastcall Msg( const char* fmt ); // Writes an unformatted string of text to the console (fast!) // A newline is automatically appended. - extern bool __fastcall WriteLn( const char* fmt ); + extern bool __fastcall MsgLn( const char* fmt ); + + // Writes an unformatted string of text to the console (fast!) + // A newline is automatically appended, and the console color reset to default. + extern bool __fastcall MsgLn( Colors color, const char* fmt ); // Writes a line of colored text to the console, with automatic newline appendage. // The console color is reset to default when the operation is complete. - extern bool MsgLn( Colors color, const char* fmt, ... ); + extern bool WriteLn( Colors color, const char* fmt, ... ); // Writes a line of colored text to the console (no newline). // The console color is reset to default when the operation is complete. - extern bool Msg( Colors color, const char* fmt, ... ); + extern bool Write( Colors color, const char* fmt, ... ); // Writes a formatted message to the console (no newline) - extern bool Msg( const char* fmt, ... ); + extern bool Write( const char* fmt, ... ); // Writes a formatted message to the console, with appended newline. - extern bool MsgLn( const char* fmt, ... ); + extern bool WriteLn( const char* fmt, ... ); // Displays a message in the console with red emphasis. // Newline is automatically appended. @@ -130,6 +134,10 @@ namespace Console // Displays a message in the console with yellow emphasis. // Newline is automatically appended. extern bool Notice( const char* fmt, ... ); + + // Displays a message in the console with yellow emphasis. + // Newline is automatically appended. + extern bool Status( const char* fmt, ... ); } using Console::Color_Red; diff --git a/pcsx2/VU0micro.cpp b/pcsx2/VU0micro.cpp index be867d5727..87f19fd2c2 100644 --- a/pcsx2/VU0micro.cpp +++ b/pcsx2/VU0micro.cpp @@ -79,7 +79,7 @@ int vu0Init() VU0.Mem = (u8*)VirtualAlloc((void*)0x11000000, 0x10000, MEM_RESERVE|MEM_PHYSICAL, PAGE_READWRITE); if( VU0.Mem != (void*)0x11000000 ) { - Console::MsgLn("Failed to alloc vu0mem 0x11000000 %d", GetLastError()); + Console::WriteLn("Failed to alloc vu0mem 0x11000000 %d", GetLastError()); return -1; } diff --git a/pcsx2/windows/ConfigDlg.cpp b/pcsx2/windows/ConfigDlg.cpp index e48e7b1472..8a7439953d 100644 --- a/pcsx2/windows/ConfigDlg.cpp +++ b/pcsx2/windows/ConfigDlg.cpp @@ -24,107 +24,147 @@ #include "plugins.h" #include "resource.h" -#define ComboAddPlugin(hw, str) { \ - sprintf(tmpStr, "%s %d.%d.%d", PS2E_GetLibName(), (version>>8)&0xff, version&0xff, (version>>24)&0xff); \ - lp = (char *)malloc(strlen(FindData.cFileName)+8); \ - sprintf(lp, "%s", FindData.cFileName); \ - i = ComboBox_AddString(hw, tmpStr); \ - ComboBox_SetItemData(hw, i, lp); \ - if (_stricmp(str, lp)==0) \ - ComboBox_SetCurSel(hw, i); \ -} +struct ComboInitializer +{ + HWND hwnd; -BOOL OnConfigureDialog(HWND hW) { - WIN32_FIND_DATA FindData; HANDLE Find; HANDLE Lib; + + WIN32_FIND_DATA FindData; + _PS2EgetLibType PS2E_GetLibType; _PS2EgetLibName PS2E_GetLibName; _PS2EgetLibVersion2 PS2E_GetLibVersion2; - HWND hWC_GS=GetDlgItem(hW,IDC_LISTGS); - HWND hWC_PAD1=GetDlgItem(hW,IDC_LISTPAD1); - HWND hWC_PAD2=GetDlgItem(hW,IDC_LISTPAD2); - HWND hWC_SPU2=GetDlgItem(hW,IDC_LISTSPU2); - HWND hWC_CDVD=GetDlgItem(hW,IDC_LISTCDVD); - HWND hWC_DEV9=GetDlgItem(hW,IDC_LISTDEV9); - HWND hWC_USB=GetDlgItem(hW,IDC_LISTUSB); - HWND hWC_FW=GetDlgItem(hW,IDC_LISTFW); - HWND hWC_BIOS=GetDlgItem(hW,IDC_LISTBIOS); - char tmpStr[g_MaxPath]; - char *lp; - int i; - strcpy(tmpStr, Config.PluginsDir); - strcat(tmpStr, "*.dll"); - Find = FindFirstFile(tmpStr, &FindData); + long version; + u32 type; - do { - if (Find==INVALID_HANDLE_VALUE) break; + ComboInitializer( HWND hwndDlg ) : + hwnd( hwndDlg ) + , Find( INVALID_HANDLE_VALUE ) + , Lib( NULL ) + , PS2E_GetLibType( NULL ) + , PS2E_GetLibName( NULL ) + , PS2E_GetLibVersion2( NULL ) + { + char tmpStr[g_MaxPath]; + CombinePaths(tmpStr, Config.PluginsDir, "*.dll"); + Find = FindFirstFile(tmpStr, &FindData); + } + + ~ComboInitializer() + { + if (Find!=INVALID_HANDLE_VALUE) + FindClose(Find); + } + + bool FindNext() + { + return !!FindNextFile( Find, &FindData ); + } + + bool LoadNextLibrary() + { + char tmpStr[g_MaxPath]; CombinePaths( tmpStr, Config.PluginsDir, FindData.cFileName ); Lib = LoadLibrary(tmpStr); - if (Lib == NULL) { SysPrintf("%s: %s\n", tmpStr, SysLibError()); continue; } + if (Lib == NULL) { Console::Error("%s: %s", tmpStr, SysLibError()); return false; } PS2E_GetLibType = (_PS2EgetLibType) GetProcAddress((HMODULE)Lib,"PS2EgetLibType"); PS2E_GetLibName = (_PS2EgetLibName) GetProcAddress((HMODULE)Lib,"PS2EgetLibName"); PS2E_GetLibVersion2 = (_PS2EgetLibVersion2) GetProcAddress((HMODULE)Lib,"PS2EgetLibVersion2"); - if (PS2E_GetLibType != NULL && PS2E_GetLibName != NULL && PS2E_GetLibVersion2 != NULL) { - u32 version; - long type; + if( PS2E_GetLibType == NULL || PS2E_GetLibName == NULL || PS2E_GetLibVersion2 == NULL ) + return false; - type = PS2E_GetLibType(); - if (type & PS2E_LT_GS) { - version = PS2E_GetLibVersion2(PS2E_LT_GS); - if ( ((version >> 16)&0xff) == PS2E_GS_VERSION) { - ComboAddPlugin(hWC_GS, winConfig.GS); - } else SysPrintf("Plugin %s: Version %x != %x\n", FindData.cFileName, 0xff&(version >> 16), PS2E_GS_VERSION); - } - if (type & PS2E_LT_PAD) { - _PADquery query; + type = PS2E_GetLibType(); + return true; + } - query = (_PADquery)GetProcAddress((HMODULE)Lib, "PADquery"); - version = PS2E_GetLibVersion2(PS2E_LT_PAD); - if (((version >> 16)&0xff) == PS2E_PAD_VERSION && query) { + void AddPlugin(HWND hwndCombo, const char* str) + { + char tmpStr[g_MaxPath]; + int i; + + sprintf(tmpStr, "%s %d.%d.%d", PS2E_GetLibName(), (version>>8)&0xff, version&0xff, (version>>24)&0xff); + char* lp = (char *)malloc(strlen(FindData.cFileName)+8); + sprintf(lp, "%s", FindData.cFileName); + i = ComboBox_AddString(hwndCombo, tmpStr); + ComboBox_SetItemData(hwndCombo, i, lp); + if (_stricmp(str, lp)==0) + ComboBox_SetCurSel(hwndCombo, i); + } + + bool CheckVersion( const char* typeStr, u32 pluginType, long checkver ) + { + if( type & pluginType ) + { + version = PS2E_GetLibVersion2( pluginType ); + if ( ((version >> 16)&0xff) == checkver ) + return true; + + Console::Notice("%s Plugin %s: Version %x != %x", typeStr, FindData.cFileName, 0xff&(version >> 16), checkver); + } + return false; + } +}; + +BOOL OnConfigureDialog(HWND hW) { + HWND const hWC_GS=GetDlgItem(hW,IDC_LISTGS); + HWND const hWC_PAD1=GetDlgItem(hW,IDC_LISTPAD1); + HWND const hWC_PAD2=GetDlgItem(hW,IDC_LISTPAD2); + HWND const hWC_SPU2=GetDlgItem(hW,IDC_LISTSPU2); + HWND const hWC_CDVD=GetDlgItem(hW,IDC_LISTCDVD); + HWND const hWC_DEV9=GetDlgItem(hW,IDC_LISTDEV9); + HWND const hWC_USB=GetDlgItem(hW,IDC_LISTUSB); + HWND const hWC_FW=GetDlgItem(hW,IDC_LISTFW); + HWND const hWC_BIOS=GetDlgItem(hW,IDC_LISTBIOS); + + ComboInitializer tool(hW); + if( tool.Find == INVALID_HANDLE_VALUE ) // epic fail? + return FALSE; + + do + { + if( !tool.LoadNextLibrary() ) continue; + + if( tool.CheckVersion( "GS", PS2E_LT_GS, PS2E_GS_VERSION ) ) + tool.AddPlugin(hWC_GS, winConfig.GS); + + if (tool.type & PS2E_LT_PAD) + { + _PADquery query; + + query = (_PADquery)GetProcAddress((HMODULE)tool.Lib, "PADquery"); + if( query != NULL ) + { + if( tool.CheckVersion( "PAD", PS2E_LT_PAD, PS2E_PAD_VERSION ) ) + { if (query() & 0x1) - ComboAddPlugin(hWC_PAD1, winConfig.PAD1); + tool.AddPlugin(hWC_PAD1, winConfig.PAD1); if (query() & 0x2) - ComboAddPlugin(hWC_PAD2, winConfig.PAD2); - } else SysPrintf("Plugin %s: Version %x != %x\n", FindData.cFileName, (version >> 16)&0xff, PS2E_PAD_VERSION); - } - if (type & PS2E_LT_SPU2) { - version = PS2E_GetLibVersion2(PS2E_LT_SPU2); - if ( ((version >> 16)&0xff) == PS2E_SPU2_VERSION) { - ComboAddPlugin(hWC_SPU2, winConfig.SPU2); - } else SysPrintf("Plugin %s: Version %x != %x\n", FindData.cFileName, (version >> 16)&0xff, PS2E_SPU2_VERSION); - } - if (type & PS2E_LT_CDVD) { - version = PS2E_GetLibVersion2(PS2E_LT_CDVD); - if (((version >> 16)&0xff) == PS2E_CDVD_VERSION) { - ComboAddPlugin(hWC_CDVD, winConfig.CDVD); - } else SysPrintf("Plugin %s: Version %x != %x\n", FindData.cFileName, (version >> 16)&0xff, PS2E_CDVD_VERSION); - } - if (type & PS2E_LT_DEV9) { - version = PS2E_GetLibVersion2(PS2E_LT_DEV9); - if (((version >> 16)&0xff) == PS2E_DEV9_VERSION) { - ComboAddPlugin(hWC_DEV9, winConfig.DEV9); - } else SysPrintf("Plugin %s: Version %x != %x\n", FindData.cFileName, (version >> 16)&0xff, PS2E_DEV9_VERSION); - } - if (type & PS2E_LT_USB) { - version = PS2E_GetLibVersion2(PS2E_LT_USB); - if (((version >> 16)&0xff) == PS2E_USB_VERSION) { - ComboAddPlugin(hWC_USB, winConfig.USB); - } else SysPrintf("Plugin %s: Version %x != %x\n", FindData.cFileName, (version >> 16)&0xff, PS2E_USB_VERSION); - } - if (type & PS2E_LT_FW) { - version = PS2E_GetLibVersion2(PS2E_LT_FW); - if (((version >> 16)&0xff) == PS2E_FW_VERSION) { - ComboAddPlugin(hWC_FW, winConfig.FW); - } else SysPrintf("Plugin %s: Version %x != %x\n", FindData.cFileName, (version >> 16)&0xff, PS2E_FW_VERSION); + tool.AddPlugin(hWC_PAD2, winConfig.PAD2); + } } } - } while (FindNextFile(Find,&FindData)); - if (Find!=INVALID_HANDLE_VALUE) FindClose(Find); + if( tool.CheckVersion( "SPU2", PS2E_LT_SPU2, PS2E_SPU2_VERSION ) ) + tool.AddPlugin(hWC_SPU2, winConfig.SPU2); + + if( tool.CheckVersion( "CDVD", PS2E_LT_CDVD, PS2E_CDVD_VERSION ) ) + tool.AddPlugin(hWC_CDVD, winConfig.CDVD); + + if( tool.CheckVersion( "DEV9", PS2E_LT_DEV9, PS2E_DEV9_VERSION ) ) + tool.AddPlugin(hWC_DEV9, winConfig.DEV9); + + if( tool.CheckVersion( "USB", PS2E_LT_USB, PS2E_USB_VERSION ) ) + tool.AddPlugin(hWC_USB, winConfig.USB); + + if( tool.CheckVersion( "FW", PS2E_LT_FW, PS2E_FW_VERSION ) ) + tool.AddPlugin(hWC_FW, winConfig.FW); + + } while( tool.FindNext() ); // BIOS @@ -135,11 +175,20 @@ BOOL OnConfigureDialog(HWND hW) { if (_stricmp(Config.Bios, lp)==0) ComboBox_SetCurSel(hWC_BIOS, i);*/ + HANDLE Find; + + WIN32_FIND_DATA FindData; + char tmpStr[g_MaxPath]; + strcpy(tmpStr, Config.BiosDir); strcat(tmpStr, "*"); Find=FindFirstFile(tmpStr, &FindData); - do { + do + { + char* lp; + int i; + char description[50]; //2002-09-22 (Florin) if (Find==INVALID_HANDLE_VALUE) break; if (!strcmp(FindData.cFileName, ".")) continue; diff --git a/pcsx2/windows/Console.cpp b/pcsx2/windows/Console.cpp index 9739eaf41c..eb5cb1a14e 100644 --- a/pcsx2/windows/Console.cpp +++ b/pcsx2/windows/Console.cpp @@ -85,7 +85,7 @@ namespace Console // Writes a newline to the console. - __forceinline bool __fastcall WriteLn() + __forceinline bool __fastcall Newline() { if (hConsole != NULL) { @@ -104,7 +104,7 @@ namespace Console // Writes an unformatted string of text to the console (fast!) // No newline is appended. - __forceinline bool __fastcall Write( const char* fmt ) + __forceinline bool __fastcall Msg( const char* fmt ) { if (hConsole != NULL) { @@ -121,15 +121,26 @@ namespace Console // Writes an unformatted string of text to the console (fast!) // A newline is automatically appended. - __forceinline bool __fastcall WriteLn( const char* fmt ) + __forceinline bool __fastcall MsgLn( const char* fmt ) { Write( fmt ); - WriteLn(); + Newline(); + return false; + } + + // Writes an unformatted string of text to the console (fast!) + // A newline is automatically appended. + __forceinline bool __fastcall MsgLn( Colors color, const char* fmt ) + { + SetColor( color ); + Write( fmt ); + ClearColor(); + Newline(); return false; } // Writes a formatted message to the console, with appended newline. - static __forceinline void __fastcall _MsgLn( Colors color, const char* fmt, va_list args ) + static __forceinline void __fastcall _WriteLn( Colors color, const char* fmt, va_list args ) { char msg[2048]; @@ -144,17 +155,17 @@ namespace Console } // Writes a line of colored text to the console, with automatic newline appendage. - bool MsgLn( Colors color, const char* fmt, ... ) + bool WriteLn( Colors color, const char* fmt, ... ) { va_list list; va_start(list,fmt); - _MsgLn( Color_White, fmt, list ); + _WriteLn( color, fmt, list ); va_end(list); return false; } // writes a formatted message to the console (no newline and no color) - bool Msg( const char* fmt, ... ) + bool Write( const char* fmt, ... ) { va_list list; char msg[2048]; @@ -164,12 +175,12 @@ namespace Console msg[2047] = '\0'; va_end(list); - Write( msg ); + Msg( msg ); return false; } // writes a formatted message to the console (no newline and no color) - bool Msg( Colors color, const char* fmt, ... ) + bool Write( Colors color, const char* fmt, ... ) { va_list list; char msg[2048]; @@ -180,14 +191,14 @@ namespace Console va_end(list); SetColor( color ); - Write( msg ); + Msg( msg ); ClearColor(); return false; } // Writes a formatted message to the console, with appended newline. // (no coloring) - bool MsgLn( const char* fmt, ... ) + bool WriteLn( const char* fmt, ... ) { va_list list; char msg[2048]; @@ -197,7 +208,7 @@ namespace Console va_end(list); strcat( msg, "\n" ); - Write( msg ); + Msg( msg ); if( emuLog != NULL ) fflush( emuLog ); // manual flush to accomany manual newline return false; @@ -209,7 +220,7 @@ namespace Console { va_list list; va_start(list,fmt); - _MsgLn( Color_Red, fmt, list ); + _WriteLn( Color_Red, fmt, list ); va_end(list); return false; } @@ -220,8 +231,20 @@ namespace Console { va_list list; va_start(list,fmt); - _MsgLn( Color_Yellow, fmt, list ); + _WriteLn( Color_Yellow, fmt, list ); va_end(list); return false; } + + // Displays a message in the console with green emphasis. + // Newline is automatically appended. + bool Status( const char* fmt, ... ) + { + va_list list; + va_start(list,fmt); + _WriteLn( Color_Green, fmt, list ); + va_end(list); + return false; + } + } diff --git a/pcsx2/windows/McdsDlg.cpp b/pcsx2/windows/McdsDlg.cpp index 338709c6a5..fd3937b7b2 100644 --- a/pcsx2/windows/McdsDlg.cpp +++ b/pcsx2/windows/McdsDlg.cpp @@ -658,9 +658,7 @@ class MemoryCard return 0; } - #ifdef _DEBUG - SysPrintf("IFC: %d\n\n", IFC); - #endif + DbgCon::WriteLn("IFC: %d", IFC); // Read the cluster with the indirect data to the FAT. fseek(fp, 0x420 * IFC, SEEK_SET); diff --git a/pcsx2/windows/SamplProf.cpp b/pcsx2/windows/SamplProf.cpp index bbedb135e9..915af9f643 100644 --- a/pcsx2/windows/SamplProf.cpp +++ b/pcsx2/windows/SamplProf.cpp @@ -266,7 +266,7 @@ void ProfilerInit() if (ProfRunning) return; - //Console::Write( "Profiler Thread Initializing..." ); + //Console::Msg( "Profiler Thread Initializing..." ); ProfRunning=true; DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), @@ -280,12 +280,12 @@ void ProfilerInit() hProfThread=CreateThread(0,0,(LPTHREAD_START_ROUTINE)ProfilerThread,0,0,0); SetThreadPriority(hProfThread,THREAD_PRIORITY_HIGHEST); - //Console::WriteLn( " Done!" ); + //Console::MsgLn( " Done!" ); } void ProfilerTerm() { - //Console::Write( "Profiler Terminating..." ); + //Console::Msg( "Profiler Terminating..." ); if (!ProfRunning) return; @@ -305,7 +305,7 @@ void ProfilerTerm() CloseHandle( hMtgsThread ); DeleteCriticalSection( &ProfModulesLock ); - //Console::WriteLn( " Done!" ); + //Console::MsgLn( " Done!" ); } void ProfilerSetEnabled(bool Enabled) diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index 19afcd22c8..1f718b6646 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -2943,7 +2943,7 @@ > diff --git a/pcsx2/windows/WinMain.cpp b/pcsx2/windows/WinMain.cpp index 2fcfe4ef23..10c04f21a2 100644 --- a/pcsx2/windows/WinMain.cpp +++ b/pcsx2/windows/WinMain.cpp @@ -312,7 +312,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine Console::Open(); //if( lpCmdLine == NULL || *lpCmdLine == 0 ) - // Console::WriteLn("-help to see arguments"); + // Console::MsgLn("-help to see arguments"); } // Load the command line overrides for plugins: @@ -377,15 +377,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine // output the help commands Console::SetColor( Console::Color_White ); - Console::WriteLn( "Hotkeys:" ); + Console::MsgLn( "Hotkeys:" ); - Console::WriteLn( + Console::MsgLn( "\tF1 - save state\n" "\t(Shift +) F2 - cycle states\n" "\tF3 - load state" ); - DevCon::WriteLn( + DevCon::MsgLn( "\tF10 - dump performance counters\n" "\tF11 - save GS state\n" "\tF12 - dump hardware registers" diff --git a/pcsx2/windows/WinSysExec.cpp b/pcsx2/windows/WinSysExec.cpp index 266ea297f3..cc4421f72e 100644 --- a/pcsx2/windows/WinSysExec.cpp +++ b/pcsx2/windows/WinSysExec.cpp @@ -460,11 +460,6 @@ void CALLBACK KeyEvent(keyEvent* ev) } break; - /*case VK_NUMPAD0: - Config.Hacks ^= 2; - if (Config.Hacks & 2) {SysPrintf( "Overflow Check OFF\n" );} else {SysPrintf( "Overflow Check ON\n" );} - break;*/ - case VK_ESCAPE: #ifdef PCSX2_DEVBUILD if( g_SaveGSStream >= 3 ) { @@ -585,7 +580,7 @@ void SysPrintf(const char *fmt, ...) msg[511] = '\0'; va_end(list); - Console::Write( msg ); + Console::Msg( msg ); } void SysMessage(const char *fmt, ...) diff --git a/pcsx2/windows/WinVM.cpp b/pcsx2/windows/WinVM.cpp index ad2fefebee..0afa673b58 100644 --- a/pcsx2/windows/WinVM.cpp +++ b/pcsx2/windows/WinVM.cpp @@ -368,7 +368,7 @@ int SysPhysicalAlloc(u32 size, PSMEMORYBLOCK* pblock) pblock->aPFNs = (uptr*)HeapAlloc (GetProcessHeap (), 0, PFNArraySize); if (pblock->aPFNs == NULL) { - SysPrintf("Failed to allocate on heap.\n"); + Console::Error("Failed to allocate on heap."); goto eCleanupAndExit; } @@ -378,13 +378,13 @@ int SysPhysicalAlloc(u32 size, PSMEMORYBLOCK* pblock) if( bResult != TRUE ) { - SysPrintf("Cannot allocate physical pages, error %u.\n", GetLastError() ); + Console::Error("Virtual Memory Error %u > Cannot allocate physical pages.", GetLastError() ); goto eCleanupAndExit; } if( NumberOfPagesInitial != pblock->NumberPages ) { - SysPrintf("Allocated only %p of %p pages.\n", pblock->NumberPages, NumberOfPagesInitial ); + Console::Error("Virtual Memory > Physical allocation failed!\n\tAllocated only %p of %p pages.", pblock->NumberPages, NumberOfPagesInitial ); goto eCleanupAndExit; } @@ -417,7 +417,7 @@ int SysVirtualPhyAlloc(void* base, u32 size, PSMEMORYBLOCK* pblock) LPVOID lpMemReserved = VirtualAlloc( base, size, MEM_RESERVE | MEM_PHYSICAL, PAGE_READWRITE ); if( lpMemReserved == NULL || base != lpMemReserved ) { - Console::MsgLn("VirtualMemory Error %d > Cannot reserve memory at 0x%8.8x(%x).", base, lpMemReserved, GetLastError()); + Console::WriteLn("VirtualMemory Error %d > Cannot reserve memory at 0x%8.8x(%x).", base, lpMemReserved, GetLastError()); goto eCleanupAndExit; } @@ -429,7 +429,7 @@ int SysVirtualPhyAlloc(void* base, u32 size, PSMEMORYBLOCK* pblock) if( bResult != TRUE ) { - Console::MsgLn("VirtualMemory Error %u > MapUserPhysicalPages failed to map.", GetLastError() ); + Console::WriteLn("VirtualMemory Error %u > MapUserPhysicalPages failed to map.", GetLastError() ); goto eCleanupAndExit; } @@ -445,7 +445,7 @@ void SysVirtualFree(void* lpMemReserved, u32 size) // unmap if( MapUserPhysicalPages( lpMemReserved, (size+s_dwPageSize-1)/s_dwPageSize, NULL ) != TRUE ) { - Console::MsgLn("VirtualMemory Error %u > MapUserPhysicalPages failed to unmap", GetLastError() ); + Console::WriteLn("VirtualMemory Error %u > MapUserPhysicalPages failed to unmap", GetLastError() ); return; } diff --git a/pcsx2/x86/iCore.cpp b/pcsx2/x86/iCore.cpp index 6eaf6b57d0..ebd552feb1 100644 --- a/pcsx2/x86/iCore.cpp +++ b/pcsx2/x86/iCore.cpp @@ -176,7 +176,7 @@ int _getFreeXMMreg() _freeXMMreg(tempi); return tempi; } - SysPrintf("*PCSX2*: XMM Reg Allocation Error in _getFreeXMMreg()!\n"); + Console::Error("*PCSX2*: XMM Reg Allocation Error in _getFreeXMMreg()!"); return -1; } diff --git a/pcsx2/x86/iFPU.cpp b/pcsx2/x86/iFPU.cpp index 66a04f3e4a..d7f9416456 100644 --- a/pcsx2/x86/iFPU.cpp +++ b/pcsx2/x86/iFPU.cpp @@ -409,7 +409,7 @@ void fpuFloat2(int regd) { // +NaN -> +fMax, -NaN -> -fMax, +Inf -> +fMax, -Inf _freeXMMreg(t1reg); } else { - SysPrintf("fpuFloat2() allocation error\n"); + Console::Error("fpuFloat2() allocation error"); t1reg = (regd == 0) ? 1 : 0; // get a temp reg thats not regd SSE_MOVAPS_XMM_to_M128( (uptr)&FPU_FLOAT_TEMP[0], t1reg ); // backup data in t1reg to a temp address SSE_MOVSS_XMM_to_XMM(t1reg, regd); @@ -483,9 +483,9 @@ void FPU_ADD_SUB(int regd, int regt, int issub) int xmmtemp = _allocTempXMMreg(XMMT_FPS, -1); //temporary for anding with regd/regt int roundmodeFlag = 0; - if (tempecx != ECX) { SysPrintf("FPU: ADD/SUB Allocation Error!\n"); tempecx = ECX;} - if (temp2 == -1) { SysPrintf("FPU: ADD/SUB Allocation Error!\n"); temp2 = EAX;} - if (xmmtemp == -1) { SysPrintf("FPU: ADD/SUB Allocation Error!\n"); xmmtemp = XMM0;} + if (tempecx != ECX) { Console::Error("FPU: ADD/SUB Allocation Error!"); tempecx = ECX;} + if (temp2 == -1) { Console::Error("FPU: ADD/SUB Allocation Error!"); temp2 = EAX;} + if (xmmtemp == -1) { Console::Error("FPU: ADD/SUB Allocation Error!"); xmmtemp = XMM0;} if ((g_sseMXCSR & 0x00006000) != 0x00006000) { // Set roundmode to chop if it isn't already roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF) | 0x00006000; // Set new roundmode @@ -640,7 +640,7 @@ int recCommutativeOp(int info, int regd, int op) } break; default: - SysPrintf("FPU: recCommutativeOp case 4\n"); + Console::Status("FPU: recCommutativeOp case 4"); SSE_MOVSS_M32_to_XMM(regd, (uptr)&fpuRegs.fpr[_Fs_]); SSE_MOVSS_M32_to_XMM(t0reg, (uptr)&fpuRegs.fpr[_Ft_]); if (CHECK_FPU_EXTRA_OVERFLOW || (op >= 2)) { fpuFloat2(regd); fpuFloat2(t0reg); } @@ -801,9 +801,9 @@ void recC_EQ_xmm(int info) SSE_UCOMISS_XMM_to_XMM(EEREC_S, EEREC_T); break; default: - SysPrintf("recC_EQ_xmm: Default\n"); + Console::Status("recC_EQ_xmm: Default"); tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg < 0) {SysPrintf("FPU: DIV Allocation Error!\n"); tempReg = EAX;} + if (tempReg < 0) {Console::Error("FPU: DIV Allocation Error!"); tempReg = EAX;} MOV32MtoR(tempReg, (uptr)&fpuRegs.fpr[_Fs_]); CMP32MtoR(tempReg, (uptr)&fpuRegs.fpr[_Ft_]); @@ -881,9 +881,9 @@ void recC_LE_xmm(int info ) SSE_UCOMISS_XMM_to_XMM(EEREC_S, EEREC_T); break; default: // Untested and incorrect, but this case is never reached AFAIK (cottonvibes) - SysPrintf("recC_LE_xmm: Default\n"); + Console::Status("recC_LE_xmm: Default"); tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg < 0) {SysPrintf("FPU: DIV Allocation Error!\n"); tempReg = EAX;} + if (tempReg < 0) {Console::Error("FPU: DIV Allocation Error!"); tempReg = EAX;} MOV32MtoR(tempReg, (uptr)&fpuRegs.fpr[_Fs_]); CMP32MtoR(tempReg, (uptr)&fpuRegs.fpr[_Ft_]); @@ -958,9 +958,9 @@ void recC_LT_xmm(int info) SSE_UCOMISS_XMM_to_XMM(EEREC_S, EEREC_T); break; default: - SysPrintf("recC_LT_xmm: Default\n"); + Console::Status("recC_LT_xmm: Default"); tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg < 0) {SysPrintf("FPU: DIV Allocation Error!\n"); tempReg = EAX;} + if (tempReg < 0) {Console::Error("FPU: DIV Allocation Error!"); tempReg = EAX;} MOV32MtoR(tempReg, (uptr)&fpuRegs.fpr[_Fs_]); CMP32MtoR(tempReg, (uptr)&fpuRegs.fpr[_Ft_]); @@ -1044,8 +1044,8 @@ void recDIVhelper1(int regd, int regt) // Sets flags u32 *ajmp32, *bjmp32; int t1reg = _allocTempXMMreg(XMMT_FPS, -1); int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - //if (t1reg == -1) {SysPrintf("FPU: DIV Allocation Error!\n");} - if (tempReg == -1) {SysPrintf("FPU: DIV Allocation Error!\n"); tempReg = EAX;} + //if (t1reg == -1) {Console::Error("FPU: DIV Allocation Error!");} + if (tempReg == -1) {Console::Error("FPU: DIV Allocation Error!"); tempReg = EAX;} AND32ItoM((uptr)&fpuRegs.fprc[31], ~(FPUflagI|FPUflagD)); // Clear I and D flags @@ -1098,7 +1098,7 @@ void recDIVhelper2(int regd, int regt) // Doesn't sets flags void recDIV_S_xmm(int info) { int t0reg = _allocTempXMMreg(XMMT_FPS, -1); - //if (t0reg == -1) {SysPrintf("FPU: DIV Allocation Error!\n");} + //if (t0reg == -1) {Console::Error("FPU: DIV Allocation Error!");} switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) { case PROCESS_EE_S: @@ -1607,7 +1607,7 @@ void recSUBop(int info, int regd) } break; default: - SysPrintf("FPU: SUB case 4\n"); + Console::Notice("FPU: SUB case 4"); SSE_MOVSS_M32_to_XMM(t0reg, (uptr)&fpuRegs.fpr[_Ft_]); SSE_MOVSS_M32_to_XMM(regd, (uptr)&fpuRegs.fpr[_Fs_]); recSUBhelper(regd, t0reg); @@ -1642,7 +1642,7 @@ void recSQRT_S_xmm(int info) { u8* pjmp; int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg == -1) {SysPrintf("FPU: SQRT Allocation Error!\n"); tempReg = EAX;} + if (tempReg == -1) {Console::Error("FPU: SQRT Allocation Error!"); tempReg = EAX;} //SysPrintf("FPU: SQRT\n"); if( info & PROCESS_EE_T ) SSE_MOVSS_XMM_to_XMM(EEREC_D, EEREC_T); @@ -1681,8 +1681,8 @@ void recRSQRThelper1(int regd, int t0reg) // Preforms the RSQRT function when re u32 *pjmp32; int t1reg = _allocTempXMMreg(XMMT_FPS, -1); int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - //if (t1reg == -1) {SysPrintf("FPU: RSQRT Allocation Error!\n");} - if (tempReg == -1) {SysPrintf("FPU: RSQRT Allocation Error!\n"); tempReg = EAX;} + //if (t1reg == -1) {Console::Error("FPU: RSQRT Allocation Error!");} + if (tempReg == -1) {Console::Error("FPU: RSQRT Allocation Error!"); tempReg = EAX;} AND32ItoM((uptr)&fpuRegs.fprc[31], ~(FPUflagI|FPUflagD)); // Clear I and D flags @@ -1737,7 +1737,7 @@ void recRSQRThelper2(int regd, int t0reg) // Preforms the RSQRT function when re void recRSQRT_S_xmm(int info) { int t0reg = _allocTempXMMreg(XMMT_FPS, -1); - //if (t0reg == -1) {SysPrintf("FPU: RSQRT Allocation Error!\n");} + //if (t0reg == -1) {Console::Error("FPU: RSQRT Allocation Error!");} //SysPrintf("FPU: RSQRT\n"); switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) { diff --git a/pcsx2/x86/iHw.cpp b/pcsx2/x86/iHw.cpp index ba3743b55f..b3cb6ba0aa 100644 --- a/pcsx2/x86/iHw.cpp +++ b/pcsx2/x86/iHw.cpp @@ -39,10 +39,8 @@ extern int sio_count; int hwConstRead8(u32 x86reg, u32 mem, u32 sign) { -#ifdef PCSX2_DEVBUILD if( mem >= 0x10000000 && mem < 0x10008000 ) - SysPrintf("hwRead8 to %x\n", mem); -#endif + DevCon::WriteLn("hwRead8 to %x", mem); if ((mem & 0xffffff0f) == 0x1000f200) { if(mem == 0x1000f260) { @@ -82,15 +80,11 @@ int hwConstRead8(u32 x86reg, u32 mem, u32 sign) static u32 s_regreads[3] = {0x010200000, 0xbfff0000, 0xF0000102}; int hwConstRead16(u32 x86reg, u32 mem, u32 sign) { -#ifdef PCSX2_DEVBUILD if( mem >= 0x10002000 && mem < 0x10008000 ) - SysPrintf("hwRead16 to %x\n", mem); -#endif -#ifdef PCSX2_DEVBUILD - if( mem >= 0x10000000 && mem < 0x10002000 ){ - EECNT_LOG("cnt read to %x\n", mem); - } -#endif + DevCon::WriteLn("hwRead16 to %x", mem); + + if( mem >= 0x10000000 && mem < 0x10002000 ) + EECNT_LOG("cnt read to %x\n", mem); switch (mem) { case 0x10000000: @@ -490,7 +484,7 @@ static void PrintDebug(u8 value) { if (value == '\n') { sio_buffer[sio_count] = 0; - SysPrintf("%s\n", sio_buffer); + Console::Write( sio_buffer ); sio_count = 0; } else { if (sio_count < 1023) { diff --git a/pcsx2/x86/iMMI.cpp b/pcsx2/x86/iMMI.cpp index fbcf1369d5..5f532e301a 100644 --- a/pcsx2/x86/iMMI.cpp +++ b/pcsx2/x86/iMMI.cpp @@ -276,7 +276,7 @@ CPU_SSE2_XMMCACHE_START(XMMINFO_WRITED|XMMINFO_READLO|XMMINFO_READHI) } break; default: - SysPrintf("PMFHL??\n"); + Console::Error("PMFHL?? *pcsx2 head esplode!*"); assert(0); } diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index abb5f4416c..afdc17208d 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -595,7 +595,7 @@ static int recInit() { static void recReset() { - DevCon::WriteLn("IOP Recompiler data reset"); + DevCon::MsgLn("IOP Recompiler data reset"); memset(recRAM, 0, sizeof(BASEBLOCK)/4*0x200000); memset(recROM, 0, sizeof(BASEBLOCK)/4*0x400000); @@ -989,10 +989,7 @@ void psxSetBranchImm( u32 imm ) static u32 psxScaleBlockCycles() { - /*return s_psxBlockCycles * - (CHECK_IOPSYNC_HACK ? (CHECK_EE_IOP_EXTRA ? 3.1875 : 2.125) : (17/16));*/ - return s_psxBlockCycles * - (CHECK_IOP_CYCLERATE ? 2 : 1); + return s_psxBlockCycles * (CHECK_IOP_CYCLERATE ? 2 : 1); } static void iPsxBranchTest(u32 newpc, u32 cpuBranch) diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 167bc55f04..45dbac7c46 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -1152,7 +1152,7 @@ static VuBaseBlock* SuperVUBuildBlocks(VuBaseBlock* parent, u32 startpc, const V ((ppprevinst->regs[0].VIwrite & pinst->regs[0].VIread) & 0xffff) == ((ppprevinst->regs[0].VIwrite & pprevinst->regs[0].VIread) & 0xffff) && !(ppprevinst->regs[0].VIread&((1<startpc); + Console::WriteLn("supervu: 2 cycle branch delay detected: %x %x", pc, s_pFnHeader->startpc); // ignore if prev instruction is ILW or ILWR (xenosaga 2) lowercode = *(int*)&VU->Micro[pc-24]; @@ -2531,7 +2531,7 @@ void svudispfntemp() { //static int curesp; //__asm mov curesp, esp - Console::MsgLn("tVU: %x %x %x", s_svulast, s_vucount, s_vufnheader); + Console::WriteLn("tVU: %x %x %x", s_svulast, s_vucount, s_vufnheader); if( g_curdebugvu ) iDumpVU1Registers(); else iDumpVU0Registers(); s_vucount++; diff --git a/pcsx2/x86/ir5900tables.cpp b/pcsx2/x86/ir5900tables.cpp index 65a9c01db6..6df7be347f 100644 --- a/pcsx2/x86/ir5900tables.cpp +++ b/pcsx2/x86/ir5900tables.cpp @@ -40,7 +40,7 @@ //////////////////////////////////////////////////// void recNULL( void ) { - SysPrintf("EE: Unimplemented op %x\n", cpuRegs.code); + Console::Error("EE: Unimplemented op %x", cpuRegs.code); } namespace EE { namespace Dynarec @@ -70,13 +70,13 @@ namespace OpcodeImpl void recUnknown() { // TODO : Unknown ops should throw an exception. - SysPrintf("EE: Unrecognized op %x\n", cpuRegs.code); + Console::Error("EE: Unrecognized op %x", cpuRegs.code); } void recMMI_Unknown() { // TODO : Unknown ops should throw an exception. - SysPrintf("EE: Unrecognized MMI op %x\n", cpuRegs.code); + Console::Error("EE: Unrecognized MMI op %x", cpuRegs.code); } //////////////////////////////////////////////////// diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index c7a046eae9..769f75194a 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -117,7 +117,7 @@ int _getFreeX86reg(int mode) _freeX86reg(tempi); return tempi; } - SysPrintf("*PCSX2*: x86 error\n"); + Console::Error("*PCSX2*: x86 error"); assert(0); return -1; @@ -432,7 +432,7 @@ int _getFreeMMXreg() _freeMMXreg(tempi); return tempi; } - SysPrintf("*PCSX2*: mmx error\n"); + Console::Error("*PCSX2*: mmx error"); assert(0); return -1; diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 3eb761dde1..c3c6df3b85 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -143,7 +143,7 @@ static void iDumpBlock( int startpc, u8 * ptr ) u8 fpuused[33]; int numused, count, fpunumused; - SysPrintf( "dump1 %x:%x, %x\n", startpc, pc, cpuRegs.cycle ); + Console::Status( "dump1 %x:%x, %x\n", startpc, pc, cpuRegs.cycle ); #ifdef _WIN32 CreateDirectory("dumps", NULL); sprintf_s( filename, g_MaxPath, "dumps\\dump%.8X.txt", startpc); @@ -1577,7 +1577,7 @@ static void recInit() //////////////////////////////////////////////////// static void recReset( void ) { - DevCon::WriteLn( "EE Recompiler data reset" ); + DevCon::MsgLn( "EE Recompiler data reset" ); s_nNextBlock = 0; maxrecmem = 0; @@ -2457,7 +2457,7 @@ static void checkcodefn() __asm__("movl %%eax, %0" : "=m"(pctemp) ); #endif - SysPrintf("code changed! %x\n", pctemp); + Console::Error("code changed! %x", pctemp); assert(0); } @@ -2526,7 +2526,7 @@ void recompileNextInstruction(int delayslot) recClearMem(pblock); x86Ptr = oldX86; if( delayslot ) - SysPrintf("delay slot %x\n", pc); + Console::Notice("delay slot %x", pc); } } } @@ -2633,7 +2633,7 @@ void recompileNextInstruction(int delayslot) case 1: switch(_Rt_) { case 0: case 1: case 2: case 3: case 0x10: case 0x11: case 0x12: case 0x13: - SysPrintf("branch %x in delay slot!\n", cpuRegs.code); + Console::Notice("branch %x in delay slot!", cpuRegs.code); _clearNeededX86regs(); _clearNeededMMXregs(); _clearNeededXMMregs(); @@ -2642,7 +2642,7 @@ void recompileNextInstruction(int delayslot) break; case 2: case 3: case 4: case 5: case 6: case 7: case 0x14: case 0x15: case 0x16: case 0x17: - SysPrintf("branch %x in delay slot!\n", cpuRegs.code); + Console::Notice("branch %x in delay slot!", cpuRegs.code); _clearNeededX86regs(); _clearNeededMMXregs(); _clearNeededXMMregs(); @@ -2793,8 +2793,8 @@ static void printfn() u32 s_recblocks[] = {0}; void badespfn() { + Console::Error("Bad esp!"); assert(0); - SysPrintf("Bad esp!\n"); } #define OPTIMIZE_COP2 0//CHECK_VU0REC @@ -2806,7 +2806,7 @@ void __fastcall dyna_block_discard(u32 start,u32 sz) #else __asm__("push %ebp\n"); #endif - SysPrintf("dyna_block_discard %08X , count %d\n",start,sz); + Console::WriteLn("dyna_block_discard %08X , count %d",start,sz); Cpu->Clear(start,sz); #ifdef _MSC_VER __asm pop ebp; @@ -2836,9 +2836,7 @@ void recRecompile( u32 startpc ) recReset(); } if ( ( (uptr)recStackPtr - (uptr)recStack ) >= RECSTACK_SIZE-0x100 ) { -#ifdef _DEBUG - SysPrintf("stack reset\n"); -#endif + DevCon::MsgLn("stack reset"); recReset(); } @@ -3273,7 +3271,7 @@ StartRecomp: stg-=4; lpc+=4; } - DbgCon::MsgLn("Manual block @ %08X : %08X %d %d %d %d", + DbgCon::WriteLn("Manual block @ %08X : %08X %d %d %d %d", startpc,inpage_ptr,pgsz,0x1000-inpage_offs,inpage_sz,sz*4); } } diff --git a/pcsx2/x86/ix86-32/iR5900Branch.cpp b/pcsx2/x86/ix86-32/iR5900Branch.cpp index d90ad9fd37..02391aad0f 100644 --- a/pcsx2/x86/ix86-32/iR5900Branch.cpp +++ b/pcsx2/x86/ix86-32/iR5900Branch.cpp @@ -525,8 +525,6 @@ void recBLTZAL() return; } - SysPrintf("BLTZAL\n"); - recSetBranchL(1); SaveBranchState(); @@ -566,8 +564,6 @@ void recBGEZAL( void ) return; } - SysPrintf("BLTZAL\n"); - recSetBranchL(0); SaveBranchState(); @@ -818,7 +814,6 @@ void recBLTZAL( void ) //////////////////////////////////////////////////// void recBGEZAL( void ) { - SysPrintf("BGEZAL\n"); MOV32ItoM( (int)&cpuRegs.code, cpuRegs.code ); MOV32ItoM( (int)&cpuRegs.pc, pc ); iFlushCall(FLUSH_EVERYTHING); @@ -829,7 +824,6 @@ void recBGEZAL( void ) //////////////////////////////////////////////////// void recBLTZALL( void ) { - SysPrintf("BLTZALL\n"); MOV32ItoM( (int)&cpuRegs.code, cpuRegs.code ); MOV32ItoM( (int)&cpuRegs.pc, pc ); iFlushCall(FLUSH_EVERYTHING); @@ -840,7 +834,6 @@ void recBLTZALL( void ) //////////////////////////////////////////////////// void recBGEZALL( void ) { - SysPrintf("BGEZALL\n"); MOV32ItoM( (int)&cpuRegs.code, cpuRegs.code ); MOV32ItoM( (int)&cpuRegs.pc, pc ); iFlushCall(FLUSH_EVERYTHING); diff --git a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp index 6b940a4b33..a14178d54f 100644 --- a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp +++ b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp @@ -191,7 +191,7 @@ void assertmem() { __asm mov s_tempaddr, ecx __asm mov s_bCachingMem, edx - SysPrintf("%x(%x) not mem write!\n", s_tempaddr, s_bCachingMem); + Console::Error("%x(%x) not mem write!", s_tempaddr, s_bCachingMem); assert(0); } diff --git a/pcsx2/x86/ix86/ix86.cpp b/pcsx2/x86/ix86/ix86.cpp index 70b7e97219..5deb3aed8d 100644 --- a/pcsx2/x86/ix86/ix86.cpp +++ b/pcsx2/x86/ix86/ix86.cpp @@ -23,9 +23,9 @@ * zerofrog(@gmail.com) */ -#include -#include -#include +#include "PrecompiledHeader.h" +#include "System.h" + #include "ix86.h" #define SWAP(x, y) { *(u32*)&y ^= *(u32*)&x; *(u32*)&x ^= *(u32*)&y; *(u32*)&y ^= *(u32*)&x; } @@ -192,8 +192,8 @@ __forceinline void x86SetJ8( u8* j8 ) u32 jump = ( x86Ptr - j8 ) - 1; if ( jump > 0x7f ) { + Console::Error( "j8 greater than 0x7f!!" ); assert(0); - SysPrintf( "j8 greater than 0x7f!!\n" ); } *j8 = (u8)jump; } @@ -203,8 +203,8 @@ __forceinline void x86SetJ8A( u8* j8 ) u32 jump = ( x86Ptr - j8 ) - 1; if ( jump > 0x7f ) { + Console::Error( "j8 greater than 0x7f!!" ); assert(0); - SysPrintf( "j8 greater than 0x7f!!\n" ); } if( ((uptr)x86Ptr&0xf) > 4 ) { @@ -225,8 +225,8 @@ __forceinline void x86SetJ16( u16 *j16 ) u32 jump = ( x86Ptr - (u8*)j16 ) - 2; if ( jump > 0x7fff ) { + Console::Error( "j16 greater than 0x7fff!!" ); assert(0); - SysPrintf( "j16 greater than 0x7fff!!\n" ); } *j16 = (u16)jump; } diff --git a/pcsx2/xmlpatchloader.cpp b/pcsx2/xmlpatchloader.cpp index 02729a61f1..46f0dd73d1 100644 --- a/pcsx2/xmlpatchloader.cpp +++ b/pcsx2/xmlpatchloader.cpp @@ -35,8 +35,6 @@ using namespace std; #include #endif -extern void SysPrintf(const char *fmt, ...); - #if !defined(_WIN32) && !defined(__MINGW32__) #ifndef strnicmp #define strnicmp strncasecmp diff --git a/plugins/CDVDiso/src/Win32/CDVDiso_vs2008.vcproj b/plugins/CDVDiso/src/Win32/CDVDiso_vs2008.vcproj index 8db89d97e5..f40b7b86d7 100644 --- a/plugins/CDVDiso/src/Win32/CDVDiso_vs2008.vcproj +++ b/plugins/CDVDiso/src/Win32/CDVDiso_vs2008.vcproj @@ -295,14 +295,6 @@ RelativePath="..\libiso.h" > - - - - diff --git a/plugins/spu2ghz/SPU2ghz_vs2008.vcproj b/plugins/spu2ghz/SPU2ghz_vs2008.vcproj index 9d5e0573cc..7d08d58eb9 100644 --- a/plugins/spu2ghz/SPU2ghz_vs2008.vcproj +++ b/plugins/spu2ghz/SPU2ghz_vs2008.vcproj @@ -1000,14 +1000,6 @@ RelativePath="defs.h" > - - - - diff --git a/plugins/zerogs/dx/Win32/aviUtil.h b/plugins/zerogs/dx/Win32/aviUtil.h index 06b385a4b8..10a7f91805 100644 --- a/plugins/zerogs/dx/Win32/aviUtil.h +++ b/plugins/zerogs/dx/Win32/aviUtil.h @@ -38,14 +38,14 @@ BOOL AVI_FileOpenWrite(PAVIFILE * pfile, const char *filename) DWORD getFOURCC(const char* value) { - if(stricmp(value, "DIB") == 0) + if(_stricmp(value, "DIB") == 0) { return mmioFOURCC(value[0],value[1],value[2],' '); } - else if((stricmp(value, "CVID") == 0) - || (stricmp(value, "IV32") == 0) - || (stricmp(value, "MSVC") == 0) - || (stricmp(value, "IV50") == 0)) + else if((_stricmp(value, "CVID") == 0) + || (_stricmp(value, "IV32") == 0) + || (_stricmp(value, "MSVC") == 0) + || (_stricmp(value, "IV50") == 0)) { return mmioFOURCC(value[0],value[1],value[2],value[3]); } diff --git a/plugins/zerogs/dx/Win32/zerogs_2008.vcproj b/plugins/zerogs/dx/Win32/zerogs_2008.vcproj index 1607267572..e562535ded 100644 --- a/plugins/zerogs/dx/Win32/zerogs_2008.vcproj +++ b/plugins/zerogs/dx/Win32/zerogs_2008.vcproj @@ -20,7 +20,6 @@ OutputDirectory="$(SolutionDir)\bin\plugins\" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" @@ -123,7 +122,6 @@ OutputDirectory="$(SolutionDir)\bin\plugins\" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="2" > - - - - diff --git a/plugins/zerospu2/ZeroSPU2_2008.vcproj b/plugins/zerospu2/ZeroSPU2_2008.vcproj index c5e06fd61c..2fd02bd5fe 100644 --- a/plugins/zerospu2/ZeroSPU2_2008.vcproj +++ b/plugins/zerospu2/ZeroSPU2_2008.vcproj @@ -206,14 +206,6 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > - - - -