From b78944866b133e3c9664c4fd0b0754c9f3055d32 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 27 Nov 2009 15:25:26 +0000 Subject: [PATCH] Fix a if statement I missed in the last commit, and add in a couple functions for printing structs. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2262 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Dmac.h | 11 +++++++++++ pcsx2/Gif.h | 8 ++++++++ pcsx2/Vif.cpp | 2 +- pcsx2/Vif.h | 6 +++++- pcsx2/Vif0Dma.cpp | 4 ++-- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/pcsx2/Dmac.h b/pcsx2/Dmac.h index 11e693a49e..ca842e0f13 100644 --- a/pcsx2/Dmac.h +++ b/pcsx2/Dmac.h @@ -43,6 +43,7 @@ union tDMA_CHCR { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Chcr: 0x%x", _u32); } }; union tDMA_SADR { @@ -55,6 +56,7 @@ union tDMA_SADR { tDMA_SADR(u32 val) { _u32 = val; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Sadr: 0x%x", _u32); } }; @@ -158,6 +160,7 @@ union tDMAC_CTRL { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Ctrl: 0x%x", _u32); } }; union tDMAC_STAT { @@ -181,6 +184,7 @@ union tDMAC_STAT { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Stat: 0x%x", _u32); } }; union tDMAC_PCR { @@ -199,6 +203,7 @@ union tDMAC_PCR { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Pcr: 0x%x", _u32); } }; union tDMAC_SQWC { @@ -216,6 +221,7 @@ union tDMAC_SQWC { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Sqwc: 0x%x", _u32); } }; union tDMAC_RBSR { @@ -228,6 +234,7 @@ union tDMAC_RBSR { tDMAC_RBSR(u32 val) { _u32 = val; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Rbsr: 0x%x", _u32); } }; union tDMAC_RBOR { @@ -240,6 +247,7 @@ union tDMAC_RBOR { tDMAC_RBOR(u32 val) { _u32 = val; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Rbor: 0x%x", _u32); } }; union tDMAC_STADR { @@ -252,6 +260,7 @@ union tDMAC_STADR { tDMAC_STADR(u32 val) { _u32 = val; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Stadr: 0x%x", _u32); } }; struct DMACregisters @@ -286,6 +295,7 @@ union tINTC_STAT { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Stat: 0x%x", _u32); } }; union tINTC_MASK { @@ -301,6 +311,7 @@ union tINTC_MASK { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Mask: 0x%x", _u32); } }; struct INTCregisters diff --git a/pcsx2/Gif.h b/pcsx2/Gif.h index 76384c8702..ed3ad9b0bc 100644 --- a/pcsx2/Gif.h +++ b/pcsx2/Gif.h @@ -75,6 +75,7 @@ union tGIF_CTRL void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Ctrl: 0x%x", _u32); } }; union tGIF_MODE @@ -95,6 +96,7 @@ union tGIF_MODE void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Mode: 0x%x", _u32); } }; enum gif_paths @@ -133,6 +135,7 @@ union tGIF_STAT void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Stat: 0x%x", _u32); } }; union tGIF_TAG0 @@ -151,6 +154,7 @@ union tGIF_TAG0 void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Tag0: 0x%x", _u32); } }; union tGIF_TAG1 @@ -171,6 +175,7 @@ union tGIF_TAG1 void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Tag1: 0x%x", _u32); } }; union tGIF_CNT @@ -192,6 +197,7 @@ union tGIF_CNT void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"CNT: 0x%x", _u32); } }; union tGIF_P3CNT @@ -206,6 +212,7 @@ union tGIF_P3CNT tGIF_P3CNT(u32 val) { _u32 = val; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"P3CNT: 0x%x", _u32); } }; union tGIF_P3TAG @@ -224,6 +231,7 @@ union tGIF_P3TAG void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"P3Tag: 0x%x", _u32); } }; struct GIFregisters diff --git a/pcsx2/Vif.cpp b/pcsx2/Vif.cpp index e97744c69f..11055768c3 100644 --- a/pcsx2/Vif.cpp +++ b/pcsx2/Vif.cpp @@ -655,7 +655,7 @@ void vifMFIFOInterrupt() // Console.WriteLn("Empty 1"); vifqwc = 0; vif1.inprogress |= 0x10; - vif1Regs->stat.FQC = 0; // FQC=0 + vif1Regs->stat.FQC = 0; hwDmacIrq(DMAC_MFIFO_EMPTY); return; } diff --git a/pcsx2/Vif.h b/pcsx2/Vif.h index 35ce1f688d..c80c953076 100644 --- a/pcsx2/Vif.h +++ b/pcsx2/Vif.h @@ -110,6 +110,7 @@ union tVIF_STAT { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Stat: 0x%x", _u32); } }; union tVIF_FBRST { @@ -128,6 +129,7 @@ union tVIF_FBRST { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Fbrst: 0x%x", _u32); } }; union tVIF_ERR { @@ -146,9 +148,11 @@ union tVIF_ERR { void set_flags(u32 flags) { _u32 |= flags; } void clear_flags(u32 flags) { _u32 &= ~flags; } void reset() { _u32 = 0; } + wxString desc() { return wxsFormat(L"Err: 0x%x", _u32); } }; -struct vifCycle { +struct vifCycle +{ u8 cl, wl; u8 pad[2]; }; diff --git a/pcsx2/Vif0Dma.cpp b/pcsx2/Vif0Dma.cpp index b550268b60..efbd565f16 100644 --- a/pcsx2/Vif0Dma.cpp +++ b/pcsx2/Vif0Dma.cpp @@ -648,9 +648,9 @@ void dmaVIF0() if (!(vif0ch->chcr.MOD & 0x1) || vif0ch->qwc > 0) // Normal Mode { - if (_VIF0chain() == -2) + if (!_VIF0chain()) { - Console.WriteLn("Stall on normal %x", vif0Regs->stat._u32); + Console.WriteLn(L"Stall on normal vif0 " + vif0Regs->stat.desc()); vif0.vifstalled = true; return;