mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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:
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user