diff options
| author | Nolan Check <Nolan.Check@gmail.com> | 2009-06-29 07:30:48 +0000 |
|---|---|---|
| committer | Nolan Check <Nolan.Check@gmail.com> | 2009-06-29 07:30:48 +0000 |
| commit | c2e0225aa39a0e98a65f5ebbd600cd9f2aa05e9c (patch) | |
| tree | 080275a318d8f639e20ffd49218ff18aa9053b0d /Source/Core | |
| parent | 188fa9b2cb9ba5f5d37faab40a906112905e7aa9 (diff) | |
Move to new Virtual XFB system which correctly handles games which store multiple XFB's in memory. More OpenGL cleanup.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3591 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/Src/PluginVideo.h | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/VideoInterface.cpp | 37 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPFunctions.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPStructs.cpp | 2 |
4 files changed, 30 insertions, 13 deletions
diff --git a/Source/Core/Common/Src/PluginVideo.h b/Source/Core/Common/Src/PluginVideo.h index 1721899b6d..6b6940fd2c 100644 --- a/Source/Core/Common/Src/PluginVideo.h +++ b/Source/Core/Common/Src/PluginVideo.h @@ -25,7 +25,7 @@ namespace Common { typedef void (__cdecl* TVideo_Prepare)(); typedef void (__cdecl* TVideo_SendFifoData)(u8*,u32); -typedef void (__cdecl* TVideo_UpdateXFB)(u8*, u32, u32, s32, bool); +typedef void (__cdecl* TVideo_UpdateXFB)(u32, u32, u32, s32, bool); typedef bool (__cdecl* TVideo_Screenshot)(const char* filename); typedef void (__cdecl* TVideo_EnterLoop)(); typedef void (__cdecl* TVideo_ExitLoop)(); diff --git a/Source/Core/Core/Src/HW/VideoInterface.cpp b/Source/Core/Core/Src/HW/VideoInterface.cpp index b6fd1d18ac..8d08f1273a 100644 --- a/Source/Core/Core/Src/HW/VideoInterface.cpp +++ b/Source/Core/Core/Src/HW/VideoInterface.cpp @@ -995,6 +995,14 @@ u8* GetXFBPointerTop() return Memory::GetPointer(m_XFBInfoTop.FBB); } +u32 GetXFBPointerTop_GC() +{ + if (m_XFBInfoTop.POFF) + return m_XFBInfoTop.FBB << 5; + else + return m_XFBInfoTop.FBB; +} + u8* GetXFBPointerBottom() { // POFF for XFB bottom is connected to POFF for XFB top @@ -1004,6 +1012,15 @@ u8* GetXFBPointerBottom() return Memory::GetPointer(m_XFBInfoBottom.FBB); } +u32 GetXFBPointerBottom_GC() +{ + // POFF for XFB bottom is connected to POFF for XFB top + if (m_XFBInfoTop.POFF) + return m_XFBInfoBottom.FBB << 5; + else + return m_XFBInfoBottom.FBB; +} + // Screenshot and screen message @@ -1077,7 +1094,7 @@ void Update() if (m_VBeamPos == NextXFBRender) { - u8* xfbPtr = 0; + u32 xfbAddr = 0; int yOffset = 0; if (NextXFBRender == 1) @@ -1086,34 +1103,34 @@ void Update() // TODO: proper VI regs typedef and logic for XFB to work. // eg. Animal Crossing gc have smth in TFBL.XOF bitfield. // "XOF - Horizontal Offset of the left-most pixel within the first word of the fetched picture." - xfbPtr = GetXFBPointerTop(); - _dbg_assert_msg_(VIDEOINTERFACE, xfbPtr, "Bad top XFB address"); + xfbAddr = GetXFBPointerTop_GC(); + _dbg_assert_msg_(VIDEOINTERFACE, xfbAddr, "Bad top XFB address"); } else { NextXFBRender = 1; // Previously checked m_XFBInfoTop.POFF then used m_XFBInfoBottom.FBB, try reverting if there are problems - xfbPtr = GetXFBPointerBottom(); - _dbg_assert_msg_(VIDEOINTERFACE, xfbPtr, "Bad bottom XFB address"); + xfbAddr = GetXFBPointerBottom_GC(); + _dbg_assert_msg_(VIDEOINTERFACE, xfbAddr, "Bad bottom XFB address"); yOffset = -1; } Common::PluginVideo* video = CPluginManager::GetInstance().GetVideo(); - if (xfbPtr && video->IsValid()) + if (xfbAddr && video->IsValid()) { int fbWidth = m_HorizontalStepping.FieldSteps * 16; int fbHeight = (m_HorizontalStepping.FbSteps / m_HorizontalStepping.FieldSteps) * m_VerticalTimingRegister.ACV; - DEBUG_LOG(VIDEOINTERFACE, "(VI->XFBUpdate): ptr: %p | %ix%i | xoff: %i", - xfbPtr, fbWidth, fbHeight, m_XFBInfoTop.XOFF); + DEBUG_LOG(VIDEOINTERFACE, "(VI->XFBUpdate): ptr: %.08X | %ix%i | xoff: %i", + xfbAddr, fbWidth, fbHeight, m_XFBInfoTop.XOFF); if (Core::GetStartupParameter().bUseDualCore) // scheduled on EmuThread in DC mode - video->Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset, TRUE); + video->Video_UpdateXFB(xfbAddr, fbWidth, fbHeight, yOffset, TRUE); else // otherwise do it now from here (CPUthread) - video->Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset, FALSE); + video->Video_UpdateXFB(xfbAddr, fbWidth, fbHeight, yOffset, FALSE); } } diff --git a/Source/Core/VideoCommon/Src/BPFunctions.h b/Source/Core/VideoCommon/Src/BPFunctions.h index c3dd4ccc01..c22e9aa0b6 100644 --- a/Source/Core/VideoCommon/Src/BPFunctions.h +++ b/Source/Core/VideoCommon/Src/BPFunctions.h @@ -48,7 +48,7 @@ void SetColorMask(const Bypass &bp); float GetRendererTargetScaleX();
float GetRendererTargetScaleY();
void CopyEFB(const Bypass &bp, const TRectangle &rc, const u32 &address, const bool &fromZBuffer, const bool &isIntensityFmt, const u32 ©fmt, const bool &scaleByHalf);
-void RenderToXFB(const Bypass &bp, const TRectangle &multirc, const float &yScale, const float &xfbLines, u8* pXFB, const u32 &dstWidth, const u32 &dstHeight);
+void RenderToXFB(const Bypass &bp, const TRectangle &multirc, const float &yScale, const float &xfbLines, u32 xfbAddr, const u32 &dstWidth, const u32 &dstHeight);
void ClearScreen(const Bypass &bp, const TRectangle &multirc);
void RestoreRenderState(const Bypass &bp);
u8 *GetPointer(const u32 &address);
diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index e0b0c9bca2..19540bfca3 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -220,7 +220,7 @@ void BPWritten(const Bypass& bp) const float yScale = bpmem.dispcopyyscale / 256.0f;
const float xfbLines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale);
RenderToXFB(bp, multirc, yScale, xfbLines,
- Memory_GetPtr(bpmem.copyTexDest << 5),
+ bpmem.copyTexDest << 5,
bpmem.copyMipMapStrideChannels << 4,
(u32)ceil(xfbLines));
}
|
