Minor changes for video. Please test pictograph quests in Wind Waker.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3818 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Nolan Check 2009-07-16 22:45:18 +00:00
parent 18e45baafc
commit 598d640042
3 changed files with 26 additions and 21 deletions

View File

@ -1159,14 +1159,9 @@ void Update()
// TODO: What's the correct behavior for progressive mode? // TODO: What's the correct behavior for progressive mode?
for (int i = 0; i < 4; ++i) m_VBeamPos++;
{ if (m_VBeamPos > s_lineCount)
if (m_InterruptRegister[i].VCT == m_VBeamPos) m_VBeamPos = 1;
{
m_InterruptRegister[i].IR_INT = 1;
UpdateInterrupts();
}
}
if (m_VBeamPos == s_upperFieldBegin) if (m_VBeamPos == s_upperFieldBegin)
BeginField(m_DisplayControlRegister.NIN ? FIELD_PROGRESSIVE : FIELD_UPPER); BeginField(m_DisplayControlRegister.NIN ? FIELD_PROGRESSIVE : FIELD_UPPER);
@ -1180,9 +1175,14 @@ void Update()
if (m_VBeamPos == s_lowerFieldEnd) if (m_VBeamPos == s_lowerFieldEnd)
EndField(); EndField();
m_VBeamPos++; for (int i = 0; i < 4; ++i)
if (m_VBeamPos > s_lineCount) {
m_VBeamPos = 1; if (m_InterruptRegister[i].VCT == m_VBeamPos)
{
m_InterruptRegister[i].IR_INT = 1;
UpdateInterrupts();
}
}
} }
} // namespace } // namespace

View File

@ -580,6 +580,9 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
case PEEK_COLOR: case PEEK_COLOR:
{ {
// TODO: Find some way to test PEEK_COLOR. Wind Waker may be using it
// for pictograph quests.
if (s_MSAASamples > 1) if (s_MSAASamples > 1)
{ {
// Resolve our rectangle. // Resolve our rectangle.
@ -591,12 +594,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
int srcX = (targetPixelRc.left + targetPixelRc.right) / 2; int srcX = (targetPixelRc.left + targetPixelRc.right) / 2;
int srcY = (targetPixelRc.top + targetPixelRc.bottom) / 2; int srcY = (targetPixelRc.top + targetPixelRc.bottom) / 2;
// Read back pixel in BGRA format, then byteswap to get GameCube's
// ARGB format.
u32 color = 0; u32 color = 0;
glReadPixels(srcX, srcY, 1, 1, GL_RGBA, GL_UNSIGNED_INT, &color); glReadPixels(srcX, srcY, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, &color);
GL_REPORT_ERRORD(); GL_REPORT_ERRORD();
// TODO: Find some way to test PEEK_COLOR. return Common::swap32(color);
return color;
} }
case POKE_COLOR: case POKE_COLOR:

View File

@ -376,11 +376,11 @@ void Video_Prepare(void)
VertexLoaderManager::Init(); VertexLoaderManager::Init();
TextureConverter::Init(); TextureConverter::Init();
s_swapRequested = false; s_swapRequested = FALSE;
s_swapResponseEvent.Init(); s_swapResponseEvent.Init();
s_swapResponseEvent.Set(); s_swapResponseEvent.Set();
s_efbAccessRequested = false; s_efbAccessRequested = FALSE;
s_efbResponseEvent.Init(); s_efbResponseEvent.Init();
s_PluginInitialized = true; s_PluginInitialized = true;
@ -455,13 +455,12 @@ void VideoFifo_CheckSwapRequest()
{ {
if (Common::AtomicLoadAcquire(s_swapRequested)) if (Common::AtomicLoadAcquire(s_swapRequested))
{ {
s_swapRequested = FALSE;
Renderer::Swap(s_beginFieldArgs.xfbAddr, s_beginFieldArgs.field, s_beginFieldArgs.fbWidth, s_beginFieldArgs.fbHeight); Renderer::Swap(s_beginFieldArgs.xfbAddr, s_beginFieldArgs.field, s_beginFieldArgs.fbWidth, s_beginFieldArgs.fbHeight);
// TODO: Find better name for this because I don't know if it means what it says. // TODO: Find better name for this because I don't know if it means what it says.
g_VideoInitialize.pCopiedToXFB(); g_VideoInitialize.pCopiedToXFB();
s_swapRequested = FALSE;
s_swapResponseEvent.Set(); s_swapResponseEvent.Set();
} }
} }
@ -514,7 +513,10 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
// Run from the CPU thread (from VideoInterface.cpp) // Run from the CPU thread (from VideoInterface.cpp)
void Video_EndField() void Video_EndField()
{ {
Common::AtomicStoreRelease(s_swapRequested, TRUE); if (s_PluginInitialized)
{
Common::AtomicStoreRelease(s_swapRequested, TRUE);
}
} }
static volatile struct static volatile struct
@ -530,10 +532,9 @@ void VideoFifo_CheckEFBAccess()
{ {
if (Common::AtomicLoadAcquire(s_efbAccessRequested)) if (Common::AtomicLoadAcquire(s_efbAccessRequested))
{ {
s_efbAccessRequested = FALSE;
s_AccessEFBResult = Renderer::AccessEFB(s_accessEFBArgs.type, s_accessEFBArgs.x, s_accessEFBArgs.y); s_AccessEFBResult = Renderer::AccessEFB(s_accessEFBArgs.type, s_accessEFBArgs.x, s_accessEFBArgs.y);
s_efbAccessRequested = FALSE;
s_efbResponseEvent.Set(); s_efbResponseEvent.Set();
} }
} }