mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Fix an issue with BPMEM_LOADTLUT, thanks to revned @ issue 1831, also fix a speed issue int the FIFO loop introduced recently (ZWW was ~20% slower)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4739 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -19,17 +19,12 @@
|
|||||||
#define _DIRECTINPUTBASE_H
|
#define _DIRECTINPUTBASE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Include
|
|
||||||
// -------------------
|
|
||||||
#include <windows.h> // System
|
#include <windows.h> // System
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define DIRECTINPUT_VERSION 0x0800 // DirectInput
|
#define DIRECTINPUT_VERSION 0x0800 // DirectInput
|
||||||
#include <dinput.h>
|
#include <dinput.h>
|
||||||
|
|
||||||
//#include "ConsoleWindow.h" // Common
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DInput
|
class DInput
|
||||||
|
@ -55,7 +55,7 @@ void BPWritten(const BPCmd& bp)
|
|||||||
some bp cases check the changes variable, because they might not have to be updated all the time
|
some bp cases check the changes variable, because they might not have to be updated all the time
|
||||||
NOTE: it seems not all bp cases like checking changes, so calling if (bp.changes == 0 ? false : true)
|
NOTE: it seems not all bp cases like checking changes, so calling if (bp.changes == 0 ? false : true)
|
||||||
had to be ditched and the games seem to work fine with out it.
|
had to be ditched and the games seem to work fine with out it.
|
||||||
NOTE2: Yet Another Gamecube Documentation calls them Bypass Registers but possibly completely wrong
|
NOTE2: Yet Another Gamecube Documentation calls them Bypass Raster State Registers but possibly completely wrong
|
||||||
NOTE3: This controls the register groups: RAS1/2, SU, TF, TEV, C/Z, PEC
|
NOTE3: This controls the register groups: RAS1/2, SU, TF, TEV, C/Z, PEC
|
||||||
TODO: Turn into function table. The (future) DisplayList (DL) jit can then call the functions directly,
|
TODO: Turn into function table. The (future) DisplayList (DL) jit can then call the functions directly,
|
||||||
getting rid of dynamic dispatch. Unfortunately, few games use DLs properly - most\
|
getting rid of dynamic dispatch. Unfortunately, few games use DLs properly - most\
|
||||||
@ -247,8 +247,9 @@ void BPWritten(const BPCmd& bp)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BPMEM_LOADTLUT0: // Load a Texture Look Up Table
|
case BPMEM_LOADTLUT0: // This one updates bpmem.tlutXferSrc, no need to do anything here.
|
||||||
case BPMEM_LOADTLUT1:
|
break;
|
||||||
|
case BPMEM_LOADTLUT1: // Load a Texture Look Up Table
|
||||||
{
|
{
|
||||||
DVSTARTSUBPROFILE("LoadBPReg:GXLoadTlut");
|
DVSTARTSUBPROFILE("LoadBPReg:GXLoadTlut");
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
|
|||||||
while (fifoStateRun)
|
while (fifoStateRun)
|
||||||
{
|
{
|
||||||
video_initialize.pPeekMessages();
|
video_initialize.pPeekMessages();
|
||||||
if (g_ActiveConfig.bEFBAccessEnable)
|
|
||||||
VideoFifo_CheckEFBAccess();
|
VideoFifo_CheckEFBAccess();
|
||||||
VideoFifo_CheckSwapRequest();
|
VideoFifo_CheckSwapRequest();
|
||||||
|
|
||||||
@ -197,12 +197,11 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
|
|||||||
|
|
||||||
CommandProcessor::FifoCriticalLeave();
|
CommandProcessor::FifoCriticalLeave();
|
||||||
|
|
||||||
/*
|
// Those two are pretty important and must be called in the FIFO Loop.
|
||||||
video_initialize.pPeekMessages();
|
// If we don't, s_swapRequested (OGL only) or s_efbAccessRequested won't be set to false
|
||||||
if (g_ActiveConfig.bEFBAccessEnable)
|
// leading the CPU thread to wait in Video_BeginField or Video_AccessEFB thus slowing things down.
|
||||||
VideoFifo_CheckEFBAccess();
|
VideoFifo_CheckEFBAccess();
|
||||||
VideoFifo_CheckSwapRequest();
|
VideoFifo_CheckSwapRequest();
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
Common::AtomicStore(_fifo.CPReadIdle, 1);
|
Common::AtomicStore(_fifo.CPReadIdle, 1);
|
||||||
CommandProcessor::SetFifoIdleFromVideoPlugin();
|
CommandProcessor::SetFifoIdleFromVideoPlugin();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9.00"
|
Version="9,00"
|
||||||
Name="VideoCommon"
|
Name="VideoCommon"
|
||||||
ProjectGUID="{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}"
|
ProjectGUID="{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}"
|
||||||
RootNamespace="VideoCommon"
|
RootNamespace="VideoCommon"
|
||||||
|
@ -630,6 +630,9 @@ void Renderer::SetColorMask()
|
|||||||
|
|
||||||
u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
|
u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
|
||||||
{
|
{
|
||||||
|
if(!g_ActiveConfig.bEFBAccessEnable)
|
||||||
|
return 0;
|
||||||
|
|
||||||
//Get the working buffer
|
//Get the working buffer
|
||||||
LPDIRECT3DSURFACE9 pBuffer = (type == PEEK_Z || type == POKE_Z) ?
|
LPDIRECT3DSURFACE9 pBuffer = (type == PEEK_Z || type == POKE_Z) ?
|
||||||
FBManager::GetEFBDepthRTSurface() : FBManager::GetEFBColorRTSurface();
|
FBManager::GetEFBDepthRTSurface() : FBManager::GetEFBColorRTSurface();
|
||||||
@ -645,10 +648,11 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
|
|||||||
D3DFORMAT ReadBufferFormat = (type == PEEK_Z || type == POKE_Z) ?
|
D3DFORMAT ReadBufferFormat = (type == PEEK_Z || type == POKE_Z) ?
|
||||||
FBManager::GetEFBDepthReadSurfaceFormat() : BufferFormat;
|
FBManager::GetEFBDepthReadSurfaceFormat() : BufferFormat;
|
||||||
|
|
||||||
D3DLOCKED_RECT drect;
|
if(BufferFormat == D3DFMT_D24X8)
|
||||||
if(!g_ActiveConfig.bEFBAccessEnable || BufferFormat == D3DFMT_D24X8)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
D3DLOCKED_RECT drect;
|
||||||
|
|
||||||
//Buffer not found alert
|
//Buffer not found alert
|
||||||
if(!pBuffer) {
|
if(!pBuffer) {
|
||||||
PanicAlert("No %s!", (type == PEEK_Z || type == POKE_Z) ? "Z-Buffer" : "Color EFB");
|
PanicAlert("No %s!", (type == PEEK_Z || type == POKE_Z) ? "Z-Buffer" : "Color EFB");
|
||||||
|
@ -93,8 +93,9 @@ void BPWritten(int address, int newvalue)
|
|||||||
PixelEngine::pereg.boxBottom = newvalue >> 10;
|
PixelEngine::pereg.boxBottom = newvalue >> 10;
|
||||||
PixelEngine::pereg.boxTop = newvalue & 0x3ff;
|
PixelEngine::pereg.boxTop = newvalue & 0x3ff;
|
||||||
break;
|
break;
|
||||||
case BPMEM_LOADTLUT0: // Load a Texture Look Up Table
|
case BPMEM_LOADTLUT0: // This one updates bpmem.tlutXferSrc, no need to do anything here.
|
||||||
case BPMEM_LOADTLUT1:
|
break;
|
||||||
|
case BPMEM_LOADTLUT1: // Load a Texture Look Up Table
|
||||||
{
|
{
|
||||||
u32 tlutTMemAddr = (newvalue & 0x3FF) << 9;
|
u32 tlutTMemAddr = (newvalue & 0x3FF) << 9;
|
||||||
u32 tlutXferCount = (newvalue & 0x1FFC00) >> 5;
|
u32 tlutXferCount = (newvalue & 0x1FFC00) >> 5;
|
||||||
|
Reference in New Issue
Block a user