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
This commit is contained in:
arcum42 2010-04-25 09:02:36 +00:00
parent 9293c2eb8e
commit 07a16bc76d
10 changed files with 42 additions and 43 deletions

View File

@ -74,10 +74,10 @@ unsigned char zgsminor = 0;
#ifdef _DEBUG #ifdef _DEBUG
char *libraryName = "ZZ Ogl PG (Debug) "; char *libraryName = "ZZ Ogl PG (Debug) ";
#elif defined(RELEASE_TO_PUBLIC) #elif defined(ZEROGS_DEVBUILD)
char *libraryName = "ZZ Ogl PG "; char *libraryName = "ZZ Ogl PG (Dev)";
#else #else
char *libraryName = "ZZ Ogl PG (Dev) "; char *libraryName = "ZZ Ogl PG ";
#endif #endif
static const char* s_aa[5] = { "AA none |", "AA 2x |", "AA 4x |", "AA 8x |", "AA 16x |" }; 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_nFrameRender;
extern int g_nFramesSkipped; extern int g_nFramesSkipped;
#ifdef RELEASE_TO_PUBLIC #if !defined(ZEROGS_DEVBUILD)
#define g_bWriteProfile 0 #define g_bWriteProfile 0
#else #else
BOOL g_bWriteProfile = 0; BOOL g_bWriteProfile = 0;
@ -142,6 +142,12 @@ namespace ZZLog
// (GSinit won't have been called then) // (GSinit won't have been called then)
return (gsLog != NULL && conf.log); return (gsLog != NULL && conf.log);
} }
void WriteToScreen(const char* pstr, u32 ms)
{
ZeroGS::AddMessage(pstr, ms);
}
void _Message(const char *str) void _Message(const char *str)
{ {
SysMessage(str); SysMessage(str);
@ -241,7 +247,7 @@ namespace ZZLog
void GS_Log(const char *fmt, ...) void GS_Log(const char *fmt, ...)
{ {
#if ZEROGS_DEVBUILD #ifdef ZEROGS_DEVBUILD
va_list list; va_list list;
va_start(list,fmt); va_start(list,fmt);
@ -260,7 +266,7 @@ namespace ZZLog
void Warn_Log(const char *fmt, ...) void Warn_Log(const char *fmt, ...)
{ {
#if ZEROGS_DEVBUILD #ifdef ZEROGS_DEVBUILD
va_list list; va_list list;
va_start(list,fmt); va_start(list,fmt);
@ -1004,7 +1010,7 @@ void CALLBACK GSvsync(int interlace)
dwTime = d; dwTime = d;
g_nFrame += UPDATE_FRAMES; 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_pShaders[4] = { "full", "reduced", "accurate", "accurate-reduced" };
const char* g_pInterlace[3] = { "interlace 0 |", "interlace 1 |", "" }; const char* g_pInterlace[3] = { "interlace 0 |", "interlace 1 |", "" };
const char* g_pBilinear[3] = { "", "bilinear |", "forced bilinear |" }; const char* g_pBilinear[3] = { "", "bilinear |", "forced bilinear |" };
@ -1049,7 +1055,7 @@ void CALLBACK GSvsync(int interlace)
g_nFramesSkipped = 0; g_nFramesSkipped = 0;
} }
#ifndef RELEASE_TO_PUBLIC #if defined(ZEROGS_DEVBUILD)
if( g_bWriteProfile ) { if( g_bWriteProfile ) {
//g_bWriteProfile = 0; //g_bWriteProfile = 0;
DVProfWrite("prof.txt", UPDATE_FRAMES); DVProfWrite("prof.txt", UPDATE_FRAMES);

View File

@ -1002,7 +1002,7 @@ void __fastcall GIFRegHandlerTRXDIR(u32* data)
} }
} }
else { else {
#ifndef RELEASE_TO_PUBLIC #if defined(ZEROGS_DEVBUILD)
ZZLog::Warn_Log("Dummy transfer."); ZZLog::Warn_Log("Dummy transfer.");
#endif #endif
gs.imageTransfer = -1; gs.imageTransfer = -1;
@ -1016,7 +1016,7 @@ void __fastcall GIFRegHandlerHWREG(u32* data)
ZeroGS::TransferHostLocal(data, 2); ZeroGS::TransferHostLocal(data, 2);
} }
else { else {
#ifndef RELEASE_TO_PUBLIC #if defined(ZEROGS_DEVBUILD)
ZZLog::Error_Log("ZeroGS: HWREG!? %8.8x_%8.8x", data[0], data[1]); ZZLog::Error_Log("ZeroGS: HWREG!? %8.8x_%8.8x", data[0], data[1]);
//assert(0); //assert(0);
#endif #endif

View File

@ -65,14 +65,6 @@ extern u32 THR_KeyEvent; // value for passing out key events beetwen threads
extern bool THR_bShift; extern bool THR_bShift;
extern std::string s_strIniPath; // Air's new (r2361) new constant for ini file path 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) #if !defined(_MSC_VER) && !defined(HAVE_ALIGNED_MALLOC)
// declare linux equivalents // declare linux equivalents
@ -227,6 +219,9 @@ static bool SPAM_PASS;
#endif #endif
//#define WRITE_PRIM_LOGS //#define WRITE_PRIM_LOGS
#ifdef _DEBUG
#define ZEROGS_DEVBUILD
#endif
extern void __LogToConsole(const char *fmt, ...); extern void __LogToConsole(const char *fmt, ...);

View File

@ -29,13 +29,13 @@
using namespace ZeroGS; using namespace ZeroGS;
//------------------ Defines //------------------ Defines
#ifdef RELEASE_TO_PUBLIC #if !defined(ZEROGS_DEVBUILD)
#define g_bSaveFrame 0 #define g_bSaveFrame 0
#define g_bSaveFinalFrame 0 #define g_bSaveFinalFrame 0
#else // NOT RELEASE_TO_PUBLIC #else
BOOL g_bSaveFrame = 0; // saves the current psurfTarget BOOL g_bSaveFrame = 0; // saves the current psurfTarget
BOOL g_bSaveFinalFrame = 0; // saves the input to the CRTC 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)) #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. // Something should be done before Renderer the picture.
inline void RenderStartHelper(u32 bInterlace){ inline void RenderStartHelper(u32 bInterlace){
// Crashes Final Fantasy X at startup if uncommented. --arcum42 // Crashes Final Fantasy X at startup if uncommented. --arcum42
//#ifdef RELEASE_TO_PUBLIC //#ifdef !defined(ZEROGS_DEVBUILD)
// if(g_nRealFrame < 80 ) { // if(g_nRealFrame < 80 ) {
// RenderCustom( min(1.0f, 2.0f - (float)g_nRealFrame / 40.0f) ); // RenderCustom( min(1.0f, 2.0f - (float)g_nRealFrame / 40.0f) );
// //

View File

@ -336,7 +336,7 @@ inline bool ZeroGS::CreateOpenShadersFile() {
fread(s_lpShaderResources, s, 1, fres); fread(s_lpShaderResources, s, 1, fres);
s_lpShaderResources[s] = 0; s_lpShaderResources[s] = 0;
# endif // _WIN32 # endif // _WIN32
#else // NOT RELEASE_TO_PUBLIC #else // defined(ZEROGS_DEVBUILD)
# ifndef _WIN32 // NOT WINDOWS # ifndef _WIN32 // NOT WINDOWS
// test if ps2hw.fx exists // test if ps2hw.fx exists
char tempstr[255]; char tempstr[255];
@ -362,7 +362,7 @@ inline bool ZeroGS::CreateOpenShadersFile() {
sprintf(EFFECT_DIR, "%s/%s", curwd, tempstr); sprintf(EFFECT_DIR, "%s/%s", curwd, tempstr);
sprintf(EFFECT_NAME, "%sps2hw.fx", EFFECT_DIR); sprintf(EFFECT_NAME, "%sps2hw.fx", EFFECT_DIR);
#endif #endif
#endif // RELEASE_TO_PUBLIC #endif // !defined(ZEROGS_DEVBUILD)
return true; return true;
} }

View File

@ -47,7 +47,7 @@ using namespace ZeroGS;
bool g_bSaveTrans = 0; bool g_bSaveTrans = 0;
#define g_bSaveResolved 0 #define g_bSaveResolved 0
#else // NOT RELEASE_TO_PUBLIC #else // defined(ZEROGS_DEVBUILD)
#define INC_GENVARS() ++g_nGenVars #define INC_GENVARS() ++g_nGenVars
#define INC_TEXVARS() ++g_nTexVars #define INC_TEXVARS() ++g_nTexVars
@ -58,7 +58,7 @@ bool g_bSaveTrans = 0;
bool g_bUpdateEffect = 0; bool g_bUpdateEffect = 0;
bool g_bSaveTex = 0; // saves the curent texture bool g_bSaveTex = 0; // saves the curent texture
bool g_bSaveResolved = 0; bool g_bSaveResolved = 0;
#endif // RELEASE_TO_PUBLIC #endif // !defined(ZEROGS_DEVBUILD)
#define STENCIL_ALPHABIT 1 // if set, dest alpha >= 0x80 #define STENCIL_ALPHABIT 1 // if set, dest alpha >= 0x80
#define STENCIL_PIXELWRITE 2 // if set, pixel just written (reset after every Flush) #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() void ZeroGS::ReloadEffects()
{ {
#ifndef RELEASE_TO_PUBLIC #ifdef ZEROGS_DEVBUILD
for(int i = 0; i < ARRAY_SIZE(ppsTexture); ++i) { for(int i = 0; i < ARRAY_SIZE(ppsTexture); ++i) {
SAFE_RELEASE_PROG(ppsTexture[i].prog); SAFE_RELEASE_PROG(ppsTexture[i].prog);
} }
@ -287,7 +287,7 @@ void ZeroGS::ReloadEffects()
long BufferNumber = 0; 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 inline void
VisualBufferMessage(int context) { VisualBufferMessage(int context) {
#if defined(WRITE_PRIM_LOGS) && defined(_DEBUG) #if defined(WRITE_PRIM_LOGS) && defined(_DEBUG)
@ -331,7 +331,7 @@ inline void SaveRendererTarget(VB& curvb) {
// Stop effects in Developers mode // Stop effects in Developers mode
inline void FlushUpdateEffect() { inline void FlushUpdateEffect() {
#ifdef DEVBUID #if defined(DEVBUILD)
if( g_bUpdateEffect ) { if( g_bUpdateEffect ) {
ReloadEffects(); ReloadEffects();
g_bUpdateEffect = 0; g_bUpdateEffect = 0;

View File

@ -33,10 +33,10 @@
// Hack for save game compatible! // Hack for save game compatible!
#ifdef _DEBUG #ifdef _DEBUG
char *libraryNameX = "ZeroGS-Pg OpenGL (Debug) "; char *libraryNameX = "ZeroGS-Pg OpenGL (Debug) ";
#elif defined(RELEASE_TO_PUBLIC) #elif defined(ZEROGS_DEVBUILD)
char *libraryNameX = "ZeroGS Playground OpenGL ";
#else
char *libraryNameX = "ZeroGS-Pg OpenGL (Dev) "; char *libraryNameX = "ZeroGS-Pg OpenGL (Dev) ";
#else
char *libraryNameX = "ZeroGS Playground OpenGL ";
#endif #endif
//------------------ Code //------------------ Code

View File

@ -358,7 +358,7 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
return NULL; return NULL;
} }
#else // not RELEASE_TO_PUBLIC #else // defined(ZEROGS_DEVBUILD)
#define LOAD_VS(name, prog, shaderver) { \ #define LOAD_VS(name, prog, shaderver) { \
prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, EFFECT_NAME, shaderver, name, args); \ 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; return NULL;
} }
#endif // RELEASE_TO_PUBLIC #endif // !defined(ZEROGS_DEVBUILD)

View File

@ -42,7 +42,7 @@ extern bool g_bIsLost;
extern bool g_bUpdateStencil; extern bool g_bUpdateStencil;
extern u32 s_uFramebuffer; extern u32 s_uFramebuffer;
#ifdef RELEASE_TO_PUBLIC #if !defined(ZEROGS_DEVBUILD)
# define INC_RESOLVE() # define INC_RESOLVE()
#else #else
# define INC_RESOLVE() ++g_nResolve # define INC_RESOLVE() ++g_nResolve
@ -1169,7 +1169,7 @@ CRenderTarget* ZeroGS::CRenderTargetMngr::GetTarg(const frameInfo& frame, u32 op
else { else {
// certain variables have to be reset every time // certain variables have to be reset every time
if( (it->second->psm&~1) != (frame.psm&~1) ) { 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); ZZLog::Warn_Log("Bad formats 2: %d %d", frame.psm, it->second->psm);
#endif #endif
it->second->psm = frame.psm; it->second->psm = frame.psm;
@ -1967,7 +1967,7 @@ ZeroGS::CMemoryTarget* ZeroGS::CMemoryTargetMngr::GetMemoryTarget(const tex0Info
targ->ptex->ref = 1; targ->ptex->ref = 1;
} }
#ifndef RELEASE_TO_PUBLIC #if defined(ZEROGS_DEVBUILD)
g_TransferredToGPU += GPU_TEXWIDTH * channels * 4 * targ->height; g_TransferredToGPU += GPU_TEXWIDTH * channels * 4 * targ->height;
#endif #endif
@ -2611,7 +2611,7 @@ void InitTransferHostLocal()
if( g_bIsLost ) if( g_bIsLost )
return; return;
#ifndef RELEASE_TO_PUBLIC #if defined(ZEROGS_DEVBUILD)
if( gs.trxpos.dx+gs.imageWnew > gs.dstbuf.bw ) if( gs.trxpos.dx+gs.imageWnew > gs.dstbuf.bw )
ZZLog::Warn_Log("Transfer error, width exceeded."); ZZLog::Warn_Log("Transfer error, width exceeded.");
#endif #endif
@ -2741,7 +2741,7 @@ void TransferHostLocal(const void* pbyMem, u32 nQWordSize)
} }
else s_vTransferCache.resize(0); else s_vTransferCache.resize(0);
#if !defined(RELEASE_TO_PUBLIC) && defined(_DEBUG) #if defined(_DEBUG)
if( g_bSaveTrans ) { if( g_bSaveTrans ) {
tex0Info t; tex0Info t;
t.tbp0 = gs.dstbuf.bp; t.tbp0 = gs.dstbuf.bp;
@ -2884,7 +2884,7 @@ void InitTransferLocalHost()
FUNCLOG FUNCLOG
assert( gs.trxpos.sx+gs.imageWnew <= 2048 && gs.trxpos.sy+gs.imageHnew <= 2048 ); 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 ) if( gs.trxpos.sx+gs.imageWnew > gs.srcbuf.bw )
ZZLog::Warn_Log("Transfer error, width exceeded."); ZZLog::Warn_Log("Transfer error, width exceeded.");
#endif #endif

View File

@ -1108,9 +1108,7 @@ void ZeroGS::texClutWrite(int ctx)
default: default:
{ {
#ifndef RELEASE_TO_PUBLIC
//ZZLog::Debug_Log("Unknown cpsm: %x (%x).", tex0.cpsm, tex0.psm); //ZZLog::Debug_Log("Unknown cpsm: %x (%x).", tex0.cpsm, tex0.psm);
#endif
break; break;
} }
} }