From d79186fafed8ad0fba55476aeff12b63050c95a5 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Tue, 5 Jun 2012 06:46:52 +0000 Subject: [PATCH] zzogl replayer: * I miss some ending bit. * Use a full int for GSvsync * fix a small memory link git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5269 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg-cg/opengl/GSDump.cpp | 2 +- plugins/zzogl-pg-cg/opengl/GSmain.cpp | 12 ++++++++---- plugins/zzogl-pg-cg/opengl/GifTransfer.cpp | 2 +- plugins/zzogl-pg/opengl/GSDump.cpp | 2 +- plugins/zzogl-pg/opengl/GSmain.cpp | 12 ++++++++---- plugins/zzogl-pg/opengl/GifTransfer.cpp | 2 +- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/plugins/zzogl-pg-cg/opengl/GSDump.cpp b/plugins/zzogl-pg-cg/opengl/GSDump.cpp index ea6ee23fa7..38faa18e32 100644 --- a/plugins/zzogl-pg-cg/opengl/GSDump.cpp +++ b/plugins/zzogl-pg-cg/opengl/GSDump.cpp @@ -87,7 +87,7 @@ void GSDump::VSync(int field, bool last, u8* regs) fwrite(regs, 0x2000, 1, m_gs); fputc(1, m_gs); - fputc(field, m_gs); + fwrite(&field, 4, 1, m_gs); if((++m_frames & 1) == 0 && last) { diff --git a/plugins/zzogl-pg-cg/opengl/GSmain.cpp b/plugins/zzogl-pg-cg/opengl/GSmain.cpp index ec0c0e8fdf..84097f417c 100644 --- a/plugins/zzogl-pg-cg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg-cg/opengl/GSmain.cpp @@ -498,6 +498,8 @@ void CALLBACK GSvsync(int interlace) if (get_snapshot_filename(filename, "/tmp", "gs")) g_dump.Open(filename, g_LastCRC, fd, g_pBasePS2Mem); conf.dump--; + + free(payload); } g_dump.VSync(interlace, (conf.dump == 0), g_pBasePS2Mem); #endif @@ -686,7 +688,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) switch(p->param) { case 0: - p->buff.resize(0x4000/4); + p->buff.resize(0x4000); //p->addr = 0x4000 - p->size; //fread(&p->buff[p->addr], p->size, 1, fp); fread(&p->buff[0], p->size, 1, fp); @@ -694,7 +696,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) case 1: case 2: case 3: - p->buff.resize(p->size/4); + p->buff.resize(p->size); fread(&p->buff[0], p->size, 1, fp); break; } @@ -703,7 +705,8 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) case 1: - p->param = (u8)fgetc(fp); + fread(&p->param, 4, 1, fp); + //p->param = (u8)fgetc(fp); break; @@ -715,7 +718,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) case 3: - p->buff.resize(0x2000/4); + p->buff.resize(0x2000); fread(&p->buff[0], 0x2000, 1, fp); @@ -769,6 +772,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) // FIXME // GSreadFIFO2(&buff[0], p->size / 16); + fprintf(stderr, "GSreadFIFO2 not yet implemented"); break; diff --git a/plugins/zzogl-pg-cg/opengl/GifTransfer.cpp b/plugins/zzogl-pg-cg/opengl/GifTransfer.cpp index cb81d105f0..7b217d8bd3 100644 --- a/plugins/zzogl-pg-cg/opengl/GifTransfer.cpp +++ b/plugins/zzogl-pg-cg/opengl/GifTransfer.cpp @@ -219,7 +219,7 @@ template void _GSgifTransfer(const u32 *pMem, u32 size) } #ifdef _DEBUG - g_dump.Transfer(index, start, pMem - start, size_arg); + g_dump.Transfer(index, start, pMem - start + 4, size_arg); #endif // This is the case when not all data was readed from one try: VU1 has too much data. diff --git a/plugins/zzogl-pg/opengl/GSDump.cpp b/plugins/zzogl-pg/opengl/GSDump.cpp index ea6ee23fa7..38faa18e32 100644 --- a/plugins/zzogl-pg/opengl/GSDump.cpp +++ b/plugins/zzogl-pg/opengl/GSDump.cpp @@ -87,7 +87,7 @@ void GSDump::VSync(int field, bool last, u8* regs) fwrite(regs, 0x2000, 1, m_gs); fputc(1, m_gs); - fputc(field, m_gs); + fwrite(&field, 4, 1, m_gs); if((++m_frames & 1) == 0 && last) { diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index da2ac7b042..19f6ab4164 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -513,6 +513,8 @@ EXPORT_C_(void) GSvsync(int current_interlace) if (get_snapshot_filename(filename, "/tmp", "gs")) g_dump.Open(filename, g_LastCRC, fd, g_pBasePS2Mem); conf.dump--; + + free(payload); } g_dump.VSync(current_interlace, (conf.dump == 0), g_pBasePS2Mem); #endif @@ -702,7 +704,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) switch(p->param) { case 0: - p->buff.resize(0x4000/4); + p->buff.resize(0x4000); //p->addr = 0x4000 - p->size; //fread(&p->buff[p->addr], p->size, 1, fp); fread(&p->buff[0], p->size, 1, fp); @@ -710,7 +712,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) case 1: case 2: case 3: - p->buff.resize(p->size/4); + p->buff.resize(p->size); fread(&p->buff[0], p->size, 1, fp); break; } @@ -719,7 +721,8 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) case 1: - p->param = (u8)fgetc(fp); + fread(&p->param, 4, 1, fp); + //p->param = (u8)fgetc(fp); break; @@ -731,7 +734,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) case 3: - p->buff.resize(0x2000/4); + p->buff.resize(0x2000); fread(&p->buff[0], 0x2000, 1, fp); @@ -785,6 +788,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) // FIXME // GSreadFIFO2(&buff[0], p->size / 16); + fprintf(stderr, "GSreadFIFO2 not yet implemented"); break; diff --git a/plugins/zzogl-pg/opengl/GifTransfer.cpp b/plugins/zzogl-pg/opengl/GifTransfer.cpp index b348a47182..315da2ca85 100644 --- a/plugins/zzogl-pg/opengl/GifTransfer.cpp +++ b/plugins/zzogl-pg/opengl/GifTransfer.cpp @@ -223,7 +223,7 @@ template void _GSgifTransfer(const u32 *pMem, u32 size) } #ifdef _DEBUG - g_dump.Transfer(index, start, pMem - start, size_arg); + g_dump.Transfer(index, start, pMem - start + 4, size_arg); #endif // This is the case when not all data was readed from one try: VU1 has too much data.