mirror of https://github.com/PCSX2/pcsx2.git
Merge branch 'coverity-qa-extra'
This commit is contained in:
commit
421043ed12
|
@ -29,16 +29,28 @@ void pxTrap();
|
|||
// exception. Use this macro to dispose of these dangerous exceptions, and generate a
|
||||
// friendly error log in their wake.
|
||||
//
|
||||
// Note: Console can also fire an Exception::OutOfMemory
|
||||
#define __DESTRUCTOR_CATCHALL( funcname ) \
|
||||
catch( BaseException& ex ) \
|
||||
{ \
|
||||
Console.Error( "Unhandled BaseException in %s (ignored!):", funcname ); \
|
||||
Console.Error( ex.FormatDiagnosticMessage() ); \
|
||||
try { \
|
||||
Console.Error( "Unhandled BaseException in %s (ignored!):", funcname ); \
|
||||
Console.Error( ex.FormatDiagnosticMessage() ); \
|
||||
} catch (...) { \
|
||||
fprintf(stderr, "ERROR: (out of memory?)\n"); \
|
||||
} \
|
||||
} \
|
||||
catch( std::exception& ex ) \
|
||||
{ \
|
||||
Console.Error( "Unhandled std::exception in %s (ignored!):", funcname ); \
|
||||
Console.Error( ex.what() ); \
|
||||
try { \
|
||||
Console.Error( "Unhandled std::exception in %s (ignored!):", funcname ); \
|
||||
Console.Error( ex.what() ); \
|
||||
} catch (...) { \
|
||||
fprintf(stderr, "ERROR: (out of memory?)\n"); \
|
||||
} \
|
||||
} \
|
||||
catch(...) { \
|
||||
/* Unreachable code */ \
|
||||
}
|
||||
|
||||
#define DESTRUCTOR_CATCHALL __DESTRUCTOR_CATCHALL( __pxFUNCTION__ )
|
||||
|
|
|
@ -109,7 +109,7 @@ protected:
|
|||
bool m_handled;
|
||||
|
||||
public:
|
||||
SrcType_PageFault() {}
|
||||
SrcType_PageFault() : m_handled(false) {}
|
||||
virtual ~SrcType_PageFault() throw() { }
|
||||
|
||||
bool WasHandled() const { return m_handled; }
|
||||
|
|
|
@ -145,7 +145,6 @@ class FastFormatAscii
|
|||
protected:
|
||||
ScopedAlignedAlloc<char,16>* m_dest;
|
||||
bool m_deleteDest;
|
||||
uint m_Length;
|
||||
|
||||
public:
|
||||
FastFormatAscii();
|
||||
|
@ -155,7 +154,6 @@ public:
|
|||
|
||||
void Clear();
|
||||
bool IsEmpty() const;
|
||||
uint Length() const { return m_Length; }
|
||||
|
||||
const char* c_str() const { return m_dest->GetPtr(); }
|
||||
operator const char*() const { return m_dest->GetPtr(); }
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
ConsoleColors DefaultColor;
|
||||
|
||||
protected:
|
||||
ConsoleLogSource() {}
|
||||
ConsoleLogSource() : DefaultColor(Color_Gray) {}
|
||||
|
||||
public:
|
||||
ConsoleLog_ImplementBaseAPI(ConsoleLogSource)
|
||||
|
|
|
@ -558,7 +558,10 @@ ConsoleIndentScope::ConsoleIndentScope( int tabs )
|
|||
|
||||
ConsoleIndentScope::~ConsoleIndentScope() throw()
|
||||
{
|
||||
LeaveScope();
|
||||
try {
|
||||
LeaveScope();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void ConsoleIndentScope::EnterScope()
|
||||
|
@ -581,8 +584,11 @@ ConsoleAttrScope::ConsoleAttrScope( ConsoleColors newcolor, int indent )
|
|||
|
||||
ConsoleAttrScope::~ConsoleAttrScope() throw()
|
||||
{
|
||||
Console.SetColor( m_old_color );
|
||||
Console.SetIndent( -m_tabsize );
|
||||
try {
|
||||
Console.SetColor( m_old_color );
|
||||
Console.SetIndent( -m_tabsize );
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -261,10 +261,13 @@ FastFormatUnicode::FastFormatUnicode()
|
|||
|
||||
FastFormatUnicode::~FastFormatUnicode() throw()
|
||||
{
|
||||
if (m_deleteDest)
|
||||
delete m_dest;
|
||||
else
|
||||
m_buffer_tls.Get()->ReleaseBuffer();
|
||||
try {
|
||||
if (m_deleteDest)
|
||||
delete m_dest;
|
||||
else
|
||||
m_buffer_tls.Get()->ReleaseBuffer();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void FastFormatUnicode::Clear()
|
||||
|
@ -396,10 +399,13 @@ FastFormatAscii::FastFormatAscii()
|
|||
|
||||
FastFormatAscii::~FastFormatAscii() throw()
|
||||
{
|
||||
if (m_deleteDest)
|
||||
delete m_dest;
|
||||
else
|
||||
m_buffer_tls.Get()->ReleaseBuffer();
|
||||
try {
|
||||
if (m_deleteDest)
|
||||
delete m_dest;
|
||||
else
|
||||
m_buffer_tls.Get()->ReleaseBuffer();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void FastFormatAscii::Clear()
|
||||
|
|
|
@ -342,7 +342,7 @@ void BaseVmReserveListener::OnPageFaultEvent(const PageFaultInfo& info, bool& ha
|
|||
// --------------------------------------------------------------------------------------
|
||||
|
||||
SpatialArrayReserve::SpatialArrayReserve( const wxString& name ) :
|
||||
_parent( name )
|
||||
_parent( name ), m_numblocks(0)
|
||||
{
|
||||
m_prot_mode = PageAccess_ReadWrite();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,12 @@
|
|||
pxStaticText::pxStaticText( wxWindow* parent )
|
||||
: _parent( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER )
|
||||
{
|
||||
m_align = wxALIGN_CENTRE_HORIZONTAL;
|
||||
m_autowrap = true;
|
||||
m_wrappedWidth = -1;
|
||||
m_heightInLines = 1;
|
||||
|
||||
SetPaddingDefaults();
|
||||
}
|
||||
|
||||
pxStaticText::pxStaticText( wxWindow* parent, const wxString& label, wxAlignment align )
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
class AsyncFileReader
|
||||
{
|
||||
protected:
|
||||
AsyncFileReader() : m_dataoffset(0) {}
|
||||
AsyncFileReader() : m_dataoffset(0), m_blocksize(0) {}
|
||||
|
||||
wxString m_filename;
|
||||
|
||||
|
|
|
@ -45,7 +45,12 @@ bool BlockdumpFileReader::DetectBlockdump(AsyncFileReader* reader)
|
|||
return isbd;
|
||||
}
|
||||
|
||||
BlockdumpFileReader::BlockdumpFileReader(void)
|
||||
BlockdumpFileReader::BlockdumpFileReader(void) :
|
||||
m_file(NULL),
|
||||
m_blocks(0),
|
||||
m_blockofs(0),
|
||||
m_dtablesize(0),
|
||||
m_lresult(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -43,10 +43,12 @@ bool CsoFileReader::CanHandle(const wxString& fileName) {
|
|||
if (wxFileName::FileExists(fileName) && fileName.Lower().EndsWith(L".cso")) {
|
||||
FILE* fp = PX_fopen_rb(fileName);
|
||||
CsoHeader hdr;
|
||||
if (fp && fread(&hdr, 1, sizeof(hdr), fp) == sizeof(hdr)) {
|
||||
supported = ValidateHeader(hdr);
|
||||
if (fp) {
|
||||
if (fread(&hdr, 1, sizeof(hdr), fp) == sizeof(hdr)) {
|
||||
supported = ValidateHeader(hdr);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
return supported;
|
||||
}
|
||||
|
|
|
@ -37,8 +37,12 @@ class CsoFileReader : public AsyncFileReader
|
|||
DeclareNoncopyableObject(CsoFileReader);
|
||||
public:
|
||||
CsoFileReader(void) :
|
||||
m_frameSize(0),
|
||||
m_frameShift(0),
|
||||
m_indexShift(0),
|
||||
m_readBuffer(0),
|
||||
m_zlibBuffer(0),
|
||||
m_zlibBufferFrame(0),
|
||||
m_index(0),
|
||||
m_totalSize(0),
|
||||
m_src(0),
|
||||
|
|
|
@ -178,6 +178,7 @@ static wxString iso2indexname(const wxString& isoname) {
|
|||
}
|
||||
|
||||
GzippedFileReader::GzippedFileReader(void) :
|
||||
mBytesRead(0),
|
||||
m_pIndex(0),
|
||||
m_zstates(0),
|
||||
m_src(0),
|
||||
|
|
|
@ -105,6 +105,7 @@ IsoDirectory::IsoDirectory(SectorSource& r)
|
|||
IsoDirectory::IsoDirectory(SectorSource& r, IsoFileDescriptor directoryEntry)
|
||||
: internalReader(r)
|
||||
{
|
||||
m_fstype = FStype_ISO9660;
|
||||
Init(directoryEntry);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,14 @@ u32 __fastcall standardizeBreakpointAddress(u32 addr)
|
|||
return addr;
|
||||
}
|
||||
|
||||
MemCheck::MemCheck()
|
||||
MemCheck::MemCheck() :
|
||||
start(0),
|
||||
end(0),
|
||||
cond(MEMCHECK_READWRITE),
|
||||
result(MEMCHECK_BOTH),
|
||||
lastPC(0),
|
||||
lastAddr(0),
|
||||
lastSize(0)
|
||||
{
|
||||
numHits = 0;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,8 @@ struct BreakPointCond
|
|||
|
||||
struct BreakPoint
|
||||
{
|
||||
BreakPoint() : hasCond(false) {}
|
||||
BreakPoint() : addr(0), enabled(false), temporary(false), hasCond(false)
|
||||
{}
|
||||
|
||||
u32 addr;
|
||||
bool enabled;
|
||||
|
|
|
@ -90,7 +90,10 @@ void SysMtgsThread::OnStart()
|
|||
|
||||
SysMtgsThread::~SysMtgsThread() throw()
|
||||
{
|
||||
_parent::Cancel();
|
||||
try {
|
||||
_parent::Cancel();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void SysMtgsThread::OnResumeReady()
|
||||
|
|
|
@ -64,7 +64,10 @@ VU_Thread::VU_Thread(BaseVUmicroCPU*& _vuCPU, VURegs& _vuRegs) :
|
|||
|
||||
VU_Thread::~VU_Thread() throw()
|
||||
{
|
||||
pxThread::Cancel();
|
||||
try {
|
||||
pxThread::Cancel();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void VU_Thread::Reset()
|
||||
|
|
|
@ -322,8 +322,11 @@ CpuInitializer< CpuType >::CpuInitializer()
|
|||
template< typename CpuType >
|
||||
CpuInitializer< CpuType >::~CpuInitializer() throw()
|
||||
{
|
||||
if (MyCpu)
|
||||
MyCpu->Shutdown();
|
||||
try {
|
||||
if (MyCpu)
|
||||
MyCpu->Shutdown();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
@ -366,7 +369,10 @@ SysMainMemory::SysMainMemory()
|
|||
|
||||
SysMainMemory::~SysMainMemory() throw()
|
||||
{
|
||||
ReleaseAll();
|
||||
try {
|
||||
ReleaseAll();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void SysMainMemory::ReserveAll()
|
||||
|
|
|
@ -55,7 +55,10 @@ SysCoreThread::SysCoreThread()
|
|||
|
||||
SysCoreThread::~SysCoreThread() throw()
|
||||
{
|
||||
SysCoreThread::Cancel();
|
||||
try {
|
||||
SysCoreThread::Cancel();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void SysCoreThread::Cancel( bool isBlocking )
|
||||
|
|
|
@ -61,12 +61,16 @@ public:
|
|||
BaseCpuProvider()
|
||||
{
|
||||
m_Reserved = 0;
|
||||
IsInterpreter = false;
|
||||
}
|
||||
|
||||
virtual ~BaseCpuProvider() throw()
|
||||
{
|
||||
if( m_Reserved != 0 )
|
||||
Console.Warning( "Cleanup miscount detected on CPU provider. Count=%d", m_Reserved );
|
||||
try {
|
||||
if( m_Reserved != 0 )
|
||||
Console.Warning( "Cleanup miscount detected on CPU provider. Count=%d", m_Reserved );
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
virtual const char* GetShortName() const=0;
|
||||
|
|
|
@ -198,6 +198,8 @@ public:
|
|||
protected:
|
||||
BaseCompressThread()
|
||||
{
|
||||
m_gzfp = NULL;
|
||||
m_src_list = NULL;
|
||||
m_PendingSaveFlag = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,12 +24,15 @@
|
|||
|
||||
BaseCompressThread::~BaseCompressThread() throw()
|
||||
{
|
||||
_parent::Cancel();
|
||||
if( m_PendingSaveFlag )
|
||||
{
|
||||
wxGetApp().ClearPendingSave();
|
||||
m_PendingSaveFlag = false;
|
||||
try {
|
||||
_parent::Cancel();
|
||||
if( m_PendingSaveFlag )
|
||||
{
|
||||
wxGetApp().ClearPendingSave();
|
||||
m_PendingSaveFlag = false;
|
||||
}
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void BaseCompressThread::SetPendingSave()
|
||||
|
|
|
@ -219,10 +219,12 @@ struct AppImageIds
|
|||
|
||||
ToolbarIds()
|
||||
{
|
||||
Settings = Play =
|
||||
PluginVideo =
|
||||
PluginAudio =
|
||||
PluginPad = -1;
|
||||
Settings = -1;
|
||||
Play = -1;
|
||||
Resume = -1;
|
||||
PluginVideo = -1;
|
||||
PluginAudio = -1;
|
||||
PluginPad = -1;
|
||||
}
|
||||
} Toolbars;
|
||||
};
|
||||
|
@ -262,8 +264,6 @@ protected:
|
|||
int m_fpsqueue_writepos;
|
||||
uint m_initpause;
|
||||
|
||||
uint m_FrameCounter;
|
||||
|
||||
public:
|
||||
FramerateManager() { Reset(); }
|
||||
virtual ~FramerateManager() throw() {}
|
||||
|
|
|
@ -89,7 +89,10 @@ AppCoreThread::AppCoreThread() : SysCoreThread()
|
|||
|
||||
AppCoreThread::~AppCoreThread() throw()
|
||||
{
|
||||
_parent::Cancel(); // use parent's, skips thread affinity check.
|
||||
try {
|
||||
_parent::Cancel(); // use parent's, skips thread affinity check.
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
static void _Cancel()
|
||||
|
@ -734,8 +737,11 @@ ScopedCoreThreadClose::ScopedCoreThreadClose()
|
|||
ScopedCoreThreadClose::~ScopedCoreThreadClose() throw()
|
||||
{
|
||||
if( m_alreadyScoped ) return;
|
||||
_parent::DoResume();
|
||||
ScopedCore_IsFullyClosed = false;
|
||||
try {
|
||||
_parent::DoResume();
|
||||
ScopedCore_IsFullyClosed = false;
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
ScopedCoreThreadPause::ScopedCoreThreadPause( BaseSysExecEvent_ScopedCore* abuse_me )
|
||||
|
@ -761,8 +767,11 @@ ScopedCoreThreadPause::ScopedCoreThreadPause( BaseSysExecEvent_ScopedCore* abuse
|
|||
ScopedCoreThreadPause::~ScopedCoreThreadPause() throw()
|
||||
{
|
||||
if( m_alreadyScoped ) return;
|
||||
_parent::DoResume();
|
||||
ScopedCore_IsPaused = false;
|
||||
try {
|
||||
_parent::DoResume();
|
||||
ScopedCore_IsPaused = false;
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
ScopedCoreThreadPopup::ScopedCoreThreadPopup()
|
||||
|
|
|
@ -48,7 +48,10 @@ protected:
|
|||
public:
|
||||
AppGameDatabase() {}
|
||||
virtual ~AppGameDatabase() throw() {
|
||||
Console.WriteLn( "(GameDB) Unloading..." );
|
||||
try {
|
||||
Console.WriteLn( "(GameDB) Unloading..." );
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
AppGameDatabase& LoadFromFile(const wxString& file = Path::Combine( PathDefs::GetProgramDataDir(), wxFileName(L"GameIndex.dbf") ), const wxString& key = L"Serial" );
|
||||
|
|
|
@ -374,7 +374,10 @@ public:
|
|||
|
||||
virtual ~GameDatabaseLoaderThread() throw()
|
||||
{
|
||||
_parent::Cancel();
|
||||
try {
|
||||
_parent::Cancel();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -697,10 +700,13 @@ Pcsx2App::Pcsx2App()
|
|||
|
||||
m_PendingSaves = 0;
|
||||
m_ScheduledTermination = false;
|
||||
m_UseGUI = true;
|
||||
m_NoGuiExitPrompt = true;
|
||||
|
||||
m_id_MainFrame = wxID_ANY;
|
||||
m_id_GsFrame = wxID_ANY;
|
||||
m_id_ProgramLogBox = wxID_ANY;
|
||||
m_id_Disassembler = wxID_ANY;
|
||||
m_ptr_ProgramLog = NULL;
|
||||
|
||||
SetAppName( L"PCSX2" );
|
||||
|
|
|
@ -519,8 +519,6 @@ void FramerateManager::Resume()
|
|||
|
||||
void FramerateManager::DoFrame()
|
||||
{
|
||||
++m_FrameCounter;
|
||||
|
||||
m_fpsqueue_writepos = (m_fpsqueue_writepos + 1) % FramerateQueueDepth;
|
||||
m_fpsqueue[m_fpsqueue_writepos] = GetCPUTicks();
|
||||
|
||||
|
@ -1092,6 +1090,7 @@ public:
|
|||
SysExecEvent_Execute()
|
||||
: m_UseCDVDsrc(false)
|
||||
, m_UseELFOverride(false)
|
||||
, m_cdvdsrc_type(CDVDsrc_Iso)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,10 @@ ConsoleLogFrame::ColorArray::ColorArray( int fontsize )
|
|||
|
||||
ConsoleLogFrame::ColorArray::~ColorArray() throw()
|
||||
{
|
||||
Cleanup();
|
||||
try {
|
||||
Cleanup();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::ColorArray::Create( int fontsize )
|
||||
|
|
|
@ -165,7 +165,7 @@ protected:
|
|||
ConsoleColors color;
|
||||
int startpoint;
|
||||
|
||||
ColorSection() {}
|
||||
ColorSection() : color(Color_Default), startpoint(0) {}
|
||||
ColorSection( ConsoleColors _color, int msgptr ) : color(_color), startpoint(msgptr) { }
|
||||
};
|
||||
|
||||
|
|
|
@ -45,8 +45,9 @@ CtrlRegisterList::CtrlRegisterList(wxWindow* parent, DebugInterface* _cpu)
|
|||
{
|
||||
rowHeight = g_Conf->EmuOptions.Debugger.FontHeight+2;
|
||||
charWidth = g_Conf->EmuOptions.Debugger.FontWidth;
|
||||
category = 0;
|
||||
maxBits = 128;
|
||||
category = 0;
|
||||
maxBits = 128;
|
||||
lastPc = 0xFFFFFFFF;
|
||||
|
||||
for (int i = 0; i < cpu->getRegisterCategoryCount(); i++)
|
||||
{
|
||||
|
|
|
@ -102,7 +102,6 @@ private:
|
|||
CpuTabPage* currentCpu;
|
||||
|
||||
wxBoxSizer* topSizer;
|
||||
wxStatusBar* statusBar;
|
||||
wxButton* breakRunButton;
|
||||
wxButton* stepIntoButton;
|
||||
wxButton* stepOverButton;
|
||||
|
|
|
@ -544,12 +544,15 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
|
|||
|
||||
MainEmuFrame::~MainEmuFrame() throw()
|
||||
{
|
||||
if( m_RestartEmuOnDelete )
|
||||
{
|
||||
sApp.SetExitOnFrameDelete( false );
|
||||
sApp.PostAppMethod( &Pcsx2App::DetectCpuAndUserMode );
|
||||
sApp.WipeUserModeSettings();
|
||||
try {
|
||||
if( m_RestartEmuOnDelete )
|
||||
{
|
||||
sApp.SetExitOnFrameDelete( false );
|
||||
sApp.PostAppMethod( &Pcsx2App::DetectCpuAndUserMode );
|
||||
sApp.WipeUserModeSettings();
|
||||
}
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
void MainEmuFrame::DoGiveHelp(const wxString& text, bool show)
|
||||
|
|
|
@ -561,7 +561,10 @@ namespace Panels
|
|||
public:
|
||||
virtual ~EnumThread() throw()
|
||||
{
|
||||
pxThread::Cancel();
|
||||
try {
|
||||
pxThread::Cancel();
|
||||
}
|
||||
DESTRUCTOR_CATCHALL
|
||||
}
|
||||
|
||||
EnumThread( PluginSelectorPanel& master );
|
||||
|
|
|
@ -208,6 +208,7 @@ namespace vtlb_private
|
|||
MapData()
|
||||
{
|
||||
vmap = NULL;
|
||||
ppmap = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
|
|||
threads = theApp.GetConfig("extrathreads", 0);
|
||||
}
|
||||
|
||||
GSWnd* wnd[2];
|
||||
GSWnd* wnd[2] = { NULL, NULL };
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -315,7 +315,6 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
|
|||
wnd[1] = new GSWndOGL();
|
||||
#else
|
||||
wnd[0] = new GSWndOGL();
|
||||
wnd[1] = NULL;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ GSDevice::GSDevice()
|
|||
, m_fxaa(NULL)
|
||||
, m_shadeboost(NULL)
|
||||
, m_1x1(NULL)
|
||||
, m_current(NULL)
|
||||
, m_frame(0)
|
||||
{
|
||||
memset(&m_vertex, 0, sizeof(m_vertex));
|
||||
|
|
|
@ -46,12 +46,16 @@ int GSDeviceOGL::s_n = 0;
|
|||
FILE* GSDeviceOGL::m_debug_gl_file = NULL;
|
||||
|
||||
GSDeviceOGL::GSDeviceOGL()
|
||||
: m_free_window(false)
|
||||
, m_window(NULL)
|
||||
, m_fbo(0)
|
||||
, m_fbo_read(0)
|
||||
, m_va(NULL)
|
||||
, m_shader(NULL)
|
||||
: m_msaa(0)
|
||||
, m_window(NULL)
|
||||
, m_fbo(0)
|
||||
, m_fbo_read(0)
|
||||
, m_va(NULL)
|
||||
, m_apitrace(0)
|
||||
, m_palette_ss(0)
|
||||
, m_vs_cb(NULL)
|
||||
, m_ps_cb(NULL)
|
||||
, m_shader(NULL)
|
||||
{
|
||||
memset(&m_merge_obj, 0, sizeof(m_merge_obj));
|
||||
memset(&m_interlace, 0, sizeof(m_interlace));
|
||||
|
@ -59,6 +63,8 @@ GSDeviceOGL::GSDeviceOGL()
|
|||
memset(&m_fxaa, 0, sizeof(m_fxaa));
|
||||
memset(&m_shaderfx, 0, sizeof(m_shaderfx));
|
||||
memset(&m_date, 0, sizeof(m_date));
|
||||
memset(&m_shadeboost, 0, sizeof(m_shadeboost));
|
||||
memset(&m_om_dss, 0, sizeof(m_om_dss));
|
||||
GLState::Clear();
|
||||
|
||||
// Reset the debug file
|
||||
|
|
|
@ -390,7 +390,6 @@ class GSDeviceOGL : public GSDevice
|
|||
static bool m_debug_gl_call;
|
||||
static FILE* m_debug_gl_file;
|
||||
|
||||
bool m_free_window;
|
||||
GSWnd* m_window;
|
||||
|
||||
GLuint m_fbo; // frame buffer container
|
||||
|
@ -446,7 +445,6 @@ class GSDeviceOGL : public GSDevice
|
|||
GLuint m_apitrace;
|
||||
|
||||
GLuint m_palette_ss;
|
||||
GLuint m_rt_ss;
|
||||
|
||||
GSUniformBufferOGL* m_vs_cb;
|
||||
GSUniformBufferOGL* m_ps_cb;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
GSDump::GSDump()
|
||||
: m_gs(NULL)
|
||||
, m_frames(0)
|
||||
, m_extra_frames(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -130,6 +130,11 @@ GSDumpLzma::~GSDumpLzma() {
|
|||
/******************************************************************/
|
||||
|
||||
GSDumpRaw::GSDumpRaw(char* filename) : GSDumpFile(filename) {
|
||||
m_buff_size = 0;
|
||||
m_area = NULL;
|
||||
m_inbuf = NULL;
|
||||
m_avail = 0;
|
||||
m_start = 0;
|
||||
}
|
||||
|
||||
GSDumpRaw::~GSDumpRaw() {
|
||||
|
|
|
@ -48,7 +48,6 @@ class GSDumpLzma : public GSDumpFile {
|
|||
|
||||
size_t m_avail;
|
||||
size_t m_start;
|
||||
bool m_eof;
|
||||
|
||||
void Decompress();
|
||||
|
||||
|
@ -70,7 +69,6 @@ class GSDumpRaw : public GSDumpFile {
|
|||
|
||||
size_t m_avail;
|
||||
size_t m_start;
|
||||
bool m_eof;
|
||||
|
||||
void Decompress();
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ GSRenderer::GSRenderer()
|
|||
: m_shader(0)
|
||||
, m_shift_key(false)
|
||||
, m_control_key(false)
|
||||
, m_framelimit(false)
|
||||
, m_texture_shuffle(false)
|
||||
, m_wnd(NULL)
|
||||
, m_dev(NULL)
|
||||
{
|
||||
|
|
|
@ -30,7 +30,6 @@ class GSRenderer : public GSState
|
|||
{
|
||||
GSCapture m_capture;
|
||||
string m_snapshot;
|
||||
bool m_snapdump;
|
||||
int m_shader;
|
||||
|
||||
bool Merge(int field);
|
||||
|
|
|
@ -49,21 +49,21 @@ GSRendererHW::GSRendererHW(GSTextureCache* tc)
|
|||
|
||||
void GSRendererHW::SetScaling()
|
||||
{
|
||||
m_buffer_size = max(m_context->FRAME.FBW * 64, m_regs->DISP[m_regs->PMODE.EN1 == 1 ? 0 : 1].DISPFB.FBW * 64);
|
||||
int buffer_size = max(m_context->FRAME.FBW * 64, m_regs->DISP[m_regs->PMODE.EN1 == 1 ? 0 : 1].DISPFB.FBW * 64);
|
||||
|
||||
//Only increase the buffer size, don't make it smaller, it breaks games (GH3)
|
||||
|
||||
// Also don't change the size for custom resolution (m_upscale_multiplier = 0).
|
||||
if (m_upscale_multiplier && m_width < (m_buffer_size * m_upscale_multiplier)) {
|
||||
if (m_upscale_multiplier && m_width < (buffer_size * m_upscale_multiplier)) {
|
||||
m_tc->RemovePartial();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
m_height = m_buffer_size < 1024 ? 512 : 1024;
|
||||
m_height = buffer_size < 1024 ? 512 : 1024;
|
||||
|
||||
if (m_upscale_multiplier > 1) {
|
||||
m_width = m_buffer_size * m_upscale_multiplier;
|
||||
m_width = buffer_size * m_upscale_multiplier;
|
||||
m_height *= m_upscale_multiplier;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ private:
|
|||
int m_skip;
|
||||
bool m_reset;
|
||||
int m_upscale_multiplier;
|
||||
int m_buffer_size;
|
||||
int m_userhacks_skipdraw;
|
||||
|
||||
bool m_userhacks_align_sprite_X;
|
||||
|
|
|
@ -35,6 +35,8 @@ GSRendererOGL::GSRendererOGL()
|
|||
UserHacks_TCO_x = (UserHacks_TCOffset & 0xFFFF) / -1000.0f;
|
||||
UserHacks_TCO_y = ((UserHacks_TCOffset >> 16) & 0xFFFF) / -1000.0f;
|
||||
|
||||
m_prim_overlap = PRIM_OVERLAP_UNKNOW;
|
||||
|
||||
if (!theApp.GetConfig("UserHacks", 0)) {
|
||||
UserHacks_TCOffset = 0;
|
||||
UserHacks_TCO_x = 0;
|
||||
|
|
|
@ -1534,6 +1534,8 @@ GSRendererSW::SharedData::SharedData(GSRendererSW* parent)
|
|||
: m_parent(parent)
|
||||
, m_fb_pages(NULL)
|
||||
, m_zb_pages(NULL)
|
||||
, m_fpsm(0)
|
||||
, m_zpsm(0)
|
||||
, m_using_pages(false)
|
||||
, m_syncpoint(SyncNone)
|
||||
{
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "GLState.h"
|
||||
|
||||
GSShaderOGL::GSShaderOGL(bool debug) :
|
||||
m_pipeline(0),
|
||||
m_debug_shader(debug)
|
||||
{
|
||||
m_single_prog.clear();
|
||||
|
|
|
@ -4143,7 +4143,7 @@ bool GSC_ShadowofRome(const GSFrameInfo& fi, int& skip)
|
|||
{
|
||||
skip = 1;
|
||||
}
|
||||
else if(fi.TME && (fi.FBP >=0x0) && fi.FPSM == PSM_PSMCT32 && (fi.TBP0 ==0x0160 ||fi.TBP0==0x01e0 || fi.TBP0<=0x0800) && fi.TPSM == PSM_PSMT8)
|
||||
else if(fi.TME && fi.FPSM == PSM_PSMCT32 && (fi.TBP0 ==0x0160 ||fi.TBP0==0x01e0 || fi.TBP0<=0x0800) && fi.TPSM == PSM_PSMT8)
|
||||
{
|
||||
skip = 1;
|
||||
}
|
||||
|
@ -5113,7 +5113,7 @@ bool GSC_AlpineRacer3(const GSFrameInfo& fi, int& skip)
|
|||
{
|
||||
if(skip == 0)
|
||||
{
|
||||
if(!fi.TME && fi.FBP == 0 && fi.TBP0>=0 && (fi.TPSM >= 0 ) && (fi.FBMSK ==0x0001 ||fi.FBMSK == 0x00FFFFFF))
|
||||
if(!fi.TME && fi.FBP == 0 && (fi.FBMSK ==0x0001 ||fi.FBMSK == 0x00FFFFFF))
|
||||
{
|
||||
skip = 2;
|
||||
}
|
||||
|
@ -5179,7 +5179,7 @@ bool GSC_TalesofSymphonia(const GSFrameInfo& fi, int& skip)
|
|||
{
|
||||
if(skip == 0)
|
||||
{
|
||||
if(fi.TME && (fi.FBP >= 0) && fi.FPSM == PSM_PSMCT32 && (fi.TBP0 == 0x2bc0 || fi.TBP0 <= 0x0200) && (fi.FBMSK==0xFF000000 ||fi.FBMSK==0x00FFFFFF))
|
||||
if(fi.TME && fi.FPSM == PSM_PSMCT32 && (fi.TBP0 == 0x2bc0 || fi.TBP0 <= 0x0200) && (fi.FBMSK==0xFF000000 ||fi.FBMSK==0x00FFFFFF))
|
||||
{
|
||||
skip = 1; //fi.FBMSK==0
|
||||
}
|
||||
|
|
|
@ -26,7 +26,11 @@ GSTexture::GSTexture()
|
|||
: m_scale(1, 1)
|
||||
, m_size(0, 0)
|
||||
, m_type(0)
|
||||
, m_format(0)
|
||||
, m_msaa(false)
|
||||
, last_frame_used(0)
|
||||
, LikelyOffset(false)
|
||||
, OffsetHack_modx(0.0f)
|
||||
, OffsetHack_mody(0.0f)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1251,6 +1251,7 @@ GSTextureCache::Source::Source(GSRenderer* r, const GIFRegTEX0& TEX0, const GIFR
|
|||
, m_initpalette(true)
|
||||
, m_target(false)
|
||||
, m_complete(false)
|
||||
, m_spritehack_t(false)
|
||||
, m_p2t(NULL)
|
||||
{
|
||||
m_TEX0 = TEX0;
|
||||
|
|
|
@ -60,11 +60,11 @@ class GSBufferOGL {
|
|||
// Warning m_limit is the number of object (not the size in Bytes)
|
||||
m_limit = 8 * 1024 * 1024 / m_stride;
|
||||
|
||||
if (m_buffer_storage) {
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
m_fence[i] = 0;
|
||||
}
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
m_fence[i] = 0;
|
||||
}
|
||||
|
||||
if (m_buffer_storage) {
|
||||
// TODO: if we do manually the synchronization, I'm not sure size is important. It worths to investigate it.
|
||||
// => bigger buffer => less sync
|
||||
bind();
|
||||
|
@ -254,7 +254,7 @@ class GSVertexBufferStateOGL {
|
|||
GLenum m_topology;
|
||||
|
||||
public:
|
||||
GSVertexBufferStateOGL(size_t stride, GSInputLayoutOGL* layout, uint32 layout_nbr) : m_vb(NULL), m_ib(NULL)
|
||||
GSVertexBufferStateOGL(size_t stride, GSInputLayoutOGL* layout, uint32 layout_nbr) : m_vb(NULL), m_ib(NULL), m_topology(0)
|
||||
{
|
||||
gl_GenVertexArrays(1, &m_va);
|
||||
gl_BindVertexArray(m_va);
|
||||
|
|
|
@ -29,6 +29,9 @@ const GSVector4 GSVertexTrace::s_minmax(FLT_MAX, -FLT_MAX);
|
|||
GSVertexTrace::GSVertexTrace(const GSState* state)
|
||||
: m_state(state)
|
||||
{
|
||||
m_primclass = GS_INVALID_CLASS;
|
||||
memset(&m_alpha, 0, sizeof(m_alpha));
|
||||
|
||||
#define InitUpdate3(P, IIP, TME, FST, COLOR) \
|
||||
m_fmm[COLOR][FST][TME][IIP][P] = &GSVertexTrace::FindMinMax<P, IIP, TME, FST, COLOR>;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#if defined(__linux__)
|
||||
GSWndOGL::GSWndOGL()
|
||||
: m_NativeWindow(0), m_NativeDisplay(NULL), m_swapinterval(NULL)
|
||||
: m_NativeWindow(0), m_NativeDisplay(NULL), m_context(0), m_swapinterval(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -243,13 +243,13 @@ void GSdxApp::BuildConfigurationMap(const char* lpFileName)
|
|||
m_configuration_map["inifile"] = inifile_value;
|
||||
|
||||
// Load config from file
|
||||
char value[255];
|
||||
char key[255];
|
||||
char value[256];
|
||||
char key[256];
|
||||
FILE* f = fopen(lpFileName, "r");
|
||||
|
||||
if (f == NULL) return; // FIXME print a nice message
|
||||
|
||||
while( fscanf(f, "%s = %s\n", key, value) != EOF ) {
|
||||
while( fscanf(f, "%255s = %255s\n", key, value) != EOF ) {
|
||||
std::string key_s(key);
|
||||
std::string value_s(value);
|
||||
m_configuration_map[key_s] = value_s;
|
||||
|
|
Loading…
Reference in New Issue