From 07a16bc76de95e22f89911a7451630d26ce7208e Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sun, 25 Apr 2010 09:02:36 +0000 Subject: [PATCH] zzogl-pg: Get rid of RELEASE_TO_PUBLIC, and use ZEROGS_DEVBUILD instead. Fix a typo I noticed. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2901 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/GSmain.cpp | 22 ++++++++++++++-------- plugins/zzogl-pg/opengl/Regs.cpp | 4 ++-- plugins/zzogl-pg/opengl/Util.h | 11 +++-------- plugins/zzogl-pg/opengl/ZZoglCRTC.cpp | 8 ++++---- plugins/zzogl-pg/opengl/ZZoglCreate.cpp | 4 ++-- plugins/zzogl-pg/opengl/ZZoglFlush.cpp | 10 +++++----- plugins/zzogl-pg/opengl/ZZoglSave.cpp | 6 +++--- plugins/zzogl-pg/opengl/ZZoglShaders.cpp | 4 ++-- plugins/zzogl-pg/opengl/targets.cpp | 12 ++++++------ plugins/zzogl-pg/opengl/zerogs.cpp | 4 +--- 10 files changed, 42 insertions(+), 43 deletions(-) diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index 7273721d54..b93f421717 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -74,10 +74,10 @@ unsigned char zgsminor = 0; #ifdef _DEBUG char *libraryName = "ZZ Ogl PG (Debug) "; -#elif defined(RELEASE_TO_PUBLIC) -char *libraryName = "ZZ Ogl PG "; +#elif defined(ZEROGS_DEVBUILD) +char *libraryName = "ZZ Ogl PG (Dev)"; #else -char *libraryName = "ZZ Ogl PG (Dev) "; +char *libraryName = "ZZ Ogl PG "; #endif static const char* s_aa[5] = { "AA none |", "AA 2x |", "AA 4x |", "AA 8x |", "AA 16x |" }; @@ -91,7 +91,7 @@ extern int g_nPixelShaderVer; extern int g_nFrameRender; extern int g_nFramesSkipped; -#ifdef RELEASE_TO_PUBLIC +#if !defined(ZEROGS_DEVBUILD) #define g_bWriteProfile 0 #else BOOL g_bWriteProfile = 0; @@ -142,6 +142,12 @@ namespace ZZLog // (GSinit won't have been called then) return (gsLog != NULL && conf.log); } + + void WriteToScreen(const char* pstr, u32 ms) + { + ZeroGS::AddMessage(pstr, ms); + } + void _Message(const char *str) { SysMessage(str); @@ -241,7 +247,7 @@ namespace ZZLog void GS_Log(const char *fmt, ...) { -#if ZEROGS_DEVBUILD +#ifdef ZEROGS_DEVBUILD va_list list; va_start(list,fmt); @@ -260,7 +266,7 @@ namespace ZZLog void Warn_Log(const char *fmt, ...) { -#if ZEROGS_DEVBUILD +#ifdef ZEROGS_DEVBUILD va_list list; va_start(list,fmt); @@ -1004,7 +1010,7 @@ void CALLBACK GSvsync(int interlace) dwTime = d; g_nFrame += UPDATE_FRAMES; -#ifdef RELEASE_TO_PUBLIC +#if !defined(ZEROGS_DEVBUILD) const char* g_pShaders[4] = { "full", "reduced", "accurate", "accurate-reduced" }; const char* g_pInterlace[3] = { "interlace 0 |", "interlace 1 |", "" }; const char* g_pBilinear[3] = { "", "bilinear |", "forced bilinear |" }; @@ -1049,7 +1055,7 @@ void CALLBACK GSvsync(int interlace) g_nFramesSkipped = 0; } -#ifndef RELEASE_TO_PUBLIC +#if defined(ZEROGS_DEVBUILD) if( g_bWriteProfile ) { //g_bWriteProfile = 0; DVProfWrite("prof.txt", UPDATE_FRAMES); diff --git a/plugins/zzogl-pg/opengl/Regs.cpp b/plugins/zzogl-pg/opengl/Regs.cpp index d1a49a1fb6..ec32cd40f9 100644 --- a/plugins/zzogl-pg/opengl/Regs.cpp +++ b/plugins/zzogl-pg/opengl/Regs.cpp @@ -1002,7 +1002,7 @@ void __fastcall GIFRegHandlerTRXDIR(u32* data) } } else { -#ifndef RELEASE_TO_PUBLIC +#if defined(ZEROGS_DEVBUILD) ZZLog::Warn_Log("Dummy transfer."); #endif gs.imageTransfer = -1; @@ -1016,7 +1016,7 @@ void __fastcall GIFRegHandlerHWREG(u32* data) ZeroGS::TransferHostLocal(data, 2); } else { -#ifndef RELEASE_TO_PUBLIC +#if defined(ZEROGS_DEVBUILD) ZZLog::Error_Log("ZeroGS: HWREG!? %8.8x_%8.8x", data[0], data[1]); //assert(0); #endif diff --git a/plugins/zzogl-pg/opengl/Util.h b/plugins/zzogl-pg/opengl/Util.h index 56f31500d8..1857ae39fa 100644 --- a/plugins/zzogl-pg/opengl/Util.h +++ b/plugins/zzogl-pg/opengl/Util.h @@ -65,14 +65,6 @@ extern u32 THR_KeyEvent; // value for passing out key events beetwen threads extern bool THR_bShift; extern std::string s_strIniPath; // Air's new (r2361) new constant for ini file path -///////////////////// -// define when releasing -// The only code that uses it is commented out! -//#define ZEROGS_CACHEDCLEAR // much better performance -//#define RELEASE_TO_PUBLIC -// fixme - We should use ZEROGS_DEVBUILD to determine devel/debug builds from "public release" builds. -// Means a lot of search-and-replace though. (air) - #if !defined(_MSC_VER) && !defined(HAVE_ALIGNED_MALLOC) // declare linux equivalents @@ -227,6 +219,9 @@ static bool SPAM_PASS; #endif //#define WRITE_PRIM_LOGS +#ifdef _DEBUG +#define ZEROGS_DEVBUILD +#endif extern void __LogToConsole(const char *fmt, ...); diff --git a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp index fba148a70d..4585b5d278 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp @@ -29,13 +29,13 @@ using namespace ZeroGS; //------------------ Defines -#ifdef RELEASE_TO_PUBLIC +#if !defined(ZEROGS_DEVBUILD) #define g_bSaveFrame 0 #define g_bSaveFinalFrame 0 -#else // NOT RELEASE_TO_PUBLIC +#else BOOL g_bSaveFrame = 0; // saves the current psurfTarget BOOL g_bSaveFinalFrame = 0; // saves the input to the CRTC -#endif // RELEASE_TO_PUBLIC +#endif // !defined(ZEROGS_DEVBUILD) #define INTERLACE_COUNT (bInterlace && interlace == (conf.interlace)) @@ -238,7 +238,7 @@ inline void FrameObtainDispinfo(u32 bInterlace, tex0Info* dispinfo) { // Something should be done before Renderer the picture. inline void RenderStartHelper(u32 bInterlace){ // Crashes Final Fantasy X at startup if uncommented. --arcum42 -//#ifdef RELEASE_TO_PUBLIC +//#ifdef !defined(ZEROGS_DEVBUILD) // if(g_nRealFrame < 80 ) { // RenderCustom( min(1.0f, 2.0f - (float)g_nRealFrame / 40.0f) ); // diff --git a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp index 3181d3e773..4f35153a2f 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp @@ -336,7 +336,7 @@ inline bool ZeroGS::CreateOpenShadersFile() { fread(s_lpShaderResources, s, 1, fres); s_lpShaderResources[s] = 0; # endif // _WIN32 -#else // NOT RELEASE_TO_PUBLIC +#else // defined(ZEROGS_DEVBUILD) # ifndef _WIN32 // NOT WINDOWS // test if ps2hw.fx exists char tempstr[255]; @@ -362,7 +362,7 @@ inline bool ZeroGS::CreateOpenShadersFile() { sprintf(EFFECT_DIR, "%s/%s", curwd, tempstr); sprintf(EFFECT_NAME, "%sps2hw.fx", EFFECT_DIR); #endif -#endif // RELEASE_TO_PUBLIC +#endif // !defined(ZEROGS_DEVBUILD) return true; } diff --git a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp index a0b0d10982..d6a35f42d5 100644 --- a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp @@ -47,7 +47,7 @@ using namespace ZeroGS; bool g_bSaveTrans = 0; #define g_bSaveResolved 0 -#else // NOT RELEASE_TO_PUBLIC +#else // defined(ZEROGS_DEVBUILD) #define INC_GENVARS() ++g_nGenVars #define INC_TEXVARS() ++g_nTexVars @@ -58,7 +58,7 @@ bool g_bSaveTrans = 0; bool g_bUpdateEffect = 0; bool g_bSaveTex = 0; // saves the curent texture bool g_bSaveResolved = 0; -#endif // RELEASE_TO_PUBLIC +#endif // !defined(ZEROGS_DEVBUILD) #define STENCIL_ALPHABIT 1 // if set, dest alpha >= 0x80 #define STENCIL_PIXELWRITE 2 // if set, pixel just written (reset after every Flush) @@ -276,7 +276,7 @@ int GetTexFilter(const tex1Info& tex1) void ZeroGS::ReloadEffects() { -#ifndef RELEASE_TO_PUBLIC +#ifdef ZEROGS_DEVBUILD for(int i = 0; i < ARRAY_SIZE(ppsTexture); ++i) { SAFE_RELEASE_PROG(ppsTexture[i].prog); } @@ -287,7 +287,7 @@ void ZeroGS::ReloadEffects() long BufferNumber = 0; -// This is debug function. It's print all buffer info and save current texture into the file, than printf file name. +// This is a debug function. It prints all buffer info and save current texture into the file, then prints the file name. inline void VisualBufferMessage(int context) { #if defined(WRITE_PRIM_LOGS) && defined(_DEBUG) @@ -331,7 +331,7 @@ inline void SaveRendererTarget(VB& curvb) { // Stop effects in Developers mode inline void FlushUpdateEffect() { -#ifdef DEVBUID +#if defined(DEVBUILD) if( g_bUpdateEffect ) { ReloadEffects(); g_bUpdateEffect = 0; diff --git a/plugins/zzogl-pg/opengl/ZZoglSave.cpp b/plugins/zzogl-pg/opengl/ZZoglSave.cpp index 3694bbb364..ee3d15b372 100644 --- a/plugins/zzogl-pg/opengl/ZZoglSave.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglSave.cpp @@ -33,10 +33,10 @@ // Hack for save game compatible! #ifdef _DEBUG char *libraryNameX = "ZeroGS-Pg OpenGL (Debug) "; -#elif defined(RELEASE_TO_PUBLIC) -char *libraryNameX = "ZeroGS Playground OpenGL "; -#else +#elif defined(ZEROGS_DEVBUILD) char *libraryNameX = "ZeroGS-Pg OpenGL (Dev) "; +#else +char *libraryNameX = "ZeroGS Playground OpenGL "; #endif //------------------ Code diff --git a/plugins/zzogl-pg/opengl/ZZoglShaders.cpp b/plugins/zzogl-pg/opengl/ZZoglShaders.cpp index 83752e6d92..38af07500f 100644 --- a/plugins/zzogl-pg/opengl/ZZoglShaders.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglShaders.cpp @@ -358,7 +358,7 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te return NULL; } -#else // not RELEASE_TO_PUBLIC +#else // defined(ZEROGS_DEVBUILD) #define LOAD_VS(name, prog, shaderver) { \ prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, EFFECT_NAME, shaderver, name, args); \ @@ -556,5 +556,5 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te return NULL; } -#endif // RELEASE_TO_PUBLIC +#endif // !defined(ZEROGS_DEVBUILD) diff --git a/plugins/zzogl-pg/opengl/targets.cpp b/plugins/zzogl-pg/opengl/targets.cpp index 554481406a..878dfda0c1 100644 --- a/plugins/zzogl-pg/opengl/targets.cpp +++ b/plugins/zzogl-pg/opengl/targets.cpp @@ -42,7 +42,7 @@ extern bool g_bIsLost; extern bool g_bUpdateStencil; extern u32 s_uFramebuffer; -#ifdef RELEASE_TO_PUBLIC +#if !defined(ZEROGS_DEVBUILD) # define INC_RESOLVE() #else # define INC_RESOLVE() ++g_nResolve @@ -1169,7 +1169,7 @@ CRenderTarget* ZeroGS::CRenderTargetMngr::GetTarg(const frameInfo& frame, u32 op else { // certain variables have to be reset every time if( (it->second->psm&~1) != (frame.psm&~1) ) { -#ifndef RELEASE_TO_PUBLIC +#if defined(ZEROGS_DEVBUILD) ZZLog::Warn_Log("Bad formats 2: %d %d", frame.psm, it->second->psm); #endif it->second->psm = frame.psm; @@ -1967,7 +1967,7 @@ ZeroGS::CMemoryTarget* ZeroGS::CMemoryTargetMngr::GetMemoryTarget(const tex0Info targ->ptex->ref = 1; } -#ifndef RELEASE_TO_PUBLIC +#if defined(ZEROGS_DEVBUILD) g_TransferredToGPU += GPU_TEXWIDTH * channels * 4 * targ->height; #endif @@ -2611,7 +2611,7 @@ void InitTransferHostLocal() if( g_bIsLost ) return; -#ifndef RELEASE_TO_PUBLIC +#if defined(ZEROGS_DEVBUILD) if( gs.trxpos.dx+gs.imageWnew > gs.dstbuf.bw ) ZZLog::Warn_Log("Transfer error, width exceeded."); #endif @@ -2741,7 +2741,7 @@ void TransferHostLocal(const void* pbyMem, u32 nQWordSize) } else s_vTransferCache.resize(0); -#if !defined(RELEASE_TO_PUBLIC) && defined(_DEBUG) +#if defined(_DEBUG) if( g_bSaveTrans ) { tex0Info t; t.tbp0 = gs.dstbuf.bp; @@ -2884,7 +2884,7 @@ void InitTransferLocalHost() FUNCLOG assert( gs.trxpos.sx+gs.imageWnew <= 2048 && gs.trxpos.sy+gs.imageHnew <= 2048 ); -#ifndef RELEASE_TO_PUBLIC +#if defined(ZEROGS_DEVBUILD) if( gs.trxpos.sx+gs.imageWnew > gs.srcbuf.bw ) ZZLog::Warn_Log("Transfer error, width exceeded."); #endif diff --git a/plugins/zzogl-pg/opengl/zerogs.cpp b/plugins/zzogl-pg/opengl/zerogs.cpp index bcee99a49d..272c28c295 100644 --- a/plugins/zzogl-pg/opengl/zerogs.cpp +++ b/plugins/zzogl-pg/opengl/zerogs.cpp @@ -1108,9 +1108,7 @@ void ZeroGS::texClutWrite(int ctx) default: { -#ifndef RELEASE_TO_PUBLIC - //ZZLog::Debug_Log("Unknown cpsm: %x (%x).", tex0.cpsm, tex0.psm); -#endif + //ZZLog::Debug_Log("Unknown cpsm: %x (%x).", tex0.cpsm, tex0.psm); break; } }