From fd58ee62890b8c7e468c92a16aa51728908da49d Mon Sep 17 00:00:00 2001 From: Robert Neumann Date: Wed, 28 Sep 2016 16:18:59 +0200 Subject: [PATCH] psxmode: disabled a PGIF ringbuffer memset, added comments --- pcsx2/HwWrite.cpp | 3 --- pcsx2/ps2/pgif.cpp | 14 +++++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pcsx2/HwWrite.cpp b/pcsx2/HwWrite.cpp index 390ac3b0d9..489ef23fac 100644 --- a/pcsx2/HwWrite.cpp +++ b/pcsx2/HwWrite.cpp @@ -49,9 +49,6 @@ void __fastcall _hwWrite32( u32 mem, u32 value ) #if PSX_EXTRALOGS if ((mem & 0x1000ff00) == 0x1000f300) DevCon.Warning("32bit Write to SIF Register %x value %x", mem, value); //if ((mem & 0x1000ff00) == 0x1000f200) DevCon.Warning("Write to SIF Register %x value %x", mem, value); - - // todo: psx mode: this is new - if (((mem & 0x1FFFFFF0) == 0x1000f010) || ((mem & 0x1FFFFFF0) == 0x1000f010)) Console.WriteLn("EE ###INTC hwWR 0x%08X = 0x%08X PC=%08X ", mem, value, cpuRegs.pc); #endif switch (page) diff --git a/pcsx2/ps2/pgif.cpp b/pcsx2/ps2/pgif.cpp index 275bf19a1f..898f4d22e2 100644 --- a/pcsx2/ps2/pgif.cpp +++ b/pcsx2/ps2/pgif.cpp @@ -204,7 +204,8 @@ void ringBufPut(struct ringBuf_t *rb, u32 *data) rb->head = 0; //wrap back when the end is reached rb->count++; } else { - Console.WriteLn("############################# PGIF FIFO overflow! sz= %X", rb->size); + // This should never happen. If it does, the code is bad somewhere. + Console.WriteLn("############################# PGIF FIFO overflow! sz= %X", rb->size); } } @@ -216,6 +217,7 @@ void ringBufGet(struct ringBuf_t *rb, u32 *data) rb->tail = 0; //wrap back when the end is reached rb->count--; } else { + // This should never happen. If it does, the code is bad somewhere. Console.WriteLn("############################# PGIF FIFO underflow! sz= %X", rb->size); } } @@ -225,7 +227,10 @@ void ringBufClear(struct ringBuf_t *rb) rb->head = 0; rb->tail = 0; rb->count = 0; - memset(rb->buf, 0, rb->size * sizeof(u32)); + // wisi comment: + // Yes, the memset should be commented-out. The reason is that it shouldn't really be necessary (but I am not sure). + // It is better not to be enabled, because clearing the new huge PGIF FIFO, can waste significant time. + //memset(rb->buf, 0, rb->size * sizeof(u32)); return; } @@ -611,7 +616,10 @@ u32 psxGPUr(int addr) void PGIFw(int addr, u32 data) { #if REG_LOG == 1 - Console.WriteLn("PGIF write 0x%08X = 0x%08X 0x%08X EEpc= %08X IOPpc= %08X ", addr, data, getUpdPgifCtrlReg(), cpuRegs.pc, psxRegs.pc); + if (addr != PGIF_CTRL) + if ((addr != PGIF_CTRL) || ((addr == PGIF_CTRL) && (getUpdPgifCtrlReg() != data))) + if (addr != PGPU_STAT) + Console.WriteLn("PGIF write 0x%08X = 0x%08X 0x%08X EEpc= %08X IOPpc= %08X ", addr, data, getUpdPgifCtrlReg(), cpuRegs.pc, psxRegs.pc); #endif if (addr == PGPU_CMD_FIFO) {