THIS BREAKS THE D3D PLUGIN FOR THE NEAR TERM. Resurrect an old patch that moves D3D over to the common shader generator framework. Needs a lot more work.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2484 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-02-28 22:10:38 +00:00
parent ee44b2a639
commit ecbfec2a13
49 changed files with 1087 additions and 4262 deletions

View File

@ -22,3 +22,42 @@
//BP state
// STATE_TO_SAVE
BPMemory bpmem;
// The plugin must implement this.
void BPWritten(int addr, int changes, int newval);
// Call browser: OpcodeDecoding.cpp ExecuteDisplayList > Decode() > LoadBPReg()
void LoadBPReg(u32 value0)
{
//handle the mask register
int opcode = value0 >> 24;
int oldval = ((u32*)&bpmem)[opcode];
int newval = (oldval & ~bpmem.bpMask) | (value0 & bpmem.bpMask);
int changes = (oldval ^ newval) & 0xFFFFFF;
//reset the mask register
if (opcode != 0xFE)
bpmem.bpMask = 0xFFFFFF;
BPWritten(opcode, changes, newval);
}
// Called when loading a saved state.
// Needs more testing though.
void BPReload()
{
for (int i = 0; i < 254; i++)
{
switch (i) {
case 0x41:
case 0x45: //GXSetDrawDone
case 0x52:
case 0x65:
case 0x67: // set gp metric?
case BPMEM_PE_TOKEN_ID:
case BPMEM_PE_TOKEN_INT_ID:
// Cases in which we DON'T want to reload the BP
continue;
default:
BPWritten(i, 0xFFFFFF, ((u32*)&bpmem)[i]);
}
}
}