zzogl-pg: Got rid of the logging macros. Changed the text of some of the messages a bit.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2900 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-04-25 08:33:05 +00:00
parent 0ccd832efe
commit 9293c2eb8e
19 changed files with 287 additions and 273 deletions

View File

@ -41,7 +41,7 @@ LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
case WM_ACTIVATE:
if( wParam != WA_INACTIVE ) {
//DEBUG_LOG("restoring device\n");
//ZZLog::Debug_Log("Restoring device.");
ZeroGS::Restore();
}

View File

@ -39,7 +39,7 @@ bool GLWindow::ReleaseWindow()
{
if (!glXMakeCurrent(glDisplay, None, NULL))
{
ERROR_LOG("Could not release drawing context.\n");
ZZLog::Error_Log("Could not release drawing context.");
}
glXDestroyContext(glDisplay, context);
@ -104,21 +104,21 @@ bool GLWindow::DisplayWindow(int _width, int _height)
{
vi = glXChooseVisual(glDisplay, glScreen, attrListSgl);
doubleBuffered = false;
ERROR_LOG("Only Singlebuffered Visual!\n");
ZZLog::Error_Log("Only Singlebuffered Visual!");
}
else
{
doubleBuffered = true;
ERROR_LOG("Got Doublebuffered Visual!\n");
ZZLog::Error_Log("Got Doublebuffered Visual!");
}
if (vi == NULL)
{
ERROR_LOG("Failed to get buffered Visual!\n");
ZZLog::Error_Log("Failed to get buffered Visual!");
return false;
}
glXQueryVersion(glDisplay, &glxMajorVersion, &glxMinorVersion);
ERROR_LOG("glX-Version %d.%d\n", glxMajorVersion, glxMinorVersion);
ZZLog::Error_Log("glX-Version %d.%d", glxMajorVersion, glxMinorVersion);
/* create a GLX context */
context = glXCreateContext(glDisplay, vi, NULL, GL_TRUE);
@ -140,7 +140,7 @@ bool GLWindow::DisplayWindow(int _width, int _height)
// set best mode to current
bestMode = 0;
ERROR_LOG("XF86VidModeExtension-Version %d.%d\n", vidModeMajorVersion, vidModeMinorVersion);
ZZLog::Error_Log("XF86VidModeExtension-Version %d.%d.", vidModeMajorVersion, vidModeMinorVersion);
XF86VidModeGetAllModeLines(glDisplay, glScreen, &modeNum, &modes);
if( modeNum > 0 && modes != NULL )
@ -161,7 +161,7 @@ bool GLWindow::DisplayWindow(int _width, int _height)
XF86VidModeSetViewPort(glDisplay, glScreen, 0, 0);
dpyWidth = modes[bestMode]->hdisplay;
dpyHeight = modes[bestMode]->vdisplay;
ERROR_LOG("Resolution %dx%d\n", dpyWidth, dpyHeight);
ZZLog::Error_Log("Resolution %dx%d.", dpyWidth, dpyHeight);
XFree(modes);
/* create a fullscreen window */
@ -178,10 +178,10 @@ bool GLWindow::DisplayWindow(int _width, int _height)
}
else
{
ERROR_LOG("Failed to start fullscreen. If you received the \n"
ZZLog::Error_Log("Failed to start fullscreen. If you received the \n"
"\"XFree86-VidModeExtension\" extension is missing, add\n"
"Load \"extmod\"\n"
"to your X configuration file (under the Module Section)\n");
"to your X configuration file (under the Module Section)");
fullScreen = false;
}
}
@ -205,11 +205,11 @@ bool GLWindow::DisplayWindow(int _width, int _height)
// connect the glx-context to the window
glXMakeCurrent(glDisplay, glWindow, context);
XGetGeometry(glDisplay, glWindow, &winDummy, &x, &y, &width, &height, &borderDummy, &depth);
ERROR_LOG("Depth %d\n", depth);
ZZLog::Error_Log("Depth %d", depth);
if (glXIsDirect(glDisplay, context))
ERROR_LOG("you have Direct Rendering!\n");
ZZLog::Error_Log("You have Direct Rendering!");
else
ERROR_LOG("no Direct Rendering possible!\n");
ZZLog::Error_Log("No Direct Rendering possible!");
// better for pad plugin key input (thc)
XSelectInput(glDisplay, glWindow, ExposureMask | KeyPressMask | KeyReleaseMask |

View File

@ -221,7 +221,7 @@ namespace ZZLog
void Prim_Log(const char *fmt, ...)
{
#if ZEROGS_DEVBUILD
#if defined(ZEROGS_DEVBUILD) && defined(WRITE_PRIM_LOGS)
va_list list;
char tmp[512];
@ -246,9 +246,14 @@ namespace ZZLog
va_start(list,fmt);
if (IsLogging()) vfprintf(gsLog, fmt, list);
if (IsLogging())
{
vfprintf(gsLog, fmt, list);
fprintf(gsLog,"\n");
}
printf("ZZogl-PG(GS): ");
vprintf(fmt,list);
printf("\n");
va_end(list);
#endif
}
@ -259,10 +264,15 @@ namespace ZZLog
va_list list;
va_start(list,fmt);
if (IsLogging()) vfprintf(gsLog, fmt, list);
if (IsLogging())
{
vfprintf(gsLog, fmt, list);
fprintf(gsLog,"\n");
}
printf("ZZogl-PG(Warning): ");
vprintf(fmt, list);
va_end(list);
printf("\n");
#endif
}
@ -272,9 +282,14 @@ namespace ZZLog
va_list list;
va_start(list,fmt);
if (IsLogging()) vfprintf(gsLog, fmt, list);
if (IsLogging())
{
vfprintf(gsLog, fmt, list);
fprintf(gsLog,"\n");
}
printf("ZZogl-PG(Debug): ");
vprintf(fmt, list);
printf("\n");
va_end(list);
@ -287,9 +302,14 @@ namespace ZZLog
va_start(list,fmt);
if (IsLogging()) vfprintf(gsLog, fmt, list);
if (IsLogging())
{
vfprintf(gsLog, fmt, list);
fprintf(gsLog,"\n");
}
printf("ZZogl-PG(Error): ");
vprintf(fmt,list);
printf("\n");
va_end(list);
}
};
@ -311,9 +331,9 @@ void CALLBACK GSsetGameCRC(int crc, int options)
conf.mrtdepth = ((conf.gamesettings & GAME_DISABLEMRTDEPTH) != 0);
if (!conf.mrtdepth)
ERROR_LOG("Disabling MRT depth writing\n");
ZZLog::Error_Log("Disabling MRT depth writing.");
else
ERROR_LOG("Enabling MRT depth writing\n");
ZZLog::Error_Log("Enabling MRT depth writing.");
g_GameSettings |= GAME_PATH3HACK;
@ -460,20 +480,22 @@ s32 CALLBACK GSinit()
memcpy(g_GIFTempRegHandlers, g_GIFPackedRegHandlers, sizeof(g_GIFTempRegHandlers));
#ifdef GS_LOG
gsLog = fopen("logs/gsLog.txt", "w");
if (gsLog == NULL) {
if (gsLog == NULL)
{
gsLog = fopen("gsLog.txt", "w");
if (gsLog == NULL) {
SysMessage("Can't create gsLog.txt"); return -1;
if (gsLog == NULL)
{
SysMessage("Can't create gsLog.txt");
return -1;
}
}
setvbuf(gsLog, NULL, _IONBF, 0);
GS_LOG("GSinit\n");
#endif
ZZLog::GS_Log("Calling GSinit.");
GSreset();
GS_LOG("GSinit ok\n");
ZZLog::GS_Log("GSinit finished.");
return 0;
}
@ -481,10 +503,7 @@ void CALLBACK GSshutdown()
{
FUNCLOG
#ifdef GS_LOG
if (gsLog != NULL)
fclose(gsLog);
#endif
if (gsLog != NULL) fclose(gsLog);
}
// keyboard functions
@ -669,7 +688,7 @@ s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
g_GSMultiThreaded = multithread;
GS_LOG("GSopen\n");
ZZLog::GS_Log("Calling GSopen.");
#ifdef _DEBUG
g_hCurrentThread = GetCurrentThread();
@ -683,12 +702,12 @@ s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
if (!err)
{
GS_LOG("Failed to create window. Exiting...");
ZZLog::GS_Log("Failed to create window. Exiting...");
return -1;
}
ERROR_LOG("Using %s:%d.%d.%d\n", libraryName, zgsrevision, zgsbuild, zgsminor);
ERROR_LOG("creating zerogs\n");
ZZLog::Error_Log("Using %s:%d.%d.%d.", libraryName, zgsrevision, zgsbuild, zgsminor);
ZZLog::Error_Log("Creating ZZOgl.");
//if (conf.record) recOpen();
if (!ZeroGS::Create(conf.width, conf.height)) return -1;
@ -717,7 +736,7 @@ s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
UpdateWindow( GShwnd );
SetFocus(GShwnd);
GS_LOG("GSopen ok\n");
ZZLog::GS_Log("GSopen finished.");
LARGE_INTEGER temp;
QueryPerformanceFrequency(&temp);
@ -808,7 +827,7 @@ s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
{
FUNCLOG
GS_LOG("GSopen\n");
ZZLog::GS_Log("Calling GSopen.");
// assert( GSirq != NULL );
LoadConfig();
@ -817,12 +836,12 @@ s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
GLWin.CreateWindow(pDsp);
ERROR_LOG("Using %s:%d.%d.%d\n", libraryName, zgsrevision, zgsbuild, zgsminor);
ERROR_LOG("Creating zerogs\n");
ZZLog::Error_Log("Using %s:%d.%d.%d.", libraryName, zgsrevision, zgsbuild, zgsminor);
ZZLog::Error_Log("Creating zerogs.");
//if (conf.record) recOpen();
if (!ZeroGS::Create(conf.width, conf.height)) return -1;
ERROR_LOG("initialization successful\n");
ZZLog::Error_Log("Initialization successful.");
if( conf.bilinear == 2 )
{
@ -839,7 +858,7 @@ s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
ZeroGS::AddMessage(strtitle,1000);
}
GS_LOG("GSopen ok\n");
ZZLog::GS_Log("GSopen finished.");
gs.path[0].mode = gs.path[1].mode = gs.path[2].mode = 0;
luPerfFreq = 1;
@ -964,7 +983,7 @@ void CALLBACK GSvsync(int interlace)
{
FUNCLOG
//GS_LOG("GSvsync\n");
//ZZLog::GS_Log("Calling GSvsync.");
static u32 dwTime = timeGetTime();
static int nToNextUpdate = 1;
@ -1010,7 +1029,7 @@ void CALLBACK GSvsync(int interlace)
#endif
// if( g_nFrame > 100 && fFPS > 60.0f ) {
// DEBUG_LOG("set profile\n");
// ZZLog::Debug_Log("Set profile.");
// g_bWriteProfile = 1;
// }
if (!(conf.options & GSOPTION_FULLSCREEN)) GLWin.SetTitle(strtitle);
@ -1044,7 +1063,7 @@ void CALLBACK GSreadFIFO(u64 *pMem)
{
FUNCLOG
//GS_LOG("GSreadFIFO\n");
//ZZLog::GS_Log("Calling GSreadFIFO.");
ZeroGS::TransferLocalHost((u32*)pMem, 1);
}
@ -1053,7 +1072,7 @@ void CALLBACK GSreadFIFO2(u64 *pMem, int qwc)
{
FUNCLOG
//GS_LOG("GSreadFIFO2\n");
//ZZLog::GS_Log("Calling GSreadFIFO2.");
ZeroGS::TransferLocalHost((u32*)pMem, qwc);
}
@ -1067,14 +1086,14 @@ int CALLBACK GSsetupRecording(int start, void* pData)
return 1;
ZeroGS::StartCapture();
conf.options |= GSOPTION_CAPTUREAVI;
WARN_LOG("ZeroGS: started recording at zerogs.avi\n");
ZZLog::Warn_Log("Started recording zerogs.avi.");
}
else {
if( !(conf.options & GSOPTION_CAPTUREAVI) )
return 1;
conf.options &= ~GSOPTION_CAPTUREAVI;
ZeroGS::StopCapture();
WARN_LOG("ZeroGS: stopped recording\n");
ZZLog::Warn_Log("Stopped recording.");
}
return 1;
@ -1087,7 +1106,7 @@ s32 CALLBACK GSfreeze(int mode, freezeData *data)
switch (mode)
{
case FREEZE_LOAD:
if (!ZeroGS::Load(data->data)) ERROR_LOG("GS: Bad load format!");
if (!ZeroGS::Load(data->data)) ZZLog::Error_Log("GS: Bad load format!");
g_nRealFrame += 100;
break;
case FREEZE_SAVE:

View File

@ -77,14 +77,14 @@ __forceinline void gifTransferLog(int index, u32 *pMem, u32 size)
if( conf.log /*& 0x20*/ )
{
static int nSaveIndex = 0;
GS_LOG("%d: p:%d %x\n", nSaveIndex++, index + 1, size);
ZZLog::GS_Log("%d: p:%d %x", nSaveIndex++, index + 1, size);
int vals[4] = {0};
for(u32 i = 0; i < size; i++)
{
for(u32 j = 0; j < 4; ++j )
vals[j] ^= pMem[4*i+j];
}
GS_LOG("%x %x %x %x\n", vals[0], vals[1], vals[2], vals[3]);
ZZLog::GS_Log("%x %x %x %x", vals[0], vals[1], vals[2], vals[3]);
}
#endif
}
@ -166,8 +166,7 @@ template<int index> void _GSgifTransfer(u32 *pMem, u32 size)
case GIF_FLG_REGLIST:
{
// Needs to be looked at.
//GS_LOG("%8.8x%8.8x %d L\n", ((u32*)&gs.regs)[1], *(u32*)&gs.regs, path->tag.nreg/4);
//ZZLog::GS_Log("%8.8x%8.8x %d L", ((u32*)&gs.regs)[1], *(u32*)&gs.regs, path->tag.nreg/4);
size *= 2;
@ -219,7 +218,7 @@ template<int index> void _GSgifTransfer(u32 *pMem, u32 size)
break;
}
default: // GIF_IMAGE
GS_LOG("*** WARNING **** Unexpected GIFTag flag\n");
ZZLog::GS_Log("*** WARNING **** Unexpected GIFTag flag.");
assert(0);
path->nloop = 0;
break;
@ -257,10 +256,10 @@ void CALLBACK GSgifTransfer1(u32 *pMem, u32 addr)
{
FUNCLOG
//GS_LOG("GSgifTransfer1 0x%x (mode %d)\n", addr, path->mode);
//ZZLog::GS_Log("GSgifTransfer1 0x%x (mode %d).", addr, path->mode);
#ifdef _DEBUG
PRIM_LOG("count: %d\n", count);
ZZLog::Prim_Log("count: %d\n", count);
count++;
#endif
@ -271,7 +270,7 @@ void CALLBACK GSgifTransfer2(u32 *pMem, u32 size)
{
FUNCLOG
//GS_LOG("GSgifTransfer2 size = %lx (mode %d, gs.path2.tag.nloop = %d)\n", size, gs.path[1].mode, gs.path[1].tag.nloop);
//ZZLog::GS_Log("GSgifTransfer2 size = %lx (mode %d, gs.path2.tag.nloop = %d).", size, gs.path[1].mode, gs.path[1].tag.nloop);
_GSgifTransfer<1>(pMem, size);
}
@ -280,7 +279,7 @@ void CALLBACK GSgifTransfer3(u32 *pMem, u32 size)
{
FUNCLOG
//GS_LOG("GSgifTransfer3 size = %lx (mode %d, gs.path3.tag.nloop = %d)\n", size, gs.path[2].mode, gs.path[2].tag.nloop);
//ZZLog::GS_Log("GSgifTransfer3 size = %lx (mode %d, gs.path3.tag.nloop = %d).", size, gs.path[2].mode, gs.path[2].tag.nloop);
_GSgifTransfer<2>(pMem, size);
}
@ -340,7 +339,7 @@ template<int index> void _GSgifTransfer(u32 *pMem, u32 size)
/*if( !path->eop )
{
//DEBUG_LOG("continuing from eop\n");
//ZZLog::Debug_Log("Continuing from eop.");
continue;
}*/
@ -378,7 +377,7 @@ template<int index> void _GSgifTransfer(u32 *pMem, u32 size)
}
case GIF_FLG_REGLIST:
{
//GS_LOG("%8.8x%8.8x %d L\n", ((u32*)&gs.regs)[1], *(u32*)&gs.regs, path->tag.nreg/4);
//GS_LOG("%8.8x%8.8x %d L", ((u32*)&gs.regs)[1], *(u32*)&gs.regs, path->tag.nreg/4);
assert( path->nloop > 0 );
size *= 2;
@ -441,7 +440,7 @@ template<int index> void _GSgifTransfer(u32 *pMem, u32 size)
break;
}
default: // GIF_IMAGE
GS_LOG("*** WARNING **** Unexpected GIFTag flag\n");
ZZLog::GS_Log("*** WARNING **** Unexpected GIFTag flag.");
assert(0);
path->nloop = 0;
break;
@ -466,12 +465,12 @@ void CALLBACK GSgifTransfer1(u32 *pMem, u32 addr)
pathInfo *path = &gs.path[0];
//GS_LOG("GSgifTransfer1 0x%x (mode %d)\n", addr, path->mode);
//ZZLog::GS_Log("GSgifTransfer1 0x%x (mode %d).", addr, path->mode);
// addr &= 0x3fff;
#ifdef _DEBUG
PRIM_LOG("count: %d\n", count);
ZZLog::Prim_Log("count: %d\n", count);
count++;
#endif
@ -483,7 +482,7 @@ void CALLBACK GSgifTransfer1(u32 *pMem, u32 addr)
{
assert( (addr&0xf) == 0 ); //BUG
path->nloop = 0;
ERROR_LOG("Transfer1 - 2\n");
ZZLog::Error_Log("Transfer1 - 2.");
return;
}
}
@ -492,7 +491,7 @@ void CALLBACK GSgifTransfer2(u32 *pMem, u32 size)
{
FUNCLOG
//GS_LOG("GSgifTransfer2 size = %lx (mode %d, gs.path2.tag.nloop = %d)\n", size, gs.path[1].mode, gs.path[1].tag.nloop);
//ZZLog::GS_Log("GSgifTransfer2 size = %lx (mode %d, gs.path2.tag.nloop = %d).", size, gs.path[1].mode, gs.path[1].tag.nloop);
_GSgifTransfer<1>(pMem, size);
}
@ -501,7 +500,7 @@ void CALLBACK GSgifTransfer3(u32 *pMem, u32 size)
{
FUNCLOG
//GS_LOG("GSgifTransfer3 size = %lx (mode %d, gs.path3.tag.nloop = %d)\n", size, gs.path[2].mode, gs.path[2].tag.nloop);
//ZZLog::GS_Log("GSgifTransfer3 size = %lx (mode %d, gs.path3.tag.nloop = %d).", size, gs.path[2].mode, gs.path[2].tag.nloop);
nPath3Hack = 0;
_GSgifTransfer<2>(pMem, size);

View File

@ -105,7 +105,7 @@ typedef struct
regs = tag.REGS;
reg = 0;
// GS_LOG("GIFtag: %8.8lx_%8.8lx_%8.8lx_%8.8lx: EOP=%d, NLOOP=%x, FLG=%x, NREG=%d, PRE=%d\n",
// ZZLog::GS_Log("GIFtag: %8.8lx_%8.8lx_%8.8lx_%8.8lx: EOP=%d, NLOOP=%x, FLG=%x, NREG=%d, PRE=%d",
// data[3], data[2], data[1], data[0],
// path->eop, path->nloop, mode, path->nreg, tag.PRE);
}
@ -146,7 +146,7 @@ typedef struct
nreg = tag.NREG << 2;
if (nreg == 0) nreg = 64;
// GS_LOG("GIFtag: %8.8lx_%8.8lx_%8.8lx_%8.8lx: EOP=%d, NLOOP=%x, FLG=%x, NREG=%d, PRE=%d\n",
// ZZLog::GS_Log("GIFtag: %8.8lx_%8.8lx_%8.8lx_%8.8lx: EOP=%d, NLOOP=%x, FLG=%x, NREG=%d, PRE=%d",
// data[3], data[2], data[1], data[0],
// path->eop, path->nloop, tagflg, path->nreg, tagpre);

View File

@ -63,8 +63,8 @@ static __forceinline const T* AlignOnBlockBoundry(TransferData data, TransferFun
if ((testwidth <= data.widthlimit) && (testwidth >= -data.widthlimit))
{
/* don't transfer */
/*DEBUG_LOG("bad texture %s: %d %d %d\n", #psm, gs.trxpos.dx, gs.imageEndX, nQWordSize);*/
//ERROR_LOG("bad texture: testwidth = %d; data.widthlimit = %d\n", testwidth, data.widthlimit);
/*ZZLog::Debug_Log("Bad texture %s: %d %d %d", #psm, gs.trxpos.dx, gs.imageEndX, nQWordSize);*/
//ZZLog::Error_Log("Bad texture: testwidth = %d; data.widthlimit = %d", testwidth, data.widthlimit);
gs.imageTransfer = -1;
}
bCanAlign = false;

View File

@ -17,7 +17,7 @@ static __forceinline const T *TransmitHostLocalY_(_writePixel_0 wp, u32 widthlim
assert( (nSize%widthlimit) == 0 && widthlimit <= 4 );
if ((gs.imageEndX-gs.trxpos.dx) % widthlimit)
{
// GS_LOG("Bad Transmission! %d %d, psm: %d\n", gs.trxpos.dx, gs.imageEndX, DSTPSM);
// ZZLog::GS_Log("Bad Transmission! %d %d, psm: %d", gs.trxpos.dx, gs.imageEndX, DSTPSM);
for(; tempY < endY; ++tempY)
{
@ -74,7 +74,7 @@ static __forceinline const T *TransmitHostLocalY_24(_writePixel_0 wp, u32 widthl
{
if (widthlimit != 8 || ((gs.imageEndX-gs.trxpos.dx)%widthlimit))
{
//GS_LOG("Bad Transmission! %d %d, psm: %d\n", gs.trxpos.dx, gs.imageEndX, DSTPSM);
//ZZLog::GS_Log("Bad Transmission! %d %d, psm: %d", gs.trxpos.dx, gs.imageEndX, DSTPSM);
for(; tempY < endY; ++tempY)
{
for(; tempX < gs.imageEndX && nSize > 0; tempX += 1, nSize -= 1, buf += 3)

View File

@ -86,7 +86,7 @@ inline bool NoHighlights(int i) {
((ZeroGS::vb[i].zbuf.psm ) << 8);
// if ( results[resultA] == 0 ) {
// results[resultA] = 1;
// ERROR_LOG("%x = %d %d %d %d %d %d %d %d psm: %x\n", resultA, prim->iip, (prim->tme), (prim->fge), (prim->abe) , (prim->aa1) ,(prim->fst), (prim->ctxt), (prim->fix), ZeroGS::vb[i].zbuf.psm) ;
// ZZLog::Error_Log("%x = %d %d %d %d %d %d %d %d psm: %x", resultA, prim->iip, (prim->tme), (prim->fge), (prim->abe) , (prim->aa1) ,(prim->fst), (prim->ctxt), (prim->fix), ZeroGS::vb[i].zbuf.psm) ;
// }
// if (resultA == 0xb && ZeroGS::vb[i].zbuf.zmsk ) return false; //ATF
@ -96,7 +96,7 @@ inline bool NoHighlights(int i) {
// if (resultA == 0xb)
// if ( results[result] == 0) {
// results[result] = 1;
// ERROR_LOG("0x%x = %d %d %d %d %d %d %d %d \n", result, curtest.ate, curtest.atst, curtest.aref, curtest.afail, curtest.date, curtest.datm, curtest.zte, curtest.ztst);
// ZZLog::Error_Log("0x%x = %d %d %d %d %d %d %d %d ", result, curtest.ate, curtest.atst, curtest.aref, curtest.afail, curtest.date, curtest.datm, curtest.zte, curtest.ztst);
// }
// 0, -50b, -500, !-300, -30a, -50a, -5cb, +100 (zte==1), -50d
// if (result == 0x50b && ZeroGS::vb[i].zbuf.zmsk ) return false; //ATF
@ -120,7 +120,7 @@ inline bool NoHighlights(int i) {
void __fastcall GIFPackedRegHandlerNull(u32* data)
{
FUNCLOG
DEBUG_LOG("Unexpected packed reg handler %8.8lx_%8.8lx %x\n", data[0], data[1], data[2]);
ZZLog::Debug_Log("Unexpected packed reg handler %8.8lx_%8.8lx %x.", data[0], data[1], data[2]);
}
void __fastcall GIFPackedRegHandlerRGBA(u32* data)
@ -375,12 +375,12 @@ void __fastcall GIFRegHandlerNull(u32* data)
{
FUNCLOG
#ifdef _DEBUG
if( (((uptr)&data[2])&0xffff) == 0 )
return;
if ((((uptr)&data[2])&0xffff) == 0) return;
// 0x7f happens on a lot of games
if( data[2] != 0x7f && (data[0] || data[1]) ) {
DEBUG_LOG("Unexpected reg handler %x %x %x\n", data[0], data[1], data[2]);
if (data[2] != 0x7f && (data[0] || data[1]))
{
ZZLog::Debug_Log("Unexpected reg handler %x %x %x.", data[0], data[1], data[2]);
}
#endif
}
@ -388,8 +388,9 @@ void __fastcall GIFRegHandlerNull(u32* data)
void __fastcall GIFRegHandlerPRIM(u32 *data)
{
FUNCLOG
if (data[0] & ~0x3ff) {
//WARN_LOG("warning: unknown bits in prim %8.8lx_%8.8lx\n", data[1], data[0]);
if (data[0] & ~0x3ff)
{
//ZZLog::Warn_Log("Warning: unknown bits in prim %8.8lx_%8.8lx", data[1], data[0]);
}
gs.nTriFanVert = gs.primIndex;
@ -1002,7 +1003,7 @@ void __fastcall GIFRegHandlerTRXDIR(u32* data)
}
else {
#ifndef RELEASE_TO_PUBLIC
WARN_LOG("ZeroGS: dummy transfer\n");
ZZLog::Warn_Log("Dummy transfer.");
#endif
gs.imageTransfer = -1;
}
@ -1016,7 +1017,7 @@ void __fastcall GIFRegHandlerHWREG(u32* data)
}
else {
#ifndef RELEASE_TO_PUBLIC
ERROR_LOG("ZeroGS: HWREG!? %8.8x_%8.8x\n", data[0], data[1]);
ZZLog::Error_Log("ZeroGS: HWREG!? %8.8x_%8.8x", data[0], data[1]);
//assert(0);
#endif
}

View File

@ -185,21 +185,21 @@ static bool SPAM_PASS;
#define ERROR_LOG_SPAM(text) { \
if( timeGetTime() - lasttime > BigTime ) { \
ERROR_LOG(text); \
ZZLog::Error_Log(text); \
lasttime = timeGetTime(); \
} \
}
// The same macro with one-argument substitution.
#define ERROR_LOG_SPAMA(fmt, value) { \
if( timeGetTime() - lasttime > BigTime ) { \
ERROR_LOG(fmt, value); \
ZZLog::Error_Log(fmt, value); \
lasttime = timeGetTime(); \
} \
}
#define ERROR_LOG_SPAM_TEST(text) {\
if( timeGetTime() - lasttime > BigTime ) { \
ERROR_LOG(text); \
ZZLog::Error_Log(text); \
lasttime = timeGetTime(); \
SPAM_PASS = true; \
} \
@ -215,7 +215,7 @@ static bool SPAM_PASS;
static unsigned long int waslasttime = 0; \
if (!Was_Here && FILE_IS_IN_CHECK) { \
Was_Here = true;\
ERROR_LOG("%s:%d %s\n", __FILE__, __LINE__, __func__); \
ZZLog::Error_Log("%s:%d %s", __FILE__, __LINE__, __func__); \
waslasttime = timeGetTime(); \
} \
if (FILE_IS_IN_CHECK && (timeGetTime() - waslasttime > BigTime )) { \
@ -226,6 +226,8 @@ static bool SPAM_PASS;
#define FUNCLOG
#endif
//#define WRITE_PRIM_LOGS
extern void __LogToConsole(const char *fmt, ...);
namespace ZZLog
@ -244,15 +246,6 @@ namespace ZZLog
extern void Error_Log(const char *fmt, ...);
};
#define GREG_LOG ZZLog::Greg_Log
#define PRIM_LOG ZZLog::Prim_Log
#define WARN_LOG ZZLog::Warn_Log
#define GS_LOG ZZLog::GS_Log
#define DEBUG_LOG ZZLog::Debug_Log
#define ERROR_LOG ZZLog::Error_Log
//ZZLog::Error_Log
#define REG64(name) \
union name \
{ \

View File

@ -180,7 +180,7 @@ inline bool FrameSkippingHelper()
#if defined _DEBUG
if (timeGetTime() - TimeLastSkip > 15000 && ShouldSkip) {
ERROR_LOG("ZZogl Skipped frames\n");
ZZLog::Debug_Log("ZZogl Skipped frames.");
TimeLastSkip = timeGetTime();
}
#endif
@ -247,12 +247,12 @@ inline void RenderStartHelper(u32 bInterlace){
// return;
// }
//#endif
if( conf.mrtdepth && pvs[8] == NULL ) {
if (conf.mrtdepth && pvs[8] == NULL)
{
conf.mrtdepth = 0;
s_bWriteDepth = FALSE;
#ifdef DEBUG
ERROR_LOG("Disabling MRT depth writing\n");
#endif
ZZLog::Debug_Log("Disabling MRT depth writing\n");
}
Flush(0);
@ -387,7 +387,7 @@ inline void RenderUpdateStencil(int i, bool* bUsingStencil) {
// CRTC24 could not be rendered
inline void RenderCRTC24helper(u32 bInterlace, int interlace, int psm) {
ERROR_LOG("ZZogl: CRTC24!!! I trying to show something\n");
ZZLog::Error_Log("ZZogl: CRTC24!!! I'm trying to show something.");
SetShaderCaller("RenderCRTC24helper");
// assume that data is already in ptexMem (do Resolve?)
RenderGetForClip(bInterlace, interlace, psm, &ppsCRTC24[bInterlace]);
@ -398,12 +398,13 @@ inline void RenderCRTC24helper(u32 bInterlace, int interlace, int psm) {
// Maybe I do this function global-defined. Calculate bits per pixel for
// each psm. It's obly place with PSMCT16 which have diffetent bpp.
// FIXME: check PSMCT16S
inline int RenderGetBpp(int psm) {
if (psm == PSMCT16S) {
inline int RenderGetBpp(int psm)
{
if (psm == PSMCT16S)
{
return 3;
#ifdef _DEBUG
ERROR_LOG("ZZogl: 16S target\n");
#endif
ZZLog::Debug_Log("ZZogl: 16S target.");
}
if (PSMT_ISHALF(psm))
return 2;
@ -590,7 +591,7 @@ inline void RenderCheckForMemory(tex0Info& texframe, list<CRenderTarget*>& listT
// context has to be 0
CMemoryTarget* pmemtarg = g_MemTargs.GetMemoryTarget(texframe, 1);
if ((pmemtarg == NULL) || (bInterlace >= 2))
ERROR_LOG("CRCR Check for memory shader fault");
ZZLog::Error_Log("CRCR Check for memory shader fault.");
SetShaderCaller("RenderCheckForMemory");
@ -633,7 +634,7 @@ inline void AfterRenderDisplayFPS() {
// Swaping buffers, so we could use another windows
inline void AfterRenderSwapBuffers() {
if (glGetError() != GL_NO_ERROR)
DEBUG_LOG("glerror before swap!\n");
ZZLog::Debug_Log("glError before swap!");
GLWin.SwapGLBuffers();
}
@ -722,8 +723,9 @@ inline void AfterRendererSwitchBackToTextures() {
glDeleteTextures((GLsizei)s_vecTempTextures.size(), &s_vecTempTextures[0]);
s_vecTempTextures.clear();
if( EXTWRITE->WRITE&1 ) {
WARN_LOG("EXTWRITE\n");
if (EXTWRITE->WRITE & 1)
{
ZZLog::Warn_Log("EXTWRITE!");
ExtWrite();
EXTWRITE->WRITE = 0;
}
@ -750,7 +752,7 @@ inline void AfterRendererAutoresetTargets() {
if( total / ARRAY_SIZE(s_nResolveCounts) > 3 ) {
if( s_nLastResolveReset > (int)(fFPS * 8) ) {
// reset
ERROR_LOG("video mem reset\n");
ZZLog::Error_Log("Video memory reset.");
s_nLastResolveReset = 0;
memset(s_nResolveCounts, 0, sizeof(s_nResolveCounts));

View File

@ -36,7 +36,7 @@
#ifdef _WIN32
#define GL_LOADFN(name) { \
if( (*(void**)&name = (void*)wglGetProcAddress(#name)) == NULL ) { \
ERROR_LOG("Failed to find %s, exiting\n", #name); \
ZZLog::Error_Log("Failed to find %s, exiting.", #name); \
} \
}
#else
@ -209,28 +209,28 @@ inline bool ZeroGS::CreateImportantCheck() {
#ifndef _WIN32
int const glew_ok = glewInit();
if( glew_ok != GLEW_OK ) {
ERROR_LOG("glewInit() is not ok!\n");
ZZLog::Error_Log("glewInit() is not ok!");
bSuccess = false;
}
#endif
if( !IsGLExt("GL_EXT_framebuffer_object") ) {
ERROR_LOG("*********\nZZogl: ERROR: Need GL_EXT_framebufer_object for multiple render targets\nZZogl: *********\n");
ZZLog::Error_Log("*********\nZZogl: ERROR: Need GL_EXT_framebufer_object for multiple render targets\nZZogl: *********");
bSuccess = false;
}
if( !IsGLExt("GL_EXT_secondary_color") ) {
ERROR_LOG("*********\nZZogl: OGL WARNING: Need GL_EXT_secondary_color\nZZogl: *********\n");
ZZLog::Error_Log("*********\nZZogl: OGL WARNING: Need GL_EXT_secondary_color\nZZogl: *********");
bSuccess = false;
}
// load the effect & find the best profiles (if any)
if( cgGLIsProfileSupported(CG_PROFILE_ARBVP1) != CG_TRUE ) {
ERROR_LOG("arbvp1 not supported\n");
ZZLog::Error_Log("arbvp1 not supported.");
bSuccess = false;
}
if( cgGLIsProfileSupported(CG_PROFILE_ARBFP1) != CG_TRUE ) {
ERROR_LOG("arbfp1 not supported\n");
ZZLog::Error_Log("arbfp1 not supported.");
bSuccess = false;
}
@ -240,21 +240,21 @@ inline bool ZeroGS::CreateImportantCheck() {
// This is a check for less important open gl extensions.
inline void ZeroGS::CreateOtherCheck() {
if( !IsGLExt("GL_EXT_blend_equation_separate") || glBlendEquationSeparateEXT == NULL ) {
ERROR_LOG("*********\nZZogl: OGL WARNING: Need GL_EXT_blend_equation_separate\nZZogl: *********\n");
ZZLog::Error_Log("*********\nZZogl: OGL WARNING: Need GL_EXT_blend_equation_separate\nZZogl: *********");
zgsBlendEquationSeparateEXT = glBlendEquationSeparateDummy;
}
else
zgsBlendEquationSeparateEXT = glBlendEquationSeparateEXT;
if( !IsGLExt("GL_EXT_blend_func_separate") || glBlendFuncSeparateEXT == NULL ) {
ERROR_LOG("*********\nZZogl: OGL WARNING: Need GL_EXT_blend_func_separate\nZZogl: *********\n");
ZZLog::Error_Log("*********\nZZogl: OGL WARNING: Need GL_EXT_blend_func_separate\nZZogl: *********");
zgsBlendFuncSeparateEXT = glBlendFuncSeparateDummy;
}
else
zgsBlendFuncSeparateEXT = glBlendFuncSeparateEXT;
if( !IsGLExt("GL_ARB_draw_buffers") && !IsGLExt("GL_ATI_draw_buffers") ) {
ERROR_LOG("*********\nZZogl: OGL WARNING: multiple render targets not supported, some effects might look bad\nZZogl: *********\n");
ZZLog::Error_Log("*********\nZZogl: OGL WARNING: multiple render targets not supported, some effects might look bad\nZZogl: *********");
conf.mrtdepth = 0;
}
@ -265,27 +265,27 @@ inline void ZeroGS::CreateOtherCheck() {
if (!IsGLExt("GL_ARB_multitexture"))
ERROR_LOG("No multitexturing\n");
ZZLog::Error_Log("No multitexturing.");
else
ERROR_LOG("Using multitexturing\n");
ZZLog::Error_Log("Using multitexturing.");
GLint Max_Texture_Size_NV = 0;
GLint Max_Texture_Size_2d = 0;
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_NV, &Max_Texture_Size_NV);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &Max_Texture_Size_2d);
ERROR_LOG("Maximum texture size is %d for Tex_2d and %d for Tex_NV\n", Max_Texture_Size_2d, Max_Texture_Size_NV);
ZZLog::Error_Log("Maximum texture size is %d for Tex_2d and %d for Tex_NV.", Max_Texture_Size_2d, Max_Texture_Size_NV);
if (Max_Texture_Size_NV < 1024)
ERROR_LOG("Could not properly make bitmasks, so some textures will be missed\n");
ZZLog::Error_Log("Could not properly make bitmasks, so some textures will be missed.");
/* Zeydlitz: we don't support 128-bit targets yet. they are slow and weirdo
if( g_GameSettings & GAME_32BITTARGS ) {
g_RenderFormatType = RFT_byte8;
ERROR_LOG("Setting 32 bit render target\n");
ZZLog::Error_Log("Setting 32 bit render target.");
}
else {
if( !IsGLExt("GL_NV_float_buffer") && !IsGLExt("GL_ARB_color_buffer_float") && !IsGLExt("ATI_pixel_format_float") ) {
ERROR_LOG("******\nZZogl: GS WARNING: Floating point render targets not supported, switching to 32bit\nZZogl: *********\n");
ZZLog::Error_Log("******\nZZogl: GS WARNING: Floating point render targets not supported, switching to 32bit\nZZogl: *********");
g_RenderFormatType = RFT_byte8;
}
}*/
@ -305,7 +305,7 @@ inline void ZeroGS::CreateOtherCheck() {
if( swapinterval )
swapinterval(0);
else
ERROR_LOG("no support for SwapInterval (framerate clamped to monitor refresh rate)\n");
ZZLog::Error_Log("No support for SwapInterval (framerate clamped to monitor refresh rate),");
}
#endif
}
@ -325,7 +325,7 @@ inline bool ZeroGS::CreateOpenShadersFile() {
if( fres == NULL ) {
fres = fopen("plugins/ps2hw.dat", "rb");
if( fres == NULL ) {
ERROR_LOG("Cannot find ps2hw.dat in working directory. Exiting\n");
ZZLog::Error_Log("Cannot find ps2hw.dat in working directory. Exiting.");
return false;
}
}
@ -353,7 +353,7 @@ inline bool ZeroGS::CreateOpenShadersFile() {
f = fopen(EFFECT_NAME, "r");
if( f == NULL ) {
ERROR_LOG("Failed to find %s, try compiling a non-devbuild\n", EFFECT_NAME);
ZZLog::Error_Log("Failed to find %s, try compiling a non-devbuild.", EFFECT_NAME);
return false;
}
}
@ -469,7 +469,7 @@ bool ZeroGS::Create(int _width, int _height)
glGenFramebuffersEXT( 1, &s_uFramebuffer);
if( s_uFramebuffer == 0 ) {
ERROR_LOG("Failed to create the renderbuffer\n");
ZZLog::Error_Log("Failed to create the renderbuffer.");
}
assert( glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT );
@ -584,10 +584,10 @@ bool ZeroGS::Create(int _width, int _height)
BLOCK::FillBlocks(vBlockData, vBilinearData, 0);
glTexImage2D(GL_TEXTURE_2D, 0, 2, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, GL_R, GL_UNSIGNED_SHORT, &vBlockData[0]);
if( glGetError() != GL_NO_ERROR ) {
ERROR_LOG("ZZogl ERROR: could not fill blocks\n");
ZZLog::Error_Log("Could not fill blocks.");
return false;
}
ERROR_LOG("Using non-bilinear fill\n");
ZZLog::Error_Log("Using non-bilinear fill.");
}
else {
// fill in the bilinear blocks
@ -599,11 +599,13 @@ bool ZeroGS::Create(int _width, int _height)
g_internalRGBAFloatFmt = GL_FLOAT_RGBA32_NV;
g_internalRGBAFloat16Fmt = GL_FLOAT_RGBA16_NV;
glTexImage2D(GL_TEXTURE_2D, 0, g_internalRGBAFloatFmt, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, GL_RGBA, GL_FLOAT, &vBilinearData[0]);
ERROR_LOG("ZZogl Fill bilinear blocks\n");
ZZLog::Error_Log("ZZogl Fill bilinear blocks.");
B_G(glGetError() == GL_NO_ERROR, return false);
}
else
ERROR_LOG("Fill bilinear blocks failed!\n");
{
ZZLog::Error_Log("Fill bilinear blocks failed!");
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
@ -700,7 +702,7 @@ bool ZeroGS::Create(int _width, int _height)
g_vparamPosXY[0] = cgCreateParameter(g_cgcontext, CG_FLOAT4);
g_vparamPosXY[1] = cgCreateParameter(g_cgcontext, CG_FLOAT4);
ERROR_LOG("Creating effects\n");
ZZLog::Error_Log("Creating effects.");
B_G(LoadEffects(), return false);
g_bDisplayMsg = 0;
@ -723,7 +725,7 @@ bool ZeroGS::Create(int _width, int _height)
cgGLLoadProgram(pfrag->prog);
if( bFailed || pfrag == NULL || cgGetError() != CG_NO_ERROR ) {
g_nPixelShaderVer = SHADER_REDUCED;
ERROR_LOG("Basic shader test failed\n");
ZZLog::Error_Log("Basic shader test failed.");
}
}
@ -731,10 +733,10 @@ bool ZeroGS::Create(int _width, int _height)
if( g_nPixelShaderVer & SHADER_REDUCED )
conf.bilinear = 0;
ERROR_LOG("Creating extra effects\n");
ZZLog::Error_Log("Creating extra effects.");
B_G(LoadExtraEffects(), return false);
ERROR_LOG("using %s shaders\n", g_pShaders[g_nPixelShaderVer]);
ZZLog::Error_Log("Using %s shaders.", g_pShaders[g_nPixelShaderVer]);
GL_REPORT_ERROR();
if( err != GL_NO_ERROR ) bSuccess = false;
@ -764,7 +766,7 @@ bool ZeroGS::Create(int _width, int _height)
if (glGetError() == GL_NO_ERROR)
return bSuccess;
else {
ERROR_LOG("ZZogl ERROR: in final init");
ZZLog::Error_Log("In final init!");
return false;
}
}
@ -774,7 +776,7 @@ void ZeroGS::Destroy(BOOL bD3D)
if( s_aviinit ) {
StopCapture();
Stop_Avi();
ERROR_LOG("zerogs.avi stopped");
ZZLog::Error_Log("zerogs.avi stopped.");
s_aviinit = 0;
}

View File

@ -290,19 +290,19 @@ long BufferNumber = 0;
// This is debug function. It's print all buffer info and save current texture into the file, than printf file name.
inline void
VisualBufferMessage(int context) {
#if defined(PRIM_LOG) && defined(_DEBUG)
#if defined(WRITE_PRIM_LOGS) && defined(_DEBUG)
BufferNumber++;
ZeroGS::VB& curvb = vb[context];
static const char* patst[8] = { "NEVER", "ALWAYS", "LESS", "LEQUAL", "EQUAL", "GEQUAL", "GREATER", "NOTEQUAL"};
static const char* pztst[4] = { "NEVER", "ALWAYS", "GEQUAL", "GREATER" };
static const char* pafail[4] = { "KEEP", "FB_ONLY", "ZB_ONLY", "RGB_ONLY" };
ERROR_LOG("**Drawing ctx %d, num %d, fbp: 0x%x, zbp: 0x%x, fpsm: %d, zpsm: %d, fbw: %d\n", context, vb[context].nCount, curvb.prndr->fbp, curvb.zbuf.zbp, curvb.prndr->psm, curvb.zbuf.psm, curvb.prndr->fbw);
ERROR_LOG("prim: prim=%x iip=%x tme=%x fge=%x abe=%x aa1=%x fst=%x ctxt=%x fix=%x\n",
ZZLog::Error_Log("**Drawing ctx %d, num %d, fbp: 0x%x, zbp: 0x%x, fpsm: %d, zpsm: %d, fbw: %d", context, vb[context].nCount, curvb.prndr->fbp, curvb.zbuf.zbp, curvb.prndr->psm, curvb.zbuf.psm, curvb.prndr->fbw);
ZZLog::Error_Log("prim: prim=%x iip=%x tme=%x fge=%x abe=%x aa1=%x fst=%x ctxt=%x fix=%x",
curvb.curprim.prim, curvb.curprim.iip, curvb.curprim.tme, curvb.curprim.fge, curvb.curprim.abe, curvb.curprim.aa1, curvb.curprim.fst, curvb.curprim.ctxt, curvb.curprim.fix);
ERROR_LOG("test: ate:%d, atst: %s, aref: %d, afail: %s, date: %d, datm: %d, zte: %d, ztst: %s, fba: %d\n",
ZZLog::Error_Log("test: ate:%d, atst: %s, aref: %d, afail: %s, date: %d, datm: %d, zte: %d, ztst: %s, fba: %d",
curvb.test.ate, patst[curvb.test.atst], curvb.test.aref, pafail[curvb.test.afail], curvb.test.date, curvb.test.datm, curvb.test.zte, pztst[curvb.test.ztst], curvb.fba.fba);
ERROR_LOG("alpha: A%d B%d C%d D%d FIX:%d pabe: %d; aem: %d, ta0: %d, ta1: %d\n", curvb.alpha.a, curvb.alpha.b, curvb.alpha.c, curvb.alpha.d, curvb.alpha.fix, gs.pabe, gs.texa.aem, gs.texa.ta[0], gs.texa.ta[1]);
ERROR_LOG("tex0: tbp0=0x%x, tbw=%d, psm=0x%x, tw=%d, th=%d, tcc=%d, tfx=%d, cbp=0x%x, cpsm=0x%x, csm=%d, csa=%d, cld=%d\n",
ZZLog::Error_Log("alpha: A%d B%d C%d D%d FIX:%d pabe: %d; aem: %d, ta0: %d, ta1: %d\n", curvb.alpha.a, curvb.alpha.b, curvb.alpha.c, curvb.alpha.d, curvb.alpha.fix, gs.pabe, gs.texa.aem, gs.texa.ta[0], gs.texa.ta[1]);
ZZLog::Error_Log("tex0: tbp0=0x%x, tbw=%d, psm=0x%x, tw=%d, th=%d, tcc=%d, tfx=%d, cbp=0x%x, cpsm=0x%x, csm=%d, csa=%d, cld=%d",
curvb.tex0.tbp0, curvb.tex0.tbw, curvb.tex0.psm, curvb.tex0.tw,
curvb.tex0.th, curvb.tex0.tcc, curvb.tex0.tfx, curvb.tex0.cbp,
curvb.tex0.cpsm, curvb.tex0.csm, curvb.tex0.csa, curvb.tex0.cld);
@ -312,10 +312,10 @@ VisualBufferMessage(int context) {
Name = NamedSaveTex(&curvb.tex0, 1);
// else
// Name = NamedSaveTex(&curvb.tex0, 0);
ERROR_LOG("TGA name %s\n", Name);
ZZLog::Error_Log("TGA name '%s'.", Name);
free(Name);
// }
ERROR_LOG("frame: %d, buffer %ld\n\n", g_SaveFrameNum, BufferNumber);
ZZLog::Error_Log("frame: %d, buffer %ld.\n", g_SaveFrameNum, BufferNumber);
#endif
}
@ -861,7 +861,7 @@ inline FRAGMENTSHADER* FlushMadeNewTarget(VB& curvb, int exactcolor, int context
IsAlphaTestExpansion(curvb), exactcolor, curvb.clamp, context, NULL);
if (pfragment == NULL)
ERROR_LOG("Could not find memory target shader\n");
ZZLog::Error_Log("Could not find memory target shader.");
return pfragment;
}
@ -907,7 +907,7 @@ inline FRAGMENTSHADER* FlushRendererStage(VB& curvb, u32& dwFilterOpts, CRenderT
pfragment = FlushMadeNewTarget(curvb, exactcolor, context);
if (pfragment == NULL) {
ERROR_LOG("Shader does not found\n");
ZZLog::Error_Log("Shader is not found.");
// return NULL;
}
FlushSetTexture(curvb, pfragment, ptextarg, context);
@ -974,7 +974,7 @@ inline u32 AlphaSetupBlendTest(VB& curvb) {
u32 oldabe = curvb.curprim.abe;
if (gs.pabe) {
//ERROR_LOG("PBE!\n");
//ZZLog::Error_Log("PABE!");
curvb.curprim.abe = 1;
glEnable(GL_BLEND);
}
@ -1035,8 +1035,9 @@ inline void AlphaRenderStencil(VB& curvb, bool s_bDestAlphaTest, bool bCanRender
}
#ifdef _DEBUG
if (bDestAlphaColor == 1) {
WARN_LOG("dest alpha blending! manipulate alpha here\n");
if (bDestAlphaColor == 1)
{
ZZLog::Debug_Log("Dest alpha blending! Manipulate alpha here.");
}
#endif
@ -1121,7 +1122,7 @@ inline void AlphaFailureTestJob(VB& curvb, const pixTest curtest, FRAGMENTSHADE
}
#ifdef NOALFAFAIL
ERROR_LOG("Alpha job here %d %d %d %d %d %d\n", s_dwColorWrite, curtest.atst, curtest.afail, curtest.aref, gs.pabe, s_bWriteDepth);
ZZLog::Error_Log("Alpha job here %d %d %d %d %d %d", s_dwColorWrite, curtest.atst, curtest.afail, curtest.aref, gs.pabe, s_bWriteDepth);
// return;
#endif
@ -1691,8 +1692,8 @@ void ZeroGS::SetContextTarget(int context)
curvb.prndr->SetTarget(curvb.frame.fbp, curvb.scissor, context);
if( (curvb.zbuf.zbp-curvb.pdepth->fbp) != (curvb.frame.fbp - curvb.prndr->fbp) && curvb.test.zte )
WARN_LOG("frame and zbuf not aligned\n");
if ((curvb.zbuf.zbp-curvb.pdepth->fbp) != (curvb.frame.fbp - curvb.prndr->fbp) && curvb.test.zte)
ZZLog::Warn_Log("Frame and zbuf not aligned.");
curvb.bVarsSetTarg = TRUE;
if( vb[!context].prndr != curvb.prndr ) vb[!context].bVarsSetTarg = FALSE;
@ -2002,7 +2003,7 @@ void ZeroGS::SetTexVariablesInt(int context, int bilinear, const tex0Info& tex0,
}
if( m_Blocks[tex0.psm].bpp == 0 ) {
ERROR_LOG("Undefined tex psm 0x%x!\n", tex0.psm);
ZZLog::Error_Log("Undefined tex psm 0x%x!", tex0.psm);
return;
}
@ -2399,7 +2400,7 @@ void ZeroGS::SetAlphaVariables(const alphaInfo& a)
break;
}
default: {
ERROR_LOG ( "Bad alpha code %d | %d %d %d\n", code, a.a, a.b, a.d );
ZZLog::Error_Log("Bad alpha code %d | %d %d %d", code, a.a, a.b, a.d);
}
}
/*

View File

@ -44,10 +44,10 @@ const char* ShaderHandleName = "";
// Error handler. Setup in ZZogl_Create once.
void HandleCgError(CGcontext ctx, CGerror err, void* appdata)
{
ERROR_LOG("%s->%s: %s\n", ShaderCallerName, ShaderHandleName, cgGetErrorString(err));
ZZLog::Error_Log("%s->%s: %s", ShaderCallerName, ShaderHandleName, cgGetErrorString(err));
const char* listing = cgGetLastListing(g_cgcontext);
if (listing != NULL)
DEBUG_LOG(" last listing: %s\n", listing);
ZZLog::Debug_Log(" Last listing: %s", listing);
}
// This is a helper of cgGLSetParameter4fv, made for debugging purposes.
@ -130,11 +130,11 @@ void SetupVertexProgramParameters(CGprogram prog, int context)
p = cgGetNamedParameter(prog, "g_fZMin"); // Switch to flat-z when needed
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE ) {
//ERROR_LOG ("Use flat-z\n");
//ZZLog::Error_Log("Use flat-z");
cgGLSetParameter4fv(p, vlogz);
}
else
ERROR_LOG ("Shader file version is outdated! Only is log-Z possible\n");
ZZLog::Error_Log("Shader file version is outdated! Only log-Z is possible.");
}
Vector vnorm = Vector(g_filog32, 0, 0,0);
@ -163,11 +163,11 @@ void SetupVertexProgramParameters(CGprogram prog, int context)
assert( (header) != NULL && (header)->index == (Index) ); \
prog = cgCreateProgram(g_cgcontext, CG_OBJECT, (char*)(s_lpShaderResources + (header)->offset), cgvProf, NULL, NULL); \
if( !cgIsProgram(prog) ) { \
ERROR_LOG("Failed to load vs %d: \n%s\n", Index, cgGetLastListing(g_cgcontext)); \
ZZLog::Error_Log("Failed to load vs %d: \n%s.", Index, cgGetLastListing(g_cgcontext)); \
return false; \
} \
cgGLLoadProgram(prog); \
if( cgGetError() != CG_NO_ERROR ) ERROR_LOG("failed to load program %d\n", Index); \
if( cgGetError() != CG_NO_ERROR ) ZZLog::Error_Log("failed to load program %d.", Index); \
SetupVertexProgramParameters(prog, !!(Index&SH_CONTEXT1)); \
} \
@ -177,12 +177,12 @@ void SetupVertexProgramParameters(CGprogram prog, int context)
header = mapShaderResources[Index]; \
fragment.prog = cgCreateProgram(g_cgcontext, CG_OBJECT, (char*)(s_lpShaderResources + (header)->offset), cgfProf, NULL, NULL); \
if( !cgIsProgram(fragment.prog) ) { \
ERROR_LOG("Failed to load ps %d: \n%s\n", Index, cgGetLastListing(g_cgcontext)); \
ZZLog::Error_Log("Failed to load ps %d: \n%s.", Index, cgGetLastListing(g_cgcontext)); \
return false; \
} \
cgGLLoadProgram(fragment.prog); \
if( cgGetError() != CG_NO_ERROR ) { \
ERROR_LOG("failed to load program %d\n", Index); \
ZZLog::Error_Log("failed to load program %d.", Index); \
bLoadSuccess = false; \
} \
SetupFragmentProgramParameters(&fragment, !!(Index&SH_CONTEXT1), 0); \
@ -263,7 +263,7 @@ bool ZeroGS::LoadExtraEffects()
LOAD_PS(SH_BITBLTPS, ppsBitBlt[0]);
LOAD_PS(SH_BITBLTAAPS, ppsBitBlt[1]);
if( !bLoadSuccess ) {
ERROR_LOG("Failed to load BitBltAAPS, using BitBltPS\n");
ZZLog::Error_Log("Failed to load BitBltAAPS, using BitBltPS.");
LOAD_PS(SH_BITBLTPS, ppsBitBlt[1]);
}
LOAD_PS(SH_BITBLTDEPTHPS, ppsBitBltDepth);
@ -283,7 +283,7 @@ bool ZeroGS::LoadExtraEffects()
}
if( !bLoadSuccess )
ERROR_LOG("Failed to create CRTC shaders\n");
ZZLog::Error_Log("Failed to create CRTC shaders.");
LOAD_PS(SH_CRTC24PS, ppsCRTC24[0]);
LOAD_PS(SH_CRTC24INTERPS, ppsCRTC24[1]);
@ -333,10 +333,10 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
assert( mapShaderResources.find(index) != mapShaderResources.end() );
SHADERHEADER* header = mapShaderResources[index];
if( header == NULL )
ERROR_LOG("%d %d\n", index, g_nPixelShaderVer);
ZZLog::Error_Log("%d %d", index, g_nPixelShaderVer);
assert( header != NULL );
//DEBUG_LOG("shader:\n%s\n", (char*)(s_lpShaderResources + (header)->offset));
//ZZLog::Debug_Log("Shader:\n%s.", (char*)(s_lpShaderResources + (header)->offset));
pf->prog = cgCreateProgram(g_cgcontext, CG_OBJECT, (char*)(s_lpShaderResources + (header)->offset), cgfProf, NULL, NULL);
if( pf->prog != NULL && cgIsProgram(pf->prog) && cgGetError() == CG_NO_ERROR ) {
SetupFragmentProgramParameters(pf, context, type);
@ -344,7 +344,7 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
if( cgGetError() != CG_NO_ERROR ) {
// cgGLLoadProgram(pf->prog);
// if( cgGetError() != CG_NO_ERROR ) {
ERROR_LOG("Failed to load shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
ZZLog::Error_Log("Failed to load shader %d,%d,%d,%d.", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
if( pbFailed != NULL ) *pbFailed = true;
return pf;
// }
@ -352,7 +352,7 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
return pf;
}
ERROR_LOG("Failed to create shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
ZZLog::Error_Log("Failed to create shader %d,%d,%d,%d", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
if( pbFailed != NULL ) *pbFailed = true;
return NULL;
@ -363,11 +363,11 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
#define LOAD_VS(name, prog, shaderver) { \
prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, EFFECT_NAME, shaderver, name, args); \
if( !cgIsProgram(prog) ) { \
ERROR_LOG("Failed to load vs %s: \n%s\n", name, cgGetLastListing(g_cgcontext)); \
ZZLog::Error_Log("Failed to load vs %s: \n%s.", name, cgGetLastListing(g_cgcontext)); \
return false; \
} \
cgGLLoadProgram(prog); \
if( cgGetError() != CG_NO_ERROR ) ERROR_LOG("failed to load program %s\n", name); \
if( cgGetError() != CG_NO_ERROR ) ZZLog::Error_Log("failed to load program %s.", name); \
SetupVertexProgramParameters(prog, args[0]==context1); \
} \
@ -381,12 +381,12 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
bLoadSuccess = true; \
fragment.prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, EFFECT_NAME, shaderver, name, args); \
if( !cgIsProgram(fragment.prog) ) { \
ERROR_LOG("Failed to load ps %s: \n%s\n", name, cgGetLastListing(g_cgcontext)); \
ZZLog::Error_Log("Failed to load ps %s: \n%s.", name, cgGetLastListing(g_cgcontext)); \
return false; \
} \
cgGLLoadProgram(fragment.prog); \
if( cgGetError() != CG_NO_ERROR ) { \
ERROR_LOG("failed to load program %s\n", name); \
ZZLog::Error_Log("failed to load program %s.", name); \
bLoadSuccess = false; \
} \
SetupFragmentProgramParameters(&fragment, args[0]==context1, 0); \
@ -461,7 +461,7 @@ bool ZeroGS::LoadExtraEffects()
LOAD_PS("BitBltPS", ppsBitBlt[0], cgfProf);
LOAD_PS("BitBltAAPS", ppsBitBlt[1], cgfProf);
if( !bLoadSuccess ) {
ERROR_LOG("Failed to load BitBltAAPS, using BitBltPS\n");
ZZLog::Error_Log("Failed to load BitBltAAPS, using BitBltPS.");
LOAD_PS("BitBltPS", ppsBitBlt[1], cgfProf);
}
@ -481,8 +481,7 @@ bool ZeroGS::LoadExtraEffects()
LOAD_PS("CRTCInterPS", ppsCRTC[1], cgfProf);
}
if( !bLoadSuccess )
ERROR_LOG("Failed to create CRTC shaders\n");
if (!bLoadSuccess) ZZLog::Error_Log("Failed to create CRTC shaders.");
LOAD_PS("CRTC24PS", ppsCRTC24[0], cgfProf); LOAD_PS("CRTC24InterPS", ppsCRTC24[1], cgfProf);
LOAD_PS("ZeroPS", ppsOne, cgfProf);
@ -491,7 +490,7 @@ bool ZeroGS::LoadExtraEffects()
LOAD_PS("Convert32to16PS", ppsConvert32to16, cgfProf);
// if( !conf.mrtdepth ) {
// ERROR_LOG("Disabling MRT depth writing\n");
// ZZLog::Error_Log("Disabling MRT depth writing.");
// s_bWriteDepth = FALSE;
// }
@ -541,7 +540,7 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
// try again
// cgGLLoadProgram(pf->prog);
// if( cgGetError() != CG_NO_ERROR ) {
ERROR_LOG("Failed to load shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
ZZLog::Error_Log("Failed to load shader %d,%d,%d,%d.", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
if( pbFailed != NULL ) *pbFailed = true;
//assert(0);
// NULL makes things crash
@ -551,7 +550,7 @@ FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int te
return pf;
}
ERROR_LOG("Failed to create shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
ZZLog::Error_Log("Failed to create shader %d,%d,%d,%d.", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
if( pbFailed != NULL ) *pbFailed = true;
return NULL;

View File

@ -301,7 +301,7 @@ void ZeroGS::StartCapture()
s_aviinit = 1;
}
else {
ERROR_LOG("Continuing from previous capture");
ZZLog::Error_Log("Continuing from previous capture.");
}
s_avicapturing = 1;

View File

@ -225,7 +225,7 @@ ZeroGS::VB::CheckFrameAddConstraints(int tbp)
#ifdef DEVBUILD
if (frame.fbh == 0xe2)
ERROR_LOG ("Const: %x %x %d| %x %d %x %x\n", frame.fbh, frame.fbw, ConstraintReson, noscissorpos, ConstrainR1, tbp, frame.fbp);
ZZLog::Error_Log ("Const: %x %x %d| %x %d %x %x", frame.fbh, frame.fbw, ConstraintReson, noscissorpos, ConstrainR1, tbp, frame.fbp);
#endif
// Fixme: Reserved psm for framebuffers
@ -290,7 +290,7 @@ ZeroGS::VB::CheckFrameResolveRender(int tbp) {
}
}
PRIM_LOG("frame_%d: fbp=0x%x fbw=%d fbh=%d(%d) psm=0x%x fbm=0x%x\n", ictx, gsfb.fbp, gsfb.fbw, gsfb.fbh, pnewtarg->fbh, gsfb.psm, gsfb.fbm);
ZZLog::Prim_Log("frame_%d: fbp=0x%x fbw=%d fbh=%d(%d) psm=0x%x fbm=0x%x\n", ictx, gsfb.fbp, gsfb.fbw, gsfb.fbh, pnewtarg->fbh, gsfb.psm, gsfb.fbm);
if( (pprevrndr != pnewtarg) || (pprevrndr != NULL && (pprevrndr->status & CRenderTarget::TS_NeedUpdate)) )
result = 1;
@ -328,12 +328,12 @@ void ZeroGS::VB::CheckFrame(int tbp)
{
static int bChanged;
if( bNeedZCheck ) {
PRIM_LOG("zbuf_%d: zbp=0x%x psm=0x%x, zmsk=%d\n", ictx, zbuf.zbp, zbuf.psm, zbuf.zmsk);
ZZLog::Prim_Log("zbuf_%d: zbp=0x%x psm=0x%x, zmsk=%d\n", ictx, zbuf.zbp, zbuf.psm, zbuf.zmsk);
//zbuf = *zb;
}
if( m_Blocks[gsfb.psm].bpp == 0 ) {
ERROR_LOG("CheckFrame invalid bpp %d\n", gsfb.psm);
ZZLog::Error_Log("CheckFrame invalid bpp %d.", gsfb.psm);
return;
}

View File

@ -338,13 +338,13 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
#ifdef STATS
st_out_bit_counts[st_current_index] += n;
#endif
// DEBUG_LOG("put_bits=%d %x\n", n, value);
// ZZLog::Debug_Log("put_bits=%d %x.", n, value);
assert(n == 32 || value < (1U << n));
bit_buf = s->bit_buf;
bit_left = s->bit_left;
// DEBUG_LOG("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
// ZZLog::Debug_Log("n=%d value=%x cnt=%d buf=%x.", n, value, bit_cnt, bit_buf);
/* XXX: optimize */
if (n < bit_left) {
bit_buf = (bit_buf<<n) | value;
@ -361,7 +361,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
} else
#endif
*(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
//DEBUG_LOG("bitbuf = %08x\n", bit_buf);
//ZZLog::Debug_Log("bitbuf = %08x.", bit_buf);
s->buf_ptr+=4;
bit_left+=32 - n;
bit_buf = value;
@ -403,7 +403,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
ptr[0] |= be2me_32(value>>(index&31));
ptr[1] = be2me_32(value<<(32-(index&31)));
//if(n>24) DEBUG_LOG("%d %d\n", n, value);
// if (n > 24) ZZLog::Debug_Log("%d %d", n, value);
index+= n;
s->index= index;
# endif
@ -431,7 +431,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
ptr[0] |= be2me_32(value<<(32-n-(index&7) ));
ptr[1] = 0;
//if(n>24) DEBUG_LOG("%d %d\n", n, value);
// if (n > 24) ZZLog::Debug_Log("%d %d", n, value);
index+= n;
s->index= index;
# endif
@ -882,20 +882,22 @@ static always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
#ifdef TRACE
static inline void print_bin(int bits, int n){
#if _DEBUG
int i;
for(i=n-1; i>=0; i--){
DEBUG_LOG("%d", (bits>>i)&1);
ZZLog::Log("%d", (bits>>i)&1);
}
for(i=n; i<24; i++)
DEBUG_LOG(" ");
ZZLog::Log(" ");
#endif
}
static inline int get_bits_trace(GetBitContext *s, int n, char *file, char *func, int line){
int r= get_bits(s, n);
print_bin(r, n);
DEBUG_LOG("%5d %2d %3d bit @%5d in %s %s:%d\n", r, n, r, get_bits_count(s)-n, file, func, line);
ZZLog::Debug_Log("%5d %2d %3d bit @%5d in %s %s:%d", r, n, r, get_bits_count(s)-n, file, func, line);
return r;
}
static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int max_depth, char *file, char *func, int line){
@ -907,7 +909,7 @@ static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2], int bits
print_bin(bits2, len);
DEBUG_LOG("%5d %2d %3d vlc @%5d in %s %s:%d\n", bits2, len, r, pos, file, func, line);
ZZLog::Debug_Log("%5d %2d %3d vlc @%5d in %s %s:%d", bits2, len, r, pos, file, func, line);
return r;
}
static inline int get_xbits_trace(GetBitContext *s, int n, char *file, char *func, int line){
@ -915,7 +917,7 @@ static inline int get_xbits_trace(GetBitContext *s, int n, char *file, char *fun
int r= get_xbits(s, n);
print_bin(show, n);
DEBUG_LOG("%5d %2d %3d xbt @%5d in %s %s:%d\n", show, n, r, get_bits_count(s)-n, file, func, line);
ZZLog::Debug_Log("%5d %2d %3d xbt @%5d in %s %s:%d", show, n, r, get_bits_count(s)-n, file, func, line);
return r;
}

View File

@ -391,12 +391,12 @@ void ZeroGS::CRenderTarget::Update(int context, ZeroGS::CRenderTarget* pdepth)
if( ittarg == s_DepthRTs.mapTargets.end() )
nUpdateTarg = 0;
else if( ittarg->second == this ) {
ERROR_LOG("updating self");
ZZLog::Error_Log("Updating self.");
nUpdateTarg = 0;
}
}
else if( ittarg->second == this ) {
ERROR_LOG("updating self");
ZZLog::Error_Log("Updating self.");
nUpdateTarg = 0;
}
}
@ -490,10 +490,10 @@ void ZeroGS::CRenderTarget::ConvertTo32()
FUNCLOG
u32 ptexConv;
// ERROR_LOG("ZZogl: Convert to 32, report if something missing\n");
// ZZLog::Error_Log("Convert to 32, report if something missing.");
// create new target
if ( ! InitialiseDefaultTexture ( &ptexConv, RW(fbw), RH(fbh)/2 ) ) {
ERROR_LOG("Failed to create target for ConvertTo32 %dx%d\n", RW(fbw), RH(fbh)/2);
ZZLog::Error_Log("Failed to create target for ConvertTo32 %dx%d.", RW(fbw), RH(fbh)/2);
return;
}
@ -588,10 +588,10 @@ void ZeroGS::CRenderTarget::ConvertTo16()
u32 ptexConv;
// ERROR_LOG("ZZogl: Convert to 16, report if something missing\n");
// ZZLog::Error_Log("Convert to 16, report if something missing.");
// create new target
if ( ! InitialiseDefaultTexture ( &ptexConv, RW(fbw), RH(fbh)*2 ) ) {
ERROR_LOG("Failed to create target for ConvertTo16 %dx%d\n", RW(fbw), RH(fbh)*2);
ZZLog::Error_Log("Failed to create target for ConvertTo16 %dx%d.", RW(fbw), RH(fbh)*2);
return;
}
@ -687,7 +687,7 @@ void ZeroGS::CRenderTarget::_CreateFeedback()
if( ptexFeedback == 0 ) {
// create
if ( ! InitialiseDefaultTexture( &ptexFeedback, RW(fbw), RH(fbh) ) ) {
ERROR_LOG("Failed to create feedback %dx%d\n", RW(fbw), RH(fbh));
ZZLog::Error_Log("Failed to create feedback %dx%d.", RW(fbw), RH(fbh));
return;
}
}
@ -796,7 +796,7 @@ bool ZeroGS::CDepthTarget::Create(const frameInfo& frame)
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, RW(fbw), RH(fbh));
if( glGetError() != GL_NO_ERROR ) {
ERROR_LOG("failed to create depth buffer %dx%d\n", RW(fbw), RH(fbh));
ZZLog::Error_Log("Failed to create depth buffer %dx%d.", RW(fbw), RH(fbh));
return false;
}
}
@ -1146,12 +1146,10 @@ CRenderTarget* ZeroGS::CRenderTargetMngr::GetTarg(const frameInfo& frame, u32 op
// can be both 16bit and 32bit
if( PSMT_ISHALF(frame.psm) != PSMT_ISHALF(it->second->psm) ) {
// a lot of games do this actually...
#ifdef _DEBUG
WARN_LOG("Really bad formats! %d %d\n", frame.psm, it->second->psm);
#endif
// a lot of games do this, actually...
ZZLog::Debug_Log("Really bad formats! %d %d", frame.psm, it->second->psm);
// This code SHOULD be commented, until I redone _Resolve function
// This code SHOULD be commented, until I redo the _Resolve function
if( !(opts&TO_StrictHeight) ) {
if( (g_GameSettings & GAME_VSSHACKOFF) ) {
if (PSMT_ISHALF(it->second->psm)) {
@ -1172,7 +1170,7 @@ CRenderTarget* ZeroGS::CRenderTargetMngr::GetTarg(const frameInfo& frame, u32 op
// certain variables have to be reset every time
if( (it->second->psm&~1) != (frame.psm&~1) ) {
#ifndef RELEASE_TO_PUBLIC
WARN_LOG("bad formats 2: %d %d\n", frame.psm, it->second->psm);
ZZLog::Warn_Log("Bad formats 2: %d %d", frame.psm, it->second->psm);
#endif
it->second->psm = frame.psm;
@ -1182,7 +1180,7 @@ CRenderTarget* ZeroGS::CRenderTargetMngr::GetTarg(const frameInfo& frame, u32 op
}
if( it->second->fbm != frame.fbm ) {
//WARN_LOG("bad fbm: 0x%8.8x 0x%8.8x, psm: %d\n", frame.fbm, it->second->fbm, frame.psm);
//ZZLog::Warn_Log("Bad fbm: 0x%8.8x 0x%8.8x, psm: %d", frame.fbm, it->second->fbm, frame.psm);
}
it->second->fbm &= frame.fbm;
@ -1362,7 +1360,7 @@ CRenderTarget* ZeroGS::CRenderTargetMngr::GetTarg(const frameInfo& frame, u32 op
if( pmngrs[cur] == NULL ) {
cur = !cur;
if( pmngrs[cur] == NULL ) {
WARN_LOG("Out of memory!\n");
ZZLog::Warn_Log("Out of memory!");
delete ptarg;
return NULL;
}
@ -2035,7 +2033,7 @@ ZeroGS::CMemoryTarget* ZeroGS::CMemoryTargetMngr::GetMemoryTarget(const tex0Info
int disalignment = 16 - ((u32)(uptr)dst)%16 ; // This is value of shift. It could be 0 < disalignment <= 15
ptexdata = &texdata[disalignment]; // Set pointer to aligned element
dst = (u16*)ptexdata;
GS_LOG("Made alignment for texdata, 0x%x\n", dst );
ZZLog::GS_Log("Made alignment for texdata, 0x%x", dst );
assert( ((u32)(uptr)dst)%16 == 0 ); // Assert, because at future could be vectors with uncontigious spaces
}
@ -2082,7 +2080,7 @@ ZeroGS::CMemoryTarget* ZeroGS::CMemoryTargetMngr::GetMemoryTarget(const tex0Info
{
if (listTargets.size() == 0)
{
ERROR_LOG("Failed to create %dx%x texture\n", GPU_TEXWIDTH*channels*widthmult, (realheight+widthmult-1)/widthmult);
ZZLog::Error_Log("Failed to create %dx%x texture.", GPU_TEXWIDTH*channels*widthmult, (realheight+widthmult-1)/widthmult);
channels = 1;
return NULL;
}
@ -2237,15 +2235,13 @@ u32 ZeroGS::CBitwiseTextureMngr::GetTexInt(u32 bitvalue, u32 ptexDoNotDelete)
}
}
if (glGetError() != GL_NO_ERROR )
ERROR_LOG ("Error before creation of bitmask texture\n");
if (glGetError() != GL_NO_ERROR) ZZLog::Error_Log("Error before creation of bitmask texture.");
// create a new tex
u32 ptex;
glGenTextures(1, &ptex);
if (glGetError() != GL_NO_ERROR )
ERROR_LOG ("Error on generation of bitmask texture\n");
if (glGetError() != GL_NO_ERROR) ZZLog::Error_Log("Error on generation of bitmask texture.");
vector<u16> data(GPU_TEXMASKWIDTH+1);
for(u32 i = 0; i < GPU_TEXMASKWIDTH; ++i)
@ -2254,13 +2250,11 @@ u32 ZeroGS::CBitwiseTextureMngr::GetTexInt(u32 bitvalue, u32 ptexDoNotDelete)
glBindTexture(GL_TEXTURE_RECTANGLE_NV, ptex);
if (glGetError() != GL_NO_ERROR )
ERROR_LOG ("Error on binding bitmask texture\n");
if (glGetError() != GL_NO_ERROR ) ZZLog::Error_Log("Error on binding bitmask texture.");
glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_LUMINANCE16, GPU_TEXMASKWIDTH+1, 1, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, &data[0]);
if (glGetError() != GL_NO_ERROR )
ERROR_LOG ("Error on puting bitmask texture\n");
if (glGetError() != GL_NO_ERROR ) ZZLog::Error_Log("Error on applying bitmask texture.");
// Removing clamping, as it seems lead to numerous troubles at some drivers
// Need to observe, may be clamping is not really needed.
@ -2271,12 +2265,12 @@ u32 ZeroGS::CBitwiseTextureMngr::GetTexInt(u32 bitvalue, u32 ptexDoNotDelete)
if( Error != GL_NO_ERROR ) {
ERROR_LOG_SPAM_TEST("Failed to create bitmask texture; \t");
if (SPAM_PASS) {
ERROR_LOG("bitmask cache %d; \t", mapTextures.size());
ZZLog::Log("bitmask cache %d; \t", mapTextures.size());
switch (Error) {
case GL_INVALID_ENUM: ERROR_LOG("Invalid enumerator\n") ; break;
case GL_INVALID_VALUE: ERROR_LOG("Invalid value\n"); break;
case GL_INVALID_OPERATION: ERROR_LOG("Invalid operation\n"); break;
default: ERROR_LOG("Error number: %d \n", Error);
case GL_INVALID_ENUM: ZZLog::Error_Log("Invalid enumerator.") ; break;
case GL_INVALID_VALUE: ZZLog::Error_Log("Invalid value."); break;
case GL_INVALID_OPERATION: ZZLog::Error_Log("Invalid operation."); break;
default: ZZLog::Error_Log("Error number: %d.", Error);
}
}
return 0;
@ -2468,7 +2462,7 @@ void ResolveInRange(int start, int end)
if ((*it)->created == 123 )
(*it)->Resolve();
else
ERROR_LOG("Resolving non-existing object! Destroy code %d\n", (*it)->created);
ZZLog::Error_Log("Resolving non-existing object! Destroy code %d.", (*it)->created);
}
}
}
@ -2619,7 +2613,7 @@ void InitTransferHostLocal()
#ifndef RELEASE_TO_PUBLIC
if( gs.trxpos.dx+gs.imageWnew > gs.dstbuf.bw )
WARN_LOG("Transfer error, width exceeds\n");
ZZLog::Warn_Log("Transfer error, width exceeded.");
#endif
//bool bHasFlushed = false;
@ -2639,7 +2633,7 @@ void InitTransferHostLocal()
GetRectMemAddress(start, end, gs.dstbuf.psm, gs.trxpos.dx, gs.trxpos.dy, gs.imageWnew, gs.imageHnew, gs.dstbuf.bp, gs.dstbuf.bw);
if( end > 0x00400000 ) {
WARN_LOG("host local out of bounds!\n");
ZZLog::Warn_Log("Host local out of bounds!");
//gs.imageTransfer = -1;
end = 0x00400000;
}
@ -2651,7 +2645,7 @@ void InitTransferHostLocal()
if( vb[1].nCount > 0 )
Flush(1);
//PRIM_LOG("trans: bp:%x x:%x y:%x w:%x h:%x\n", gs.dstbuf.bp, gs.trxpos.dx, gs.trxpos.dy, gs.imageWnew, gs.imageHnew);
//ZZLog::Prim_Log("trans: bp:%x x:%x y:%x w:%x h:%x\n", gs.dstbuf.bp, gs.trxpos.dx, gs.trxpos.dy, gs.imageWnew, gs.imageHnew);
// if( !bHasFlushed && (vb[0].bNeedFrameCheck || vb[0].bNeedZCheck || vb[1].bNeedFrameCheck || vb[1].bNeedZCheck)) {
// Flush(0);
@ -2712,7 +2706,7 @@ void TransferHostLocal(const void* pbyMem, u32 nQWordSize)
if( (ptarg->status & CRenderTarget::TS_Virtual) )
continue;
//ERROR_LOG("resolving to alpha channel\n");
//ZZLog::Error_Log("Resolving to alpha channel.");
ptarg->Resolve();
}
}
@ -2776,7 +2770,7 @@ void TransferHostLocal(const void* pbyMem, u32 nQWordSize)
// const T* pbuf = (const T*)pbyMem; \
// u32 nSize = nQWordSize*(4/sizeof(T)); \
// assert( (nSize%widthlimit) == 0 && widthlimit <= 4 ); \
// if( ((gs.imageEndX-gs.trxpos.dx)%widthlimit) ) ERROR_LOG("Bad Transmission! %d %d, psm: %d\n", gs.trxpos.dx, gs.imageEndX, DSTPSM); \
// if( ((gs.imageEndX-gs.trxpos.dx)%widthlimit) ) ZZLog::Error_Log("Bad Transmission! %d %d, psm: %d.", gs.trxpos.dx, gs.imageEndX, DSTPSM); \
// for(; i < gs.imageEndY; ++i) { \
// for(; j < gs.imageEndX && nSize > 0; j += widthlimit, nSize -= widthlimit, pbuf += widthlimit) { \
// /* write as many pixel at one time as possible */ \
@ -2844,7 +2838,7 @@ void TransferHostLocal(const void* pbyMem, u32 nQWordSize)
//// // hack
//// if( abs((int)nQWordSize*8 - (gs.imageEndY-i)*(gs.imageEndX-gs.trxpos.dx)+(j-gs.trxpos.dx)) <= 8 ) {
//// // don't transfer
//// ERROR_LOG("bad texture 4: %d %d %d\n", gs.trxpos.dx, gs.imageEndX, nQWordSize);
//// ZZLog::Error_Log("bad texture 4: %d %d %d.", gs.trxpos.dx, gs.imageEndX, nQWordSize);
//// gs.imageEndX = gs.trxpos.dx + (gs.imageEndX-gs.trxpos.dx)&~7;
//// //i = gs.imageEndY;
//// //goto End;
@ -2892,7 +2886,7 @@ void InitTransferLocalHost()
#ifndef RELEASE_TO_PUBLIC
if( gs.trxpos.sx+gs.imageWnew > gs.srcbuf.bw )
WARN_LOG("Transfer error, width exceeds\n");
ZZLog::Warn_Log("Transfer error, width exceeded.");
#endif
gs.imageX = gs.trxpos.sx;
@ -3004,10 +2998,10 @@ void TransferLocalLocal()
assert( gs.trxpos.sx+gs.imageWnew < 2048 && gs.trxpos.sy+gs.imageHnew < 2048 );
assert( gs.trxpos.dx+gs.imageWnew < 2048 && gs.trxpos.dy+gs.imageHnew < 2048 );
assert( (gs.srcbuf.psm&0x7) == (gs.dstbuf.psm&0x7) );
if( gs.trxpos.sx+gs.imageWnew > gs.srcbuf.bw )
WARN_LOG("Transfer error, src width exceeds\n");
if( gs.trxpos.dx+gs.imageWnew > gs.dstbuf.bw )
WARN_LOG("Transfer error, dst width exceeds\n");
if (gs.trxpos.sx+gs.imageWnew > gs.srcbuf.bw)
ZZLog::Warn_Log("Transfer error, src width exceeded.");
if (gs.trxpos.dx+gs.imageWnew > gs.dstbuf.bw)
ZZLog::Warn_Log("Transfer error, dst width exceeded.");
int srcstart, srcend, dststart, dstend;
@ -3238,7 +3232,7 @@ void GetRectMemAddress(int& start, int& end, int psm, int x, int y, int w, int h
{
FUNCLOG
if( m_Blocks[psm].bpp == 0 ) {
ERROR_LOG("ZeroGS: Bad psm 0x%x\n", psm);
ZZLog::Error_Log("ZeroGS: Bad psm 0x%x.", psm);
start = 0;
end = 0x00400000;
return;
@ -3432,7 +3426,7 @@ void _Resolve(const void* psrc, int fbp, int fbw, int fbh, int psm, u32 fbm, boo
// Targets over 2000 should be shuffle. FFX and KH2 (0x2100)
int X = (psm == 0) ? 0 : 0;
//if (X == 1)
//ERROR_LOG("resolve: %x %x %x %x (%x-%x)\n", psm, fbp, fbw, fbh, start, end);
//ZZLog::Error_Log("resolve: %x %x %x %x (%x-%x).", psm, fbp, fbw, fbh, start, end);
#define RESOLVE_32BIT(psm, T, Tsrc, blockbits, blockwidth, blockheight, convfn, frame, aax, aay) \

View File

@ -217,31 +217,31 @@ void ZeroGS::HandleGLError()
case GL_FRAMEBUFFER_COMPLETE_EXT:
break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
ERROR_LOG("Error! missing a required image/buffer attachment!\n");
ZZLog::Error_Log("Error! missing a required image/buffer attachment!");
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
ERROR_LOG("Error! has no images/buffers attached!\n");
ZZLog::Error_Log("Error! has no images/buffers attached!");
break;
// case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
// ERROR_LOG("Error! has an image/buffer attached in multiple locations!\n");
// ZZLog::Error_Log("Error! has an image/buffer attached in multiple locations!");
// break;
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
ERROR_LOG("Error! has mismatched image/buffer dimensions!\n");
ZZLog::Error_Log("Error! has mismatched image/buffer dimensions!");
break;
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
ERROR_LOG("Error! colorbuffer attachments have different types!\n");
ZZLog::Error_Log("Error! colorbuffer attachments have different types!");
break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
ERROR_LOG("Error! trying to draw to non-attached color buffer!\n");
ZZLog::Error_Log("Error! trying to draw to non-attached color buffer!");
break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
ERROR_LOG("Error! trying to read from a non-attached color buffer!\n");
ZZLog::Error_Log("Error! trying to read from a non-attached color buffer!");
break;
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
ERROR_LOG("Error! format is not supported by current graphics card/driver!\n");
ZZLog::Error_Log("Error! format is not supported by current graphics card/driver!");
break;
default:
ERROR_LOG("*UNKNOWN ERROR* reported from glCheckFramebufferStatusEXT() for %s!\n");
ZZLog::Error_Log("*UNKNOWN ERROR* reported from glCheckFramebufferStatusEXT() for %s!");
break;
}
}
@ -354,10 +354,12 @@ void ZeroGS::ChangeDeviceSize(int nNewWidth, int nNewHeight)
//int oldscreen = s_nFullscreen;
int oldwidth = nBackbufferWidth, oldheight = nBackbufferHeight;
if( !Create(nNewWidth&~7, nNewHeight&~7) ) {
ERROR_LOG("Failed to recreate, changing to old\n");
if( !Create(oldwidth, oldheight) ) {
SysMessage("failed to create dev, exiting...\n");
if (!Create(nNewWidth&~7, nNewHeight&~7))
{
ZZLog::Error_Log("Failed to recreate, changing to old device.");
if ( Create(oldwidth, oldheight))
{
SysMessage("Failed to create device, exiting...");
exit(0);
}
}
@ -594,8 +596,8 @@ __forceinline void SET_VERTEX(VertexGPU *p, int Index, const VB& curvb)
static __forceinline void OUTPUT_VERT(VertexGPU vert, u32 id)
{
#ifdef PRIM_LOG
PRIM_LOG("%c%d(%d): xyzf=(%4d,%4d,0x%x,%3d), rgba=0x%8.8x, stq = (%2.5f,%2.5f,%2.5f)\n",
#ifdef WRITE_PRIM_LOGS
ZZLog::Prim_Log("%c%d(%d): xyzf=(%4d,%4d,0x%x,%3d), rgba=0x%8.8x, stq = (%2.5f,%2.5f,%2.5f)\n",
id==0?'*':' ', id, prim->prim, vert.x/8, vert.y/8, vert.z, vert.f/128,
vert.rgba, Clamp(vert.s, -10, 10), Clamp(vert.t, -10, 10), Clamp(vert.q, -10, 10));
#endif
@ -774,7 +776,7 @@ void ZeroGS::KickSprite()
void ZeroGS::KickDummy()
{
FUNCLOG
//GREG_LOG("Kicking bad primitive: %.8x\n", *(u32*)prim);
//ZZLog::Greg_Log("Kicking bad primitive: %.8x\n", *(u32*)prim);
}
void ZeroGS::SetFogColor(u32 fog)
@ -806,7 +808,7 @@ void ZeroGS::SetFogColor(u32 fog)
void ZeroGS::ExtWrite()
{
FUNCLOG
WARN_LOG("ExtWrite\n");
ZZLog::Warn_Log("A hollow voice says 'EXTWRITE'! Nothing happens.");
// use local DISPFB, EXTDATA, EXTBUF, and PMODE
// int bpp, start, end;
@ -843,7 +845,7 @@ bool IsDirty(u32 highdword, u32 psm, int cld, int cbp)
if (cpsm > 1 || csm)
{
// Mana Khemia triggers this.
//ERROR_LOG("16 bit clut not supported.\n");
//ZZLog::Error_Log("16 bit clut not supported.");
return true;
}
@ -997,7 +999,7 @@ bool ZeroGS::CheckChangeInClut(u32 highdword, u32 psm)
int cbp = ZZOglGet_cbp_TexBits(highdword);
// processing the CLUT after tex0/2 are written
//ERROR_LOG("high == 0x%x; cld == %d\n", highdword, cld);
//ZZLog::Error_Log("high == 0x%x; cld == %d", highdword, cld);
switch(cld) {
case 0: return false;
case 1: break;
@ -1040,7 +1042,7 @@ void ZeroGS::texClutWrite(int ctx)
if (gs.cbp[1] == tex0.cbp) return;
gs.cbp[1] = tex0.cbp;
break;
default: //DEBUG_LOG("cld isn't 0-5!");
default: //ZZLog::Debug_Log("cld isn't 0-5!");
break;
}
@ -1094,7 +1096,7 @@ void ZeroGS::texClutWrite(int ctx)
// check if address exceeds src
if( src+getPixelAddress32_0(gs.clut.cou+entries-1, gs.clut.cov, gs.clut.cbw) >= (u32*)g_pbyGSMemory + 0x00100000 )
ERROR_LOG("texClutWrite out of bounds\n");
ZZLog::Error_Log("texClutWrite out of bounds.");
else
for(int i = 0; i < entries; ++i)
{
@ -1107,7 +1109,7 @@ void ZeroGS::texClutWrite(int ctx)
default:
{
#ifndef RELEASE_TO_PUBLIC
//DEBUG_LOG("unknown cpsm: %x (%x)\n", tex0.cpsm, tex0.psm);
//ZZLog::Debug_Log("Unknown cpsm: %x (%x).", tex0.cpsm, tex0.psm);
#endif
break;
}

View File

@ -99,20 +99,20 @@ using namespace std;
#define FORIT(it, v) for(it = (v).begin(); it != (v).end(); ++(it))
// sends a message to output window if assert fails
#define BMSG(x, str) { if( !(x) ) { GS_LOG(str); GS_LOG(str); } }
#define BMSG_RETURN(x, str) { if( !(x) ) { GS_LOG(str); GS_LOG(str); return; } }
#define BMSG_RETURNX(x, str, rtype) { if( !(x) ) { GS_LOG(str); GS_LOG(str); return (##rtype); } }
#define B(x) { if( !(x) ) { GS_LOG(_#x"\n"); GS_LOG(#x"\n"); } }
#define B_RETURN(x) { if( !(x) ) { ERROR_LOG("%s:%d: %s\n", __FILE__, (u32)__LINE__, #x); return; } }
#define B_RETURNX(x, rtype) { if( !(x) ) { ERROR_LOG("%s:%d: %s\n", __FILE__, (u32)__LINE__, #x); return (##rtype); } }
#define B_G(x, action) { if( !(x) ) { ERROR_LOG("%s:%d: %s\n", __FILE__, (u32)__LINE__, #x); action; } }
#define BMSG(x, str) { if( !(x) ) { ZZLog::Log(str); ZZLog::Log(str); } }
#define BMSG_RETURN(x, str) { if( !(x) ) { ZZLog::Log(str); ZZLog::Log(str); return; } }
#define BMSG_RETURNX(x, str, rtype) { if( !(x) ) { ZZLog::Log(str); ZZLog::Log(str); return (##rtype); } }
#define B(x) { if( !(x) ) { ZZLog::Log(_#x"\n"); ZZLog::Log(#x"\n"); } }
#define B_RETURN(x) { if( !(x) ) { ZZLog::Error_Log("%s:%d: %s", __FILE__, (u32)__LINE__, #x); return; } }
#define B_RETURNX(x, rtype) { if( !(x) ) { ZZLog::Error_Log("%s:%d: %s", __FILE__, (u32)__LINE__, #x); return (##rtype); } }
#define B_G(x, action) { if( !(x) ) { ZZLog::Error_Log("%s:%d: %s", __FILE__, (u32)__LINE__, #x); action; } }
#define GL_REPORT_ERROR() \
{ \
GLenum err = glGetError(); \
if( err != GL_NO_ERROR ) \
{ \
ERROR_LOG("%s:%d: gl error %s\n", __FILE__, (int)__LINE__, error_name(err)); \
ZZLog::Error_Log("%s:%d: gl error %s", __FILE__, (int)__LINE__, error_name(err)); \
ZeroGS::HandleGLError(); \
} \
}
@ -123,7 +123,7 @@ using namespace std;
GLenum err = glGetError(); \
if( err != GL_NO_ERROR ) \
{ \
ERROR_LOG("%s:%d: gl error %s\n", __FILE__, (int)__LINE__, error_name(err)); \
ZZLog::Error_Log("%s:%d: gl error %s", __FILE__, (int)__LINE__, error_name(err)); \
ZeroGS::HandleGLError(); \
} \
}