diff --git a/common/build/Utilities/Utilities.cbp b/common/build/Utilities/Utilities.cbp index 3ea9adee66..5bf89b7bbc 100644 --- a/common/build/Utilities/Utilities.cbp +++ b/common/build/Utilities/Utilities.cbp @@ -102,6 +102,7 @@ + diff --git a/common/include/Utilities/General.h b/common/include/Utilities/General.h index 421a48fae0..0efc4f2a4b 100644 --- a/common/include/Utilities/General.h +++ b/common/include/Utilities/General.h @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -39,10 +39,7 @@ namespace HostSys extern void MemProtect( void* baseaddr, size_t size, PageProtectionMode mode, bool allowExecution=false ); - static __forceinline void Munmap( void* base, u32 size ) - { - Munmap( (uptr)base, size ); - } + extern void Munmap( void* base, u32 size ); } diff --git a/common/src/Utilities/AlignedMalloc.cpp b/common/src/Utilities/AlignedMalloc.cpp index 8227fedfd0..d4bb6a1081 100644 --- a/common/src/Utilities/AlignedMalloc.cpp +++ b/common/src/Utilities/AlignedMalloc.cpp @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -18,7 +18,6 @@ #include "PrecompiledHeader.h" - struct AlignedMallocHeader { u32 size; // size of the allocated buffer (minus alignment and header) @@ -73,11 +72,16 @@ __forceinline void pcsx2_aligned_free(void* pmem) // Special unaligned memset used when all other optimized memsets fail (it's called from // memzero_obj and stuff). -void _memset16_unaligned( void* dest, u16 data, size_t size ) +__forceinline void _memset16_unaligned( void* dest, u16 data, size_t size ) { jASSUME( (size & 0x1) == 0 ); u16* dst = (u16*)dest; for(int i=size; i; --i, ++dst ) *dst = data; -} \ No newline at end of file +} + +__forceinline void HostSys::Munmap( void* base, u32 size ) +{ + Munmap( (uptr)base, size ); +} diff --git a/pcsx2/GS.h b/pcsx2/GS.h index 8ea523cbd8..6178275f4c 100644 --- a/pcsx2/GS.h +++ b/pcsx2/GS.h @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -88,6 +88,8 @@ struct GIFTAG u32 FLG : 2; u32 NREG : 4; u32 REGS[2]; + + GIFTAG() {} }; struct GIFPath @@ -106,7 +108,7 @@ struct GIFPath __forceinline void SetTag(const void* mem); __forceinline bool StepReg() { if ((++curreg & 0xf) == tag.NREG) { - curreg = 0; + curreg = 0; if (--nloop == 0) { return false; } @@ -190,10 +192,10 @@ protected: Threading::Semaphore m_sem_InitDone; Threading::MutexLock m_lock_RingRestart; - + // used to keep multiple threads from sending packets to the ringbuffer concurrently. Threading::MutexLock m_PacketLocker; - + // Used to delay the sending of events. Performance is better if the ringbuffer // has more than one command in it when the thread is kicked. int m_CopyCommandTally; diff --git a/pcsx2/IPU/IPU.cpp b/pcsx2/IPU/IPU.cpp index 002c3e15b9..c00ddc7374 100644 --- a/pcsx2/IPU/IPU.cpp +++ b/pcsx2/IPU/IPU.cpp @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -46,6 +46,8 @@ using namespace std; // for min / max # define IPU_FORCEINLINE __forceinline #endif +static tIPU_DMA g_nDMATransfer; + // FIXME - g_nIPU0Data and Pointer are not saved in the savestate, which breaks savestates for some // FMVs at random (if they get saved during the half frame of a 30fps rate). The fix is complicated // since coroutine is such a pita. (air) @@ -307,17 +309,17 @@ void ipuSoftReset() mpeg2_init(); FIFOto_clear(); FIFOfrom_clear(); - + coded_block_pattern = 0; - + ipuRegs->ctrl._u32 = 0; ipuRegs->top = 0; ipuCurCmd = 0xffffffff; - + g_BP.BP = 0; g_BP.FP = 0; g_BP.bufferhasnew = 0; - + g_nCmdIndex = 0; g_nCmdPos[0] = 0; g_nCmdPos[1] = 0; @@ -391,7 +393,7 @@ __forceinline void ipuWrite64(u32 mem, u64 value) static void ipuBCLR(u32 val) { FIFOto_clear(); - + g_BP.BP = val & 0x7F; g_BP.FP = 0; g_BP.bufferhasnew = 0; @@ -1321,7 +1323,7 @@ int FIFOto_read(void *value) ((u32*)value)[i] = fifo_input[FIreadpos + i]; fifo_input[FIreadpos + i] = 0; } - + FIreadpos = (FIreadpos + 4) & 31; g_BP.IFC--; return 1; @@ -1348,32 +1350,32 @@ int FIFOto_write(u32* pMem, int size) return firsttrans; } -static __forceinline bool IPU1chain(int &totalqwc) +static __forceinline bool IPU1chain(int &totalqwc) { if (ipu1dma->qwc > 0) { - int qwc = ipu1dma->qwc; + int qwc = ipu1dma->qwc; u32 *pMem; - - pMem = (u32*)dmaGetAddr(ipu1dma->madr); - - if (pMem == NULL) - { - Console::Error("ipu1dma NULL!"); - return true; - } - - qwc = FIFOto_write(pMem, qwc); - ipu1dma->madr += qwc<< 4; - ipu1dma->qwc -= qwc; - totalqwc += qwc; - - if (ipu1dma->qwc > 0) - { - g_nDMATransfer.ACTV1 = 1; - return true; - } - } + + pMem = (u32*)dmaGetAddr(ipu1dma->madr); + + if (pMem == NULL) + { + Console::Error("ipu1dma NULL!"); + return true; + } + + qwc = FIFOto_write(pMem, qwc); + ipu1dma->madr += qwc<< 4; + ipu1dma->qwc -= qwc; + totalqwc += qwc; + + if (ipu1dma->qwc > 0) + { + g_nDMATransfer.ACTV1 = 1; + return true; + } + } return false; } @@ -1385,7 +1387,7 @@ static __forceinline bool IncreaseTadr(u32 tag) case TAG_REFE: // refe ipu1dma->tadr += 16; return true; - + case TAG_END: // end ipu1dma->tadr = ipu1dma->madr; return true; @@ -1431,13 +1433,13 @@ static __forceinline bool ipuDmacSrcChain(DMACh *tag, u32 *ptag) Console::Error("IPU ERROR: different transfer mode!, Please report to PCSX2 Team"); break; } - + return false; } static __forceinline void flushGIF() { - while(gif->chcr.STR && (vif1Regs->mskpath3 == 0)) + while(gif->chcr.STR && (vif1Regs->mskpath3 == 0)) { GIF_LOG("Flushing gif chcr %x tadr %x madr %x qwc %x", gif->chcr._u32, gif->tadr, gif->madr, gif->qwc); gsInterrupt(); @@ -1446,16 +1448,16 @@ static __forceinline void flushGIF() int IPU1dma() { - u32 *ptag; + u32 *ptag; bool done = false; int ipu1cycles = 0, totalqwc = 0; assert(!ipu1dma->chcr.TTE); - + if (!(ipu1dma->chcr.STR) || (cpuRegs.interrupt & (1 << DMAC_TO_IPU))) return 0; assert(g_nDMATransfer.TIE1 == 0); - + //We need to make sure GIF has flushed before sending IPU data, it seems to REALLY screw FFX videos flushGIF(); @@ -1494,7 +1496,7 @@ int IPU1dma() IncreaseTadr(tag); Tag::UpperTransfer(ipu1dma, ptag); - + IPU_LOG("IPU dmaIrq Set"); IPU_INT_TO(totalqwc * BIAS); g_nDMATransfer.TIE1 = 1; @@ -1511,7 +1513,7 @@ int IPU1dma() g_nDMATransfer.DOTIE1 = 0; g_nDMATransfer.ACTV1 = 0; } - + // Normal Mode & qwc is finished if ((ipu1dma->chcr.MOD == NORMAL_MODE) && (ipu1dma->qwc == 0)) { @@ -1524,37 +1526,37 @@ int IPU1dma() { IPU_LOG("dmaIPU1 Normal size=%d, addr=%lx, fifosize=%x", ipu1dma->qwc, ipu1dma->madr, 8 - g_BP.IFC); - + if (!IPU1chain(totalqwc)) IPU_INT_TO((ipu1cycles + totalqwc) * BIAS); - + return totalqwc; } else { // Chain Mode & ipu1dma->qwc is 0 ptag = (u32*)dmaGetAddr(ipu1dma->tadr); //Set memory pointer to TADR - + // Transfer the tag. if (!(Tag::Transfer("IPU1", ipu1dma, ptag))) return totalqwc; - + ipu1cycles += 1; // Add 1 cycles from the QW read for the tag - + done = ipuDmacSrcChain(ipu1dma, ptag); IPU_LOG("dmaIPU1 dmaChain %8.8x_%8.8x size=%d, addr=%lx, fifosize=%x", ptag[1], ptag[0], ipu1dma->qwc, ipu1dma->madr, 8 - g_BP.IFC); g_nDMATransfer.DOTIE1 = (ipu1dma->chcr.TIE && Tag::IRQ(ptag)); - + if (ipu1dma->qwc == 0) { //Check TIE bit of CHCR and IRQ bit of tag if (g_nDMATransfer.DOTIE1) { Console::WriteLn("IPU1 TIE"); - + if (IPU1chain(totalqwc)) return totalqwc; - + if (done) { ptag = (u32*)dmaGetAddr(ipu1dma->tadr); @@ -1752,7 +1754,7 @@ void ipu0Interrupt() { g_nDMATransfer.TIE0 = 0; } - + ipu0dma->chcr.STR = 0; hwDmacIrq(DMAC_FROM_IPU); } diff --git a/pcsx2/IPU/IPU.h b/pcsx2/IPU/IPU.h index 2d6d478e64..beffef5abf 100644 --- a/pcsx2/IPU/IPU.h +++ b/pcsx2/IPU/IPU.h @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -171,8 +171,6 @@ union tIPU_DMA u32 _u32; }; -static tIPU_DMA g_nDMATransfer; - enum SCE_IPU { SCE_IPU_BCLR = 0x0 diff --git a/pcsx2/Linux/LnxKeyCodes.cpp b/pcsx2/Linux/LnxKeyCodes.cpp index 27a32056cd..9a97dd8df2 100644 --- a/pcsx2/Linux/LnxKeyCodes.cpp +++ b/pcsx2/Linux/LnxKeyCodes.cpp @@ -1,5 +1,6 @@ #include "../PrecompiledHeader.h" +#include "ConsoleLogger.h" //#include #include diff --git a/pcsx2/Linux/pcsx2.cbp b/pcsx2/Linux/pcsx2.cbp index 2d8c587c21..6fdeff429c 100644 --- a/pcsx2/Linux/pcsx2.cbp +++ b/pcsx2/Linux/pcsx2.cbp @@ -113,7 +113,6 @@ - @@ -284,7 +283,7 @@ - + @@ -369,7 +368,6 @@ - diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 550f96b5f1..a8036dcf86 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -63,7 +63,8 @@ using namespace std; // this is not emulated! PCSX2_ALIGNED16( static GIFPath s_path[3] ); -GIFPath::GIFPath() +GIFPath::GIFPath() : + tag() { memzero_obj( *this ); } @@ -81,7 +82,7 @@ __forceinline void GIFPath::PrepPackedRegs() u32 tempreg = tag.REGS[0]; numregs = ((tag.NREG-1)&0xf) + 1; - + for (u32 i = 0; i < numregs; i++) { if (i == 8) tempreg = tag.REGS[1]; regs[i] = tempreg & 0xf; @@ -283,7 +284,7 @@ __forceinline int mtgsThreadObject::_gifTransferDummy(GIF_PATH pathidx, const u8 path.SetTag(pMem); incTag(16, 1); - if (pathidx == GIF_PATH_3) { + if (pathidx == GIF_PATH_3) { if (path.tag.FLG&2) Path3progress = IMAGE_MODE; else Path3progress = TRANSFER_MODE; } @@ -320,19 +321,19 @@ __forceinline int mtgsThreadObject::_gifTransferDummy(GIF_PATH pathidx, const u8 break; } } - + if (path.tag.EOP && !path.nloop) { - if (pathidx != GIF_PATH_2) { + if (pathidx != GIF_PATH_2) { break; } - } + } } size = (startSize - size); if (pathidx == GIF_PATH_3) { if (path.tag.EOP && !path.nloop) { - Path3progress = STOPPED_MODE; + Path3progress = STOPPED_MODE; } gif->madr += size * 16; gif->qwc -= size; @@ -607,7 +608,7 @@ sptr mtgsThreadObject::ExecuteTask() if( renderswitch ) Console::WriteLn( "\t\tForced software switch enabled." ); - + if( GSopen2 != NULL ) m_returncode = GSopen2( (void*)&pDsp, 1 | (renderswitch ? 4 : 0) ); else diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 7f5819261f..0e6f87a65e 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -24,13 +24,15 @@ class IniInterface; class MainEmuFrame; class GSFrame; +class ConsoleLogFrame; +class PipeRedirectionBase; #include "Utilities/HashMap.h" #include "Utilities/wxGuiTools.h" #include "AppConfig.h" #include "System.h" -#include "ConsoleLogger.h" +//#include "ConsoleLogger.h" #include "ps2/CoreEmuThread.h" @@ -146,7 +148,7 @@ struct KeyAcceleratorCode { union { - struct + struct { u16 keycode; u16 win:1, // win32 only. @@ -156,16 +158,16 @@ struct KeyAcceleratorCode }; u32 val32; }; - + KeyAcceleratorCode() : val32( 0 ) {} KeyAcceleratorCode( const wxKeyEvent& evt ); - + KeyAcceleratorCode( wxKeyCode code ) { val32 = 0; keycode = code; } - + KeyAcceleratorCode& Shift() { shift = true; @@ -189,7 +191,7 @@ struct KeyAcceleratorCode cmd = true; return *this; } - + wxString ToString() const; }; @@ -217,7 +219,7 @@ class AcceleratorDictionary : public HashTools::HashMap _parent; + typedef HashTools::HashMap _parent; using _parent::operator[]; AcceleratorDictionary(); @@ -351,7 +353,7 @@ public: wxASSERT( m_MainFrame != NULL ); return *m_MainFrame; } - + MainEmuFrame& GetMainFrameOrExcept() const { if( m_MainFrame == NULL ) @@ -367,7 +369,7 @@ public: return *m_CoreThread; } - + void OpenGsFrame(); void OnGsFrameClosed(); @@ -386,37 +388,12 @@ public: #endif // ---------------------------------------------------------------------------- - // Console / Program Logging Helpers + // Console / Program Logging Helpers // ---------------------------------------------------------------------------- - ConsoleLogFrame* GetProgramLog() - { - return m_ProgramLogBox; - } - - void CloseProgramLog() - { - if( m_ProgramLogBox == NULL ) return; - - m_ProgramLogBox->Close(); - - // disable future console log messages from being sent to the window. - m_ProgramLogBox = NULL; - } - - void ProgramLog_CountMsg() - { - if ((wxTheApp == NULL) || ( m_ProgramLogBox == NULL )) return; - m_ProgramLogBox->CountMessage(); - } - - void ProgramLog_PostEvent( wxEvent& evt ) - { - if ((wxTheApp == NULL) || ( m_ProgramLogBox == NULL )) return; - m_ProgramLogBox->GetEventHandler()->AddPendingEvent( evt ); - } - - //ConsoleLogFrame* GetConsoleFrame() const { return m_ProgramLogBox; } - //void SetConsoleFrame( ConsoleLogFrame& frame ) { m_ProgramLogBox = &frame; } + ConsoleLogFrame* GetProgramLog(); + void CloseProgramLog(); + void ProgramLog_CountMsg(); + void ProgramLog_PostEvent( wxEvent& evt ); protected: void InitDefaultGlobalAccelerators(); @@ -511,7 +488,7 @@ extern void SysExecute( CDVD_SourceType cdvdsrc ); // -------------------------------------------------------------------------------------- // AppInvoke macro -// -------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------- // This handy macro provides a safe way to invoke functions on objects that may or may not // exist. If the object is null, the function is not called. Useful for calling things that // are cosmetic optional, such as logging or status bars. diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 4b3f0aa8f5..1b730e8917 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -18,6 +18,7 @@ #include "MainFrame.h" #include "Plugins.h" #include "SaveState.h" +#include "ConsoleLogger.h" #include "Dialogs/ModalPopups.h" #include "Dialogs/ConfigurationDialog.h" @@ -99,7 +100,7 @@ void AppEmuThread::Resume() } // This is used when the GS plugin is handling its own window. Messages from the PAD -// are piped through to an app-level message handler, which dispatches them through +// are piped through to an app-level message handler, which dispatches them through // the universal Accelerator table. static const int pxID_PadHandler_Keydown = 8030; @@ -165,7 +166,7 @@ bool HandlePluginError( Exception::PluginError& ex ) // fixme: Send a message to the panel to select the failed plugin. if( Dialogs::ConfigurationDialog().ShowModal() == wxID_CANCEL ) - return false; + return false; } return result; } @@ -205,7 +206,7 @@ sptr AppEmuThread::ExecuteTask() m_plugins.Close(); Console::Error( ex.FormatDiagnosticMessage() ); Msgbox::Alert( ex.FormatDisplayMessage(), _("Plugin Open Error") ); - + /*if( HandlePluginError( ex ) ) { // fixme: automatically re-try emu startup here... @@ -331,7 +332,7 @@ void Pcsx2App::OnInitCmdLine( wxCmdLineParser& parser ) wxsFormat( _("specify the file to use as the %s plugin"), pi->GetShortname().c_str() ) ); } - + parser.SetSwitchChars( L"-" ); } @@ -377,7 +378,7 @@ bool Pcsx2App::OnCmdLineParsed( wxCmdLineParser& parser ) if( !result ) return false; } } - + parser.Found( L"cfgpath", &OverrideOptions.SettingsFolder ); return true; @@ -583,7 +584,7 @@ void Pcsx2App::OnSemaphorePing( wxCommandEvent& evt ) void Pcsx2App::OnOpenModalDialog( wxCommandEvent& evt ) { using namespace Dialogs; - + MsgboxEventResult& evtres( *((MsgboxEventResult*)evt.GetClientData()) ); switch( evt.GetId() ) { @@ -604,7 +605,7 @@ void Pcsx2App::OnOpenModalDialog( wxCommandEvent& evt ) evtres.result = BiosSelectorDialog().ShowModal(); } break; - + case DialogId_LogOptions: { static int _guard = 0; @@ -613,7 +614,7 @@ void Pcsx2App::OnOpenModalDialog( wxCommandEvent& evt ) evtres.result = LogOptionsDialog().ShowModal(); } break; - + case DialogId_About: { static int _guard = 0; @@ -659,13 +660,13 @@ void Pcsx2App::CleanupMess() m_CorePlugins->Close(); m_CorePlugins->Shutdown(); } - + // Notice: deleting the plugin manager (unloading plugins) here causes Lilypad to crash, // likely due to some pending message in the queue that references lilypad procs. - // We don't need to unload plugins anyway tho -- shutdown is plenty safe enough for + // We don't need to unload plugins anyway tho -- shutdown is plenty safe enough for // closing out all the windows. So just leave it be and let the plugins get unloaded // during the wxApp destructor. -- air - + m_ProgramLogBox = NULL; m_MainFrame = NULL; } @@ -826,7 +827,7 @@ void Pcsx2App::SysExecute( CDVD_SourceType cdvdsrc ) LoadPluginsImmediate(); CDVDsys_SetFile( CDVDsrc_Iso, g_Conf->CurrentIso ); CDVDsys_ChangeSource( cdvdsrc ); - + m_CoreThread.reset( new AppEmuThread( *m_CorePlugins ) ); m_CoreThread->Resume(); } @@ -834,7 +835,7 @@ void Pcsx2App::SysExecute( CDVD_SourceType cdvdsrc ) void Pcsx2App::OpenGsFrame() { if( m_gsFrame != NULL ) return; - + m_gsFrame = new GSFrame( m_MainFrame, L"PCSX2" ); m_gsFrame->SetFocus(); pDsp = (uptr)m_gsFrame->GetHandle(); diff --git a/pcsx2/gui/ConsoleLogger.cpp b/pcsx2/gui/ConsoleLogger.cpp index 2b0765edcd..599be60233 100644 --- a/pcsx2/gui/ConsoleLogger.cpp +++ b/pcsx2/gui/ConsoleLogger.cpp @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "App.h" #include "MainFrame.h" +#include "ConsoleLogger.h" #include "Utilities/Console.h" #include "DebugTools/Debug.h" @@ -551,6 +552,32 @@ void ConsoleLogFrame::DoMessage() } } +ConsoleLogFrame* Pcsx2App::GetProgramLog() +{ + return m_ProgramLogBox; +} + +void Pcsx2App::CloseProgramLog() +{ + if( m_ProgramLogBox == NULL ) return; + + m_ProgramLogBox->Close(); + + // disable future console log messages from being sent to the window. + m_ProgramLogBox = NULL; +} + +void Pcsx2App::ProgramLog_CountMsg() +{ + if ((wxTheApp == NULL) || ( m_ProgramLogBox == NULL )) return; + m_ProgramLogBox->CountMessage(); +} + +void Pcsx2App::ProgramLog_PostEvent( wxEvent& evt ) +{ + if ((wxTheApp == NULL) || ( m_ProgramLogBox == NULL )) return; + m_ProgramLogBox->GetEventHandler()->AddPendingEvent( evt ); +} ////////////////////////////////////////////////////////////////////////////////////////// // @@ -566,7 +593,7 @@ namespace Console // they are implemented here using a mutex lock for maximum safety. static void _immediate_logger( const char* src ) { - + ScopedLock locker( immediate_log_lock ); if( emuLog != NULL ) @@ -576,9 +603,9 @@ namespace Console // [TODO] make this a configurable option? Do we care? :) #ifdef __LINUX__ // puts does automatic newlines, which we don't want here - - /*if (strchr(src, '\n')) - { + + /*if (strchr(src, '\n')) + { fputs( "PCSX2 > ", stdout ); fputs( src , stdout); } diff --git a/pcsx2/gui/ConsoleLogger.h b/pcsx2/gui/ConsoleLogger.h index 51ffe962a7..18a72967ca 100644 --- a/pcsx2/gui/ConsoleLogger.h +++ b/pcsx2/gui/ConsoleLogger.h @@ -1,6 +1,6 @@ /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2009 PCSX2 Dev Team - * + * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -15,6 +15,7 @@ #pragma once +#include "App.h" BEGIN_DECLARE_EVENT_TYPES() DECLARE_EVENT_TYPE(wxEVT_DockConsole, -1) @@ -22,8 +23,6 @@ END_DECLARE_EVENT_TYPES() static const bool EnableThreadedLoggingTest = false; //true; -using namespace Threading; - class LogWriteEvent; // -------------------------------------------------------------------------------------- @@ -67,18 +66,18 @@ protected: // of the console logger. // -------------------------------------------------------------------------------------- -class ConsoleTestThread : public PersistentThread +class ConsoleTestThread : public Threading::PersistentThread { protected: volatile bool m_done; sptr ExecuteTask(); -public: +public: ConsoleTestThread() : m_done( false ) { } - + ~ConsoleTestThread() throw() { m_done = true; diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index 12bdcdb374..dbd1d2ec9f 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -60,11 +60,11 @@ namespace Implementations { // FIXME : Reimplement framelimiting using new double-switch boolean system } - + void Framelimiter_TurboToggle() { } - + void Framelimiter_MasterToggle() { } @@ -74,18 +74,18 @@ namespace Implementations AppInvoke( CoreThread, Suspend() ); AppInvoke( MainFrame, ApplySettings() ); } - + void Emu_Resume() { AppInvoke( CoreThread, Resume() ); AppInvoke( MainFrame, ApplySettings() ); } - + void Emu_TakeSnapshot() { GSmakeSnapshot( g_Conf->Folders.Snapshots.ToAscii().data() ); } - + void Emu_RenderToggle() { AppInvoke( CoreThread, Suspend() ); @@ -144,7 +144,7 @@ namespace Implementations mtgsThread->SendSimplePacket(GS_RINGTYPE_RECORD, g_Pcsx2Recording, 0, 0); if( SPU2setupRecording != NULL ) SPU2setupRecording(g_Pcsx2Recording, NULL); } - + void Cpu_DumpRegisters() { #ifdef PCSX2_DEVBUILD @@ -158,7 +158,7 @@ namespace Implementations // CommandDeclarations table // -------------------------------------------------------------------------------------- -static const GlobalCommandDescriptor CommandDeclarations[] = +static const GlobalCommandDescriptor CommandDeclarations[] = { { "States_FreezeCurrentSlot", States_FreezeCurrentSlot, @@ -171,25 +171,25 @@ static const GlobalCommandDescriptor CommandDeclarations[] = wxLt( "Load state" ), wxLt( "Loads a virtual machine state from the current slot." ), }, - + { "States_CycleSlotForward", States_CycleSlotForward, wxLt( "Cycle to next slot" ), wxLt( "Cycles the current save slot in +1 fashion!" ), }, - + { "States_CycleSlotBackward", States_CycleSlotBackward, wxLt( "Cycle to prev slot" ), wxLt( "Cycles the current save slot in -1 fashion!" ), }, - + { "Frameskip_Toggle", Implementations::Frameskip_Toggle, NULL, NULL, }, - + { "Framelimiter_TurboToggle", Implementations::Framelimiter_TurboToggle, NULL, @@ -236,15 +236,15 @@ static const GlobalCommandDescriptor CommandDeclarations[] = NULL, NULL, }, - - + + // Command Declarations terminator: // (must always be last in list!!) { NULL } }; AcceleratorDictionary::AcceleratorDictionary() : - HashMap( 0, 0xffffffff ) + _parent( 0, 0xffffffff ) { } @@ -252,7 +252,7 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& acode, const char *se { const GlobalCommandDescriptor* result = NULL; TryGetValue( acode.val32, result ); - + if( result != NULL ) { Console::Notice( wxsFormat( @@ -284,7 +284,7 @@ void Pcsx2App::BuildCommandHash() GlobalCommands[curcmd->Id] = curcmd; curcmd++; } - + } void Pcsx2App::InitDefaultGlobalAccelerators() diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 796c6e27cc..bfca14b91d 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -15,6 +15,7 @@ #include "PrecompiledHeader.h" #include "MainFrame.h" +#include "ConsoleLogger.h" #include "Resources/EmbeddedImage.h" #include "Resources/AppIcon16.h" diff --git a/plugins/GSnull/GifTransfer.h b/plugins/GSnull/GifTransfer.h index ca6ea8de97..a63a8d799d 100644 --- a/plugins/GSnull/GifTransfer.h +++ b/plugins/GSnull/GifTransfer.h @@ -132,6 +132,8 @@ struct GIFTAG u32 flg : 2; u32 nreg : 4; u32 regs[2]; + + GIFTAG() {} }; struct GIFPath