mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
New SaveState folder for states. Removed some outdated code. Removed an unnecessary level of indirection for plugin calls. Assorted cleanup.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@389 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -526,13 +526,13 @@ void BPWritten(int addr, int changes, int newval)
|
||||
CVertexHandler::Flush();
|
||||
((u32*)&bpmem)[addr] = newval;
|
||||
static int lastRGBA[2][4] = {
|
||||
{0xEEEEEEEE,0xEEEEEEEE,0xEEEEEEEE,0xEEEEEEEE},
|
||||
{0xEEEEEEEE,0xEEEEEEEE,0xEEEEEEEE,0xEEEEEEEE}
|
||||
{0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE},
|
||||
{0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE}
|
||||
};
|
||||
//Terrible hack
|
||||
//The reason is that there are two sets of registers
|
||||
//overloaded here...
|
||||
int num=(addr>>1)&0x3;
|
||||
int num = (addr >> 1) & 0x3;
|
||||
int type = bpmem.tevregs[num].high.type;
|
||||
int colorbase = type ? PS_CONST_KCOLORS : PS_CONST_COLORS;
|
||||
int r=bpmem.tevregs[num].low.a, a=bpmem.tevregs[num].low.b;
|
||||
@ -543,9 +543,9 @@ void BPWritten(int addr, int changes, int newval)
|
||||
CVertexHandler::Flush();
|
||||
lastRGBA[type][num] = rgba;
|
||||
float temp[4] = {
|
||||
r/255.0f,g/255.0f,b/255.0f,a/255.0f
|
||||
r/255.0f, g/255.0f, b/255.0f, a/255.0f
|
||||
};
|
||||
D3D::dev->SetPixelShaderConstantF(colorbase+num,temp,1);
|
||||
D3D::dev->SetPixelShaderConstantF(colorbase + num, temp, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -726,21 +726,6 @@ void BPReload()
|
||||
BPWritten(i, 0xFFFFFF, ((u32*)&bpmem)[i]);
|
||||
}
|
||||
|
||||
|
||||
size_t BPSaveLoadState(char *ptr, BOOL save)
|
||||
{
|
||||
/*
|
||||
BEGINSAVELOAD;
|
||||
SAVELOAD(&bpmem,sizeof(BPMemory));
|
||||
if (!save)
|
||||
BPReload();
|
||||
char temp[256];
|
||||
sprintf(temp,"MOJS %08x",(bpmem.clearcolorAR<<16)|(bpmem.clearcolorGB));
|
||||
g_VideoInitialize.pLog(temp, FALSE);
|
||||
ENDSAVELOAD;*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ActivateTextures()
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "BPMemory.h"
|
||||
|
||||
void BPInit();
|
||||
size_t BPSaveLoadState(char *ptr, BOOL save);
|
||||
//bool BPWritten(int addr, int changes);
|
||||
void LoadBPReg(u32 value0);
|
||||
void ActivateTextures();
|
||||
|
@ -53,23 +53,3 @@ void LoadCPReg(u32 SubCmd, u32 Value)
|
||||
case 0xB0: arraystrides[SubCmd & 0xF] = Value & 0xFF; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define BEGINSAVELOAD char *optr=ptr;
|
||||
#define SAVELOAD(what,size) memcpy((void*)((save)?(void*)(ptr):(void*)(what)),(void*)((save)?(void*)(what):(void*)(ptr)),(size)); ptr+=(size);
|
||||
#define ENDSAVELOAD return ptr-optr;
|
||||
|
||||
size_t CPSaveLoadState(char *ptr, BOOL save)
|
||||
{
|
||||
BEGINSAVELOAD;
|
||||
SAVELOAD(arraybases, 16 * sizeof(u32));
|
||||
SAVELOAD(arraystrides, 16 * sizeof(u32));
|
||||
SAVELOAD(&MatrixIndexA, sizeof(TMatrixIndexA));
|
||||
SAVELOAD(&MatrixIndexB, sizeof(TMatrixIndexB));
|
||||
if (!save)
|
||||
{
|
||||
CPUpdateMatricesA();
|
||||
CPUpdateMatricesB();
|
||||
}
|
||||
ENDSAVELOAD;
|
||||
}
|
@ -7,7 +7,6 @@
|
||||
|
||||
void CPUpdateMatricesA();
|
||||
void CPUpdateMatricesB();
|
||||
size_t CPSaveLoadState(char *ptr, BOOL save);
|
||||
void LoadCPReg(u32 SubCmd, u32 Value);
|
||||
|
||||
#endif
|
||||
|
@ -51,42 +51,44 @@ extern Config g_Config;
|
||||
|
||||
struct Statistics
|
||||
{
|
||||
int numPrimitives;
|
||||
int numPrimitives;
|
||||
|
||||
int numPixelShadersCreated;
|
||||
int numPixelShadersAlive;
|
||||
int numVertexShadersCreated;
|
||||
int numVertexShadersAlive;
|
||||
int numPixelShadersCreated;
|
||||
int numPixelShadersAlive;
|
||||
int numVertexShadersCreated;
|
||||
int numVertexShadersAlive;
|
||||
|
||||
int numTexturesCreated;
|
||||
int numTexturesAlive;
|
||||
int numTexturesCreated;
|
||||
int numTexturesAlive;
|
||||
|
||||
int numRenderTargetsCreated;
|
||||
int numRenderTargetsAlive;
|
||||
|
||||
int numDListsCalled;
|
||||
int numDListsCreated;
|
||||
int numDListsAlive;
|
||||
int numRenderTargetsCreated;
|
||||
int numRenderTargetsAlive;
|
||||
|
||||
int numDListsCalled;
|
||||
int numDListsCreated;
|
||||
int numDListsAlive;
|
||||
|
||||
int numJoins;
|
||||
int numJoins;
|
||||
|
||||
struct ThisFrame
|
||||
{
|
||||
int numBPLoads;
|
||||
int numCPLoads;
|
||||
int numXFLoads;
|
||||
|
||||
int numBPLoadsInDL;
|
||||
int numCPLoadsInDL;
|
||||
int numXFLoadsInDL;
|
||||
|
||||
int numDLs;
|
||||
int numDLPrims;
|
||||
int numPrims;
|
||||
int numShaderChanges;
|
||||
int numBadCommands; //hope this always is zero ;)
|
||||
};
|
||||
ThisFrame thisFrame;
|
||||
struct ThisFrame
|
||||
{
|
||||
int numBPLoads;
|
||||
int numCPLoads;
|
||||
int numXFLoads;
|
||||
|
||||
int numBPLoadsInDL;
|
||||
int numCPLoadsInDL;
|
||||
int numXFLoadsInDL;
|
||||
|
||||
int numDLs;
|
||||
int numDLPrims;
|
||||
int numPrims;
|
||||
int numShaderChanges;
|
||||
int numBadCommands; //hope this always is zero ;)
|
||||
|
||||
int numDListsCalled;
|
||||
};
|
||||
ThisFrame thisFrame;
|
||||
void ResetFrame() {memset(&thisFrame,0,sizeof(ThisFrame));}
|
||||
};
|
||||
|
||||
|
@ -55,23 +55,24 @@ void ExecuteDisplayList(u32 address, u32 size)
|
||||
g_pDataReader = &memoryReader;
|
||||
|
||||
// temporarily swap dl and non-dl(small "hack" for the stats)
|
||||
Xchg(stats.thisFrame.numDLPrims,stats.thisFrame.numPrims);
|
||||
Xchg(stats.thisFrame.numXFLoadsInDL,stats.thisFrame.numXFLoads);
|
||||
Xchg(stats.thisFrame.numCPLoadsInDL,stats.thisFrame.numCPLoads);
|
||||
Xchg(stats.thisFrame.numBPLoadsInDL,stats.thisFrame.numBPLoads);
|
||||
Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
|
||||
Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
|
||||
Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
|
||||
Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
|
||||
|
||||
while((memoryReader.GetReadAddress() - address) < size)
|
||||
{
|
||||
Decode();
|
||||
}
|
||||
INCSTAT(stats.numDListsCalled);
|
||||
INCSTAT(stats.thisFrame.numDListsCalled);
|
||||
|
||||
// un-swap
|
||||
Xchg(stats.thisFrame.numDLPrims,stats.thisFrame.numPrims);
|
||||
Xchg(stats.thisFrame.numXFLoadsInDL,stats.thisFrame.numXFLoads);
|
||||
Xchg(stats.thisFrame.numCPLoadsInDL,stats.thisFrame.numCPLoads);
|
||||
Xchg(stats.thisFrame.numBPLoadsInDL,stats.thisFrame.numBPLoads);
|
||||
Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
|
||||
Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
|
||||
Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
|
||||
Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
|
||||
|
||||
INCSTAT(stats.numDListsCalled);
|
||||
// reset to the old reader
|
||||
g_pDataReader = pOldReader;
|
||||
}
|
||||
|
@ -16,15 +16,6 @@ float *CTransformEngine::m_pNormalMatrix;
|
||||
float *CTransformEngine::m_pTexMatrix[8];
|
||||
float *CTransformEngine::m_pTexPostMatrix[8];
|
||||
|
||||
size_t CTransformEngine::SaveLoadState(char *ptr, bool save)
|
||||
{
|
||||
// BEGINSAVELOAD;
|
||||
// SAVELOAD(m_VtxAttribTable,sizeof(m_VtxAttribTable));
|
||||
// SAVELOAD(&m_VtxDesc,sizeof(TVtxDesc));
|
||||
// ENDSAVELOAD;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const Light *GetLight(int i)
|
||||
{
|
||||
return (const Light *)(xfmem + XFMEM_LIGHTS) + i;
|
||||
@ -345,4 +336,4 @@ void CTransformEngine::TransformVertices(int _numVertices, const DecodedVArray *
|
||||
vbuffer[i].uv[j].w = TempUVs[j].z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ class CTransformEngine
|
||||
static float* m_pTexPostMatrix[8];
|
||||
|
||||
public:
|
||||
static size_t SaveLoadState(char *ptr, bool save);
|
||||
static void TransformVertices(int _numVertices,
|
||||
const DecodedVArray *varray,
|
||||
D3DVertex *vbuffer);
|
||||
|
@ -8,13 +8,7 @@
|
||||
float rawViewPort[6];
|
||||
float rawProjection[7];
|
||||
|
||||
#define BEGINSAVELOAD char *optr=ptr;
|
||||
#define SAVELOAD(what,size) memcpy((void*)((save)?(void*)(ptr):(void*)(what)),(void*)((save)?(void*)(what):(void*)(ptr)),(size)); ptr+=(size);
|
||||
#define ENDSAVELOAD return ptr-optr;
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// LoadXFReg 0x10
|
||||
//
|
||||
void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
|
||||
{
|
||||
DVSTARTPROFILE();
|
||||
@ -30,7 +24,7 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
|
||||
memcpy(p1, &pData[i], transferSize*4);
|
||||
i += transferSize;
|
||||
}
|
||||
else if (address<0x2000)
|
||||
else if (address < 0x2000)
|
||||
{
|
||||
u32 data = pData[i];
|
||||
switch (address)
|
||||
@ -120,25 +114,8 @@ void XFUpdateVP()
|
||||
{
|
||||
Renderer::SetViewport(rawViewPort);
|
||||
}
|
||||
|
||||
void XFUpdatePJ()
|
||||
{
|
||||
Renderer::SetProjection(rawProjection,0);
|
||||
Renderer::SetProjection(rawProjection, 0);
|
||||
}
|
||||
|
||||
size_t XFSaveLoadState(char *ptr, BOOL save)
|
||||
{
|
||||
BEGINSAVELOAD;
|
||||
SAVELOAD(xfregs.colChans,2*sizeof(ColorChannel));
|
||||
SAVELOAD(xfregs.texcoords,16*sizeof(TexCoordInfo));
|
||||
SAVELOAD(rawViewPort,sizeof(rawViewPort));
|
||||
SAVELOAD(rawProjection,sizeof(rawProjection));
|
||||
SAVELOAD(xfmem,XFMEM_SIZE*sizeof(u32));
|
||||
|
||||
if (!save)
|
||||
{
|
||||
XFUpdateVP();
|
||||
XFUpdatePJ();
|
||||
}
|
||||
|
||||
ENDSAVELOAD;
|
||||
}
|
@ -8,7 +8,6 @@
|
||||
extern float rawViewPort[6];
|
||||
extern float rawProjection[7];
|
||||
|
||||
size_t XFSaveLoadState(char *ptr, BOOL save);
|
||||
void XFUpdateVP();
|
||||
void XFUpdatePJ();
|
||||
void LoadXFReg(u32 transferSize, u32 address, u32 *pData);
|
||||
|
Reference in New Issue
Block a user