gsdx: use correct format in printf

u => unsigned
d => signed

zu => size_t
This commit is contained in:
Gregory Hainaut 2016-08-13 12:40:30 +02:00
parent 0a1454ff6c
commit 15db7eeb81
9 changed files with 112 additions and 112 deletions

View File

@ -201,7 +201,7 @@ void GSDeviceOGL::GenerateProfilerData()
FILE* csv = fopen("GSdx_profile.csv", "w");
if (csv) {
for (size_t i = 0; i < times.size(); i++) {
fprintf(csv, "%d,%lf\n", i, times[i]);
fprintf(csv, "%zu,%lf\n", i, times[i]);
}
fclose(csv);

View File

@ -134,32 +134,32 @@ public:
if (!fp) return;
fprintf(fp, "XYOFFSET\n"
"\tX:%d\n"
"\tY:%d\n\n"
"\tX:%u\n"
"\tY:%u\n\n"
, XYOFFSET.OFX, XYOFFSET.OFY);
fprintf(fp, "TEX0\n"
"\tTBP0:0x%x\n"
"\tTBW:%d\n"
"\tTBW:%u\n"
"\tPSM:0x%x\n"
"\tTW:%d\n"
"\tTCC:%d\n"
"\tTFX:%d\n"
"\tTW:%u\n"
"\tTCC:%u\n"
"\tTFX:%u\n"
"\tCBP:0x%x\n"
"\tCPSM:0x%x\n"
"\tCSM:%d\n"
"\tCSA:%d\n"
"\tCLD:%d\n"
"\tTH:%lld\n\n"
"\tCSM:%u\n"
"\tCSA:%u\n"
"\tCLD:%u\n"
"\tTH:%llu\n\n"
, TEX0.TBP0, TEX0.TBW, TEX0.PSM, TEX0.TW, TEX0.TCC, TEX0.TFX, TEX0.CBP, TEX0.CPSM, TEX0.CSM, TEX0.CSA, TEX0.CLD, TEX0.TH);
fprintf(fp, "TEX1\n"
"\tLCM:%d\n"
"\tMXL:%d\n"
"\tMMAG:%d\n"
"\tMMIN:%d\n"
"\tMTBA:%d\n"
"\tL:%d\n"
"\tLCM:%u\n"
"\tMXL:%u\n"
"\tMMAG:%u\n"
"\tMMIN:%u\n"
"\tMTBA:%u\n"
"\tL:%u\n"
"\tK:%d\n\n"
, TEX1.LCM, TEX1.MXL, TEX1.MMAG, TEX1.MMIN, TEX1.MTBA, TEX1.L, TEX1.K);
@ -167,57 +167,57 @@ public:
"\tPSM:0x%x\n"
"\tCBP:0x%x\n"
"\tCPSM:0x%x\n"
"\tCSM:%d\n"
"\tCSA:%d\n"
"\tCLD:%d\n\n"
"\tCSM:%u\n"
"\tCSA:%u\n"
"\tCLD:%u\n\n"
, TEX2.PSM, TEX2.CBP, TEX2.CPSM, TEX2.CSM, TEX2.CSA, TEX2.CLD);
fprintf(fp, "CLAMP\n"
"\tWMS:%d\n"
"\tWMT:%d\n"
"\tMINU:%d\n"
"\tMAXU:%d\n"
"\tMAXV:%d\n"
"\tMINV:%lld\n\n"
"\tWMS:%u\n"
"\tWMT:%u\n"
"\tMINU:%u\n"
"\tMAXU:%u\n"
"\tMAXV:%u\n"
"\tMINV:%llu\n\n"
, CLAMP.WMS, CLAMP.WMT, CLAMP.MINU, CLAMP.MAXU, CLAMP.MAXV, CLAMP.MINV);
// TODO mimmap? (yes I'm lazy)
fprintf(fp, "SCISSOR\n"
"\tX0:%d\n"
"\tX1:%d\n"
"\tY0:%d\n"
"\tY1:%d\n\n"
"\tX0:%u\n"
"\tX1:%u\n"
"\tY0:%u\n"
"\tY1:%u\n\n"
, SCISSOR.SCAX0, SCISSOR.SCAX1, SCISSOR.SCAY0, SCISSOR.SCAY1);
fprintf(fp, "ALPHA\n"
"\tA:%d\n"
"\tB:%d\n"
"\tC:%d\n"
"\tD:%d\n"
"\tFIX:%d\n"
"\tA:%u\n"
"\tB:%u\n"
"\tC:%u\n"
"\tD:%u\n"
"\tFIX:%u\n"
, ALPHA.A, ALPHA.B, ALPHA.C, ALPHA.D, ALPHA.FIX);
const char *col[3] = {"Cs", "Cd", "0"};
const char *alpha[3] = {"As", "Ad", "Af"};
fprintf(fp, "\t=> (%s - %s) * %s + %s\n\n", col[ALPHA.A], col[ALPHA.B], alpha[ALPHA.C], col[ALPHA.D]);
fprintf(fp, "TEST\n"
"\tATE:%d\n"
"\tATST:%d\n"
"\tAREF:%d\n"
"\tAFAIL:%d\n"
"\tDATE:%d\n"
"\tDATM:%d\n"
"\tZTE:%d\n"
"\tZTST:%d\n\n"
"\tATE:%u\n"
"\tATST:%u\n"
"\tAREF:%u\n"
"\tAFAIL:%u\n"
"\tDATE:%u\n"
"\tDATM:%u\n"
"\tZTE:%u\n"
"\tZTST:%u\n\n"
, TEST.ATE, TEST.ATST, TEST.AREF, TEST.AFAIL, TEST.DATE, TEST.DATM, TEST.ZTE, TEST.ZTST);
fprintf(fp, "FBA\n"
"\tFBA:%d\n\n"
"\tFBA:%u\n\n"
, FBA.FBA);
fprintf(fp, "FRAME\n"
"\tFBP (*32):0x%x\n"
"\tFBW:%d\n"
"\tFBW:%u\n"
"\tPSM:0x%x\n"
"\tFBMSK:0x%x\n\n"
, FRAME.FBP*32, FRAME.FBW, FRAME.PSM, FRAME.FBMSK);
@ -225,7 +225,7 @@ public:
fprintf(fp, "ZBUF\n"
"\tZBP (*32):0x%x\n"
"\tPSM:0x%x\n"
"\tZMSK:%d\n\n"
"\tZMSK:%u\n\n"
, ZBUF.ZBP*32, ZBUF.PSM, ZBUF.ZMSK);
fclose(fp);

View File

@ -91,54 +91,54 @@ public:
if (!fp) return;
fprintf(fp, "PRIM\n"
"\tPRIM:%d\n"
"\tIIP:%d\n"
"\tTME:%d\n"
"\tFGE:%d\n"
"\tABE:%d\n"
"\tAA1:%d\n"
"\tFST:%d\n"
"\tCTXT:%d\n"
"\tFIX:%d\n\n"
"\tPRIM:%u\n"
"\tIIP:%u\n"
"\tTME:%u\n"
"\tFGE:%u\n"
"\tABE:%u\n"
"\tAA1:%u\n"
"\tFST:%u\n"
"\tCTXT:%u\n"
"\tFIX:%u\n\n"
, PRIM.PRIM, PRIM.IIP, PRIM.TME, PRIM.FGE, PRIM.ABE, PRIM.AA1, PRIM.FST, PRIM.CTXT, PRIM.FIX);
fprintf(fp, "PRMODE (when AC=0)\n"
"\t_PRIM:%d\n"
"\tIIP:%d\n"
"\tTME:%d\n"
"\tFGE:%d\n"
"\tABE:%d\n"
"\tAA1:%d\n"
"\tFST:%d\n"
"\tCTXT:%d\n"
"\tFIX:%d\n\n"
"\t_PRIM:%u\n"
"\tIIP:%u\n"
"\tTME:%u\n"
"\tFGE:%u\n"
"\tABE:%u\n"
"\tAA1:%u\n"
"\tFST:%u\n"
"\tCTXT:%u\n"
"\tFIX:%u\n\n"
, PRMODE._PRIM, PRMODE.IIP, PRMODE.TME, PRMODE.FGE, PRMODE.ABE, PRMODE.AA1, PRMODE.FST, PRMODE.CTXT, PRMODE.FIX);
fprintf(fp, "PRMODECONT\n"
"\tAC:%d\n\n"
"\tAC:%u\n\n"
, PRMODECONT.AC);
fprintf(fp, "TEXCLUT\n"
"\tCOU:%d\n"
"\tCBW:%d\n"
"\tCOV:%d\n\n"
"\tCOU:%u\n"
"\tCBW:%u\n"
"\tCOV:%u\n\n"
, TEXCLUT.COU, TEXCLUT.CBW, TEXCLUT.COV);
fprintf(fp, "SCANMSK\n"
"\tMSK:%d\n\n"
"\tMSK:%u\n\n"
"\n"
, SCANMSK.MSK);
fprintf(fp, "TEXA\n"
"\tAEM:%d\n"
"\tTA0:%d\n"
"\tTA1:%d\n\n"
"\tAEM:%u\n"
"\tTA0:%u\n"
"\tTA1:%u\n\n"
, TEXA.AEM, TEXA.TA0, TEXA.TA1);
fprintf(fp, "FOGCOL\n"
"\tFCG:%d\n"
"\tFCB:%d\n"
"\tFCR:%d\n\n"
"\tFCG:%u\n"
"\tFCB:%u\n"
"\tFCR:%u\n\n"
, FOGCOL.FCG, FOGCOL.FCB, FOGCOL.FCR);
fprintf(fp, "DIMX\n"
@ -161,42 +161,42 @@ public:
, DIMX.DM22, DIMX.DM23, DIMX.DM31, DIMX.DM02, DIMX.DM21, DIMX.DM12, DIMX.DM03, DIMX.DM01, DIMX.DM33, DIMX.DM30, DIMX.DM11, DIMX.DM10, DIMX.DM20, DIMX.DM32, DIMX.DM00, DIMX.DM13);
fprintf(fp, "DTHE\n"
"\tDTHE:%d\n\n"
"\tDTHE:%u\n\n"
, DTHE.DTHE);
fprintf(fp, "COLCLAMP\n"
"\tCLAMP:%d\n\n"
"\tCLAMP:%u\n\n"
, COLCLAMP.CLAMP);
fprintf(fp, "PABE\n"
"\tPABE:%d\n\n"
"\tPABE:%u\n\n"
, PABE.PABE);
fprintf(fp, "BITBLTBUF\n"
"\tSBW:%d\n"
"\tSBW:%u\n"
"\tSBP:0x%x\n"
"\tSPSM:%d\n"
"\tDBW:%d\n"
"\tDPSM:%d\n"
"\tSPSM:%u\n"
"\tDBW:%u\n"
"\tDPSM:%u\n"
"\tDBP:0x%x\n\n"
, BITBLTBUF.SBW, BITBLTBUF.SBP, BITBLTBUF.SPSM, BITBLTBUF.DBW, BITBLTBUF.DPSM, BITBLTBUF.DBP);
fprintf(fp, "TRXDIR\n"
"\tXDIR:%d\n\n"
"\tXDIR:%u\n\n"
, TRXDIR.XDIR);
fprintf(fp, "TRXPOS\n"
"\tDIRY:%d\n"
"\tSSAY:%d\n"
"\tSSAX:%d\n"
"\tDIRX:%d\n"
"\tDSAX:%d\n"
"\tDSAY:%d\n\n"
"\tDIRY:%u\n"
"\tSSAY:%u\n"
"\tSSAX:%u\n"
"\tDIRX:%u\n"
"\tDSAX:%u\n"
"\tDSAY:%u\n\n"
, TRXPOS.DIRY, TRXPOS.SSAY, TRXPOS.SSAX, TRXPOS.DIRX, TRXPOS.DSAX, TRXPOS.DSAY);
fprintf(fp, "TRXREG\n"
"\tRRH:%d\n"
"\tRRW:%d\n\n"
"\tRRH:%u\n"
"\tRRW:%u\n\n"
, TRXREG.RRH, TRXREG.RRW);
fclose(fp);

View File

@ -131,7 +131,7 @@ public:
uint64 tpf = p->frames > 0 ? p->ticks / p->frames : 0;
uint64 ppf = p->frames > 0 ? p->actual / p->frames : 0;
printf("[%014llx]%c %6.2f%% %5.2f%% f %4lld t %12lld p %12lld w %12lld tpp %4lld tpf %9lld ppf %9lld\n",
printf("[%014llx]%c %6.2f%% %5.2f%% f %4llu t %12llu p %12llu w %12lld tpp %4llu tpf %9llu ppf %9llu\n",
(uint64)key, m_map.find(key) == m_map.end() ? '*' : ' ',
(float)(tpf * 10000 / 34000000) / 100,
(float)(tpf * 10000 / ttpf) / 100,

View File

@ -747,7 +747,7 @@ void GSRendererCS::Write(GSOffset* off, const GSVector4i& r)
ctx->UpdateSubresource(m_vm, 0, &box, m_mem.m_vm8 + page * PAGE_SIZE, 0, 0);
*/
if(0)
printf("[%lld] write %05x %d %d (%d)\n", __rdtsc(), off->bp, off->bw, off->psm, page);
printf("[%lld] write %05x %u %u (%u)\n", __rdtsc(), off->bp, off->bw, off->psm, page);
}
}
@ -807,7 +807,7 @@ void GSRendererCS::Read(GSOffset* off, const GSVector4i& r, bool invalidate)
ctx->Unmap(m_pb, 0);
if(0)
printf("[%lld] read %05x %d %d (%d)\n", __rdtsc(), off->bp, off->bw, off->psm, page);
printf("[%lld] read %05x %u %u (%u)\n", __rdtsc(), off->bp, off->bw, off->psm, page);
}
}
}

View File

@ -103,7 +103,7 @@ void GSRendererSW::VSync(int field)
if(0) if(LOG)
{
fprintf(s_fp, "%lld\n", m_perfmon.GetFrame());
fprintf(s_fp, "%llu\n", m_perfmon.GetFrame());
GSVector4i dr = GetDisplayRect();
GSVector4i fr = GetFrameRect();
@ -117,7 +117,7 @@ void GSRendererSW::VSync(int field)
if(i == 0 && !m_regs->PMODE.EN1) continue;
if(i == 1 && !m_regs->PMODE.EN2) continue;
fprintf(s_fp, "DISPFB[%d] BP=%05x BW=%d PSM=%d DBX=%d DBY=%d\n",
fprintf(s_fp, "DISPFB[%d] BP=%05x BW=%d PSM=%d DBX=%d DBY=%d\n",
i,
m_regs->DISP[i].DISPFB.Block(),
m_regs->DISP[i].DISPFB.FBW,
@ -126,7 +126,7 @@ void GSRendererSW::VSync(int field)
m_regs->DISP[i].DISPFB.DBY
);
fprintf(s_fp, "DISPLAY[%d] DX=%d DY=%d DW=%d DH=%d MAGH=%d MAGV=%d\n",
fprintf(s_fp, "DISPLAY[%d] DX=%d DY=%d DW=%d DH=%d MAGH=%d MAGV=%d\n",
i,
m_regs->DISP[i].DISPLAY.DX,
m_regs->DISP[i].DISPLAY.DY,
@ -137,7 +137,7 @@ void GSRendererSW::VSync(int field)
);
}
fprintf(s_fp, "PMODE EN1=%d EN2=%d CRTMD=%d MMOD=%d AMOD=%d SLBG=%d ALP=%d\n",
fprintf(s_fp, "PMODE EN1=%u EN2=%u CRTMD=%u MMOD=%u AMOD=%u SLBG=%u ALP=%u\n",
m_regs->PMODE.EN1,
m_regs->PMODE.EN2,
m_regs->PMODE.CRTMD,
@ -147,7 +147,7 @@ void GSRendererSW::VSync(int field)
m_regs->PMODE.ALP
);
fprintf(s_fp, "SMODE1 CLKSEL=%d CMOD=%d EX=%d GCONT=%d LC=%d NVCK=%d PCK2=%d PEHS=%d PEVS=%d PHS=%d PRST=%d PVS=%d RC=%d SINT=%d SLCK=%d SLCK2=%d SPML=%d T1248=%d VCKSEL=%d VHP=%d XPCK=%d\n",
fprintf(s_fp, "SMODE1 CLKSEL=%u CMOD=%u EX=%u GCONT=%u LC=%u NVCK=%u PCK2=%u PEHS=%u PEVS=%u PHS=%u PRST=%u PVS=%u RC=%u SINT=%u SLCK=%u SLCK2=%u SPML=%u T1248=%u VCKSEL=%u VHP=%u XPCK=%u\n",
m_regs->SMODE1.CLKSEL,
m_regs->SMODE1.CMOD,
m_regs->SMODE1.EX,
@ -171,33 +171,33 @@ void GSRendererSW::VSync(int field)
m_regs->SMODE1.XPCK
);
fprintf(s_fp, "SMODE2 INT=%d FFMD=%d DPMS=%d\n",
fprintf(s_fp, "SMODE2 INT=%u FFMD=%u DPMS=%u\n",
m_regs->SMODE2.INT,
m_regs->SMODE2.FFMD,
m_regs->SMODE2.DPMS
);
fprintf(s_fp, "SRFSH %08x_%08x\n",
fprintf(s_fp, "SRFSH %08x_%08x\n",
m_regs->SRFSH.u32[0],
m_regs->SRFSH.u32[1]
);
fprintf(s_fp, "SYNCH1 %08x_%08x\n",
fprintf(s_fp, "SYNCH1 %08x_%08x\n",
m_regs->SYNCH1.u32[0],
m_regs->SYNCH1.u32[1]
);
fprintf(s_fp, "SYNCH2 %08x_%08x\n",
fprintf(s_fp, "SYNCH2 %08x_%08x\n",
m_regs->SYNCH2.u32[0],
m_regs->SYNCH2.u32[1]
);
fprintf(s_fp, "SYNCV %08x_%08x\n",
fprintf(s_fp, "SYNCV %08x_%08x\n",
m_regs->SYNCV.u32[0],
m_regs->SYNCV.u32[1]
);
fprintf(s_fp, "CSR %08x_%08x\n",
fprintf(s_fp, "CSR %08x_%08x\n",
m_regs->CSR.u32[0],
m_regs->CSR.u32[1]
);
@ -648,7 +648,7 @@ void GSRendererSW::Queue(shared_ptr<GSRasterizerData>& item)
{
GSScanlineGlobalData& gd = ((SharedData*)item.get())->global;
fprintf(s_fp, "[%d] queue %05x %d (%d) %05x %d (%d) %05x %d %dx%d (%d %d %d) | %d %d %d\n",
fprintf(s_fp, "[%d] queue %05x %d (%d) %05x %d (%d) %05x %d %dx%d (%d %d %d) | %u %d %d\n",
sd->counter,
m_context->FRAME.Block(), m_context->FRAME.PSM, gd.sel.fwrite,
m_context->ZBUF.Block(), m_context->ZBUF.PSM, gd.sel.zwrite,
@ -708,14 +708,14 @@ void GSRendererSW::Sync(int reason)
int pixels = m_rl->GetPixels();
if(LOG) {fprintf(s_fp, "sync n=%d r=%d t=%lld p=%d %c\n", s_n, reason, t, pixels, t > 10000000 ? '*' : ' '); fflush(s_fp);}
if(LOG) {fprintf(s_fp, "sync n=%d r=%d t=%llu p=%d %c\n", s_n, reason, t, pixels, t > 10000000 ? '*' : ' '); fflush(s_fp);}
m_perfmon.Put(GSPerfMon::Fillrate, pixels);
}
void GSRendererSW::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r)
{
if(LOG) {fprintf(s_fp, "w %05x %d %d, %d %d %d %d\n", BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM, r.x, r.y, r.z, r.w); fflush(s_fp);}
if(LOG) {fprintf(s_fp, "w %05x %u %u, %d %d %d %d\n", BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM, r.x, r.y, r.z, r.w); fflush(s_fp);}
GSOffset* off = m_mem.GetOffset(BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM);
@ -741,7 +741,7 @@ void GSRendererSW::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS
void GSRendererSW::InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool clut)
{
if(LOG) {fprintf(s_fp, "%s %05x %d %d, %d %d %d %d\n", clut ? "rp" : "r", BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM, r.x, r.y, r.z, r.w); fflush(s_fp);}
if(LOG) {fprintf(s_fp, "%s %05x %u %u, %d %d %d %d\n", clut ? "rp" : "r", BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM, r.x, r.y, r.z, r.w); fflush(s_fp);}
if(!m_rl->IsSynced())
{

View File

@ -36,7 +36,7 @@ GSShaderOGL::GSShaderOGL(bool debug) :
GSShaderOGL::~GSShaderOGL()
{
printf("Delete %d Shaders, %d Programs, %d Pipelines\n",
printf("Delete %zu Shaders, %zu Programs, %zu Pipelines\n",
m_shad_to_delete.size(), m_prog_to_delete.size(), m_pipe_to_delete.size());
for (auto s : m_shad_to_delete) glDeleteShader(s);

View File

@ -72,7 +72,7 @@ namespace PboPool {
m_size = size;
if (m_size > m_pbo_size) {
fprintf(stderr, "BUG: PBO too small %d but need %d\n", m_pbo_size, m_size);
fprintf(stderr, "BUG: PBO too small %u but need %u\n", m_pbo_size, m_size);
}
// Note: texsubimage will access currently bound buffer

View File

@ -109,7 +109,7 @@ class GSBufferOGL {
size_t current_chunk = offset >> 21;
#ifdef ENABLE_OGL_DEBUG_FENCE
fprintf(stderr, "%x: Wrap buffer\n", m_target);
fprintf(stderr, "%x: Insert a fence in chunk %d\n", m_target, current_chunk);
fprintf(stderr, "%x: Insert a fence in chunk %zu\n", m_target, current_chunk);
#endif
ASSERT(current_chunk > 0 && current_chunk < 5);
if (m_fence[current_chunk] == 0) {