Fix GXPeekARGB, this fixes Killer 7, and Wind Waker's pictograph quest :D

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4034 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
sl1nk3.s 2009-08-22 13:22:35 +00:00
parent f7bee7347a
commit 652639d1c4
3 changed files with 21 additions and 16 deletions

View File

@ -18,17 +18,15 @@
#ifndef _MEMMAP_H
#define _MEMMAP_H
// Enable memory checks in the Debug/DebugFast builds, but NOT in release
#if MAX_LOGLEVEL >= 4
#if _DEBUG
#define ENABLE_MEM_CHECK
#endif
#endif
// Includes
#include <string>
#include "Common.h"
// Enable memory checks in the Debug/DebugFast builds, but NOT in release
#if _DEBUG || DEBUGFAST
#define ENABLE_MEM_CHECK
#endif
// Global declarations
class PointerWrap;

View File

@ -190,8 +190,12 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
case 0x1016:
case 0x1017:
case 0x101c: // paper mario writes 16777216.0f, 1677721.75
case 0x101f: // paper mario writes 16777216.0f, 5033165.0f
case 0x101c:
// paper mario writes 16777216.0f, 1677721.75
// Killer 7 writes 0x4b800000 here on 3D rendering only
case 0x101f:
// paper mario writes 16777216.0f, 5033165.0f
// Killer 7 alterns this between 0x4b800000 and 0x4b7ef9db on 3D rendering
default:
WARN_LOG(VIDEO, "Unknown XF Reg: %x=%x\n", address, data);
break;

View File

@ -564,6 +564,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
TargetRectangle targetPixelRc = Renderer::ConvertEFBRectangle(efbPixelRc);
// TODO (FIX) : currently, AA path is broken/offset and doesn't return the correct pixel
switch (type)
{
@ -593,10 +594,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
// TODO: Implement
break;
case PEEK_COLOR:
case PEEK_COLOR: // GXPeekARGB
{
// TODO: Find some way to test PEEK_COLOR. Wind Waker may be using it
// for pictograph quests.
// Although it may sound strange, this really is A8R8G8B8 and not RGBA or 24-bit...
// Tested in Killer 7, the first 8bits represent the alpha value which is used to
// determine if we're aiming at an enemy (0x80 / 0x88) or not (0x70)
// Wind Waker is also using it for the pictograph to determine the color of each pixel
if (s_MSAASamples > 1)
{
@ -609,13 +613,12 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
int srcX = (targetPixelRc.left + targetPixelRc.right) / 2;
int srcY = (targetPixelRc.top + targetPixelRc.bottom) / 2;
// Read back pixel in BGRA format, then byteswap to get GameCube's
// ARGB format.
// Read back pixel in BGRA format, then byteswap to get GameCube's ARGB Format.
u32 color = 0;
glReadPixels(srcX, srcY, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, &color);
glReadPixels(srcX, srcY, 1, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, &color);
GL_REPORT_ERRORD();
return Common::swap32(color);
return color;
}
case POKE_COLOR: