mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Fix scons build.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7415 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@@ -52,6 +52,12 @@ files = [
|
||||
'Src/Debugger/Debugger_SymbolMap.cpp',
|
||||
'Src/Debugger/Dump.cpp',
|
||||
'Src/Debugger/PPCDebugInterface.cpp',
|
||||
'Src/FifoPlayer/FifoAnalyzer.cpp',
|
||||
'Src/FifoPlayer/FifoDataFile.cpp',
|
||||
'Src/FifoPlayer/FifoPlaybackAnalyzer.cpp',
|
||||
'Src/FifoPlayer/FifoPlayer.cpp',
|
||||
'Src/FifoPlayer/FifoRecordAnalyzer.cpp',
|
||||
'Src/FifoPlayer/FifoRecorder.cpp',
|
||||
'Src/GeckoCode.cpp',
|
||||
'Src/GeckoCodeConfig.cpp',
|
||||
'Src/HLE/HLE.cpp',
|
||||
|
||||
@@ -1,235 +1,235 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "FifoAnalyzer.h"
|
||||
|
||||
#include "Core.h"
|
||||
|
||||
#include "VertexLoader.h"
|
||||
#include "VertexLoader_Position.h"
|
||||
#include "VertexLoader_Normal.h"
|
||||
#include "VertexLoader_TextCoord.h"
|
||||
|
||||
namespace FifoAnalyzer
|
||||
{
|
||||
|
||||
void Init()
|
||||
{
|
||||
VertexLoader_Normal::Init();
|
||||
VertexLoader_Position::Init();
|
||||
VertexLoader_TextCoord::Init();
|
||||
}
|
||||
|
||||
u8 ReadFifo8(u8 *&data)
|
||||
{
|
||||
u8 value = data[0];
|
||||
data += 1;
|
||||
return value;
|
||||
}
|
||||
|
||||
u16 ReadFifo16(u8 *&data)
|
||||
{
|
||||
u16 value = Common::swap16(data);
|
||||
data += 2;
|
||||
return value;
|
||||
}
|
||||
|
||||
u32 ReadFifo32(u8 *&data)
|
||||
{
|
||||
u32 value = Common::swap32(data);
|
||||
data += 4;
|
||||
return value;
|
||||
}
|
||||
|
||||
void InitBPMemory(BPMemory *bpMem)
|
||||
{
|
||||
memset(bpMem, 0, sizeof(BPMemory));
|
||||
bpMem->bpMask = 0x00FFFFFF;
|
||||
}
|
||||
|
||||
BPCmd DecodeBPCmd(u32 value, const BPMemory &bpMem)
|
||||
{
|
||||
//handle the mask register
|
||||
int opcode = value >> 24;
|
||||
int oldval = ((u32*)&bpMem)[opcode];
|
||||
int newval = (oldval & ~bpMem.bpMask) | (value & bpMem.bpMask);
|
||||
int changes = (oldval ^ newval) & 0xFFFFFF;
|
||||
|
||||
BPCmd bp = {opcode, changes, newval};
|
||||
|
||||
return bp;
|
||||
}
|
||||
|
||||
void LoadBPReg(const BPCmd &bp, BPMemory &bpMem)
|
||||
{
|
||||
((u32*)&bpMem)[bp.address] = bp.newvalue;
|
||||
|
||||
//reset the mask register
|
||||
if (bp.address != 0xFE)
|
||||
bpMem.bpMask = 0xFFFFFF;
|
||||
}
|
||||
|
||||
void GetTlutLoadData(u32 &tlutAddr, u32 &memAddr, u32 &tlutXferCount, BPMemory &bpMem)
|
||||
{
|
||||
tlutAddr = (bpMem.tlutXferDest & 0x3FF) << 9;
|
||||
tlutXferCount = (bpMem.tlutXferDest & 0x1FFC00) >> 5;
|
||||
|
||||
// TODO - figure out a cleaner way.
|
||||
if (Core::g_CoreStartupParameter.bWii)
|
||||
memAddr = bpmem.tlutXferSrc << 5;
|
||||
else
|
||||
memAddr = (bpmem.tlutXferSrc & 0xFFFFF) << 5;
|
||||
}
|
||||
|
||||
void LoadCPReg(u32 subCmd, u32 value, CPMemory &cpMem)
|
||||
{
|
||||
switch (subCmd & 0xF0)
|
||||
{
|
||||
case 0x50:
|
||||
cpMem.vtxDesc.Hex &= ~0x1FFFF; // keep the Upper bits
|
||||
cpMem.vtxDesc.Hex |= value;
|
||||
break;
|
||||
|
||||
case 0x60:
|
||||
cpMem.vtxDesc.Hex &= 0x1FFFF; // keep the lower 17Bits
|
||||
cpMem.vtxDesc.Hex |= (u64)value << 17;
|
||||
break;
|
||||
|
||||
case 0x70:
|
||||
_assert_((subCmd & 0x0F) < 8);
|
||||
cpMem.vtxAttr[subCmd & 7].g0.Hex = value;
|
||||
break;
|
||||
|
||||
case 0x80:
|
||||
_assert_((subCmd & 0x0F) < 8);
|
||||
cpMem.vtxAttr[subCmd & 7].g1.Hex = value;
|
||||
break;
|
||||
|
||||
case 0x90:
|
||||
_assert_((subCmd & 0x0F) < 8);
|
||||
cpMem.vtxAttr[subCmd & 7].g2.Hex = value;
|
||||
break;
|
||||
|
||||
case 0xA0:
|
||||
cpMem.arrayBases[subCmd & 0xF] = value;
|
||||
break;
|
||||
|
||||
case 0xB0:
|
||||
cpMem.arrayStrides[subCmd & 0xF] = value & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
u32 CalculateVertexSize(int vatIndex, const CPMemory &cpMem)
|
||||
{
|
||||
u32 vertexSize = 0;
|
||||
|
||||
int sizes[21];
|
||||
CalculateVertexElementSizes(sizes, vatIndex, cpMem);
|
||||
|
||||
for (int i = 0; i < 21; ++i)
|
||||
vertexSize += sizes[i];
|
||||
|
||||
return vertexSize;
|
||||
}
|
||||
|
||||
void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory &cpMem)
|
||||
{
|
||||
const TVtxDesc &vtxDesc = cpMem.vtxDesc;
|
||||
const VAT &vtxAttr = cpMem.vtxAttr[vatIndex];
|
||||
|
||||
// Colors
|
||||
const int colDesc[2] = {vtxDesc.Color0, vtxDesc.Color1};
|
||||
const int colComp[2] = {vtxAttr.g0.Color0Comp, vtxAttr.g0.Color1Comp};
|
||||
|
||||
const int tcElements[8] =
|
||||
{
|
||||
vtxAttr.g0.Tex0CoordElements, vtxAttr.g1.Tex1CoordElements, vtxAttr.g1.Tex2CoordElements,
|
||||
vtxAttr.g1.Tex3CoordElements, vtxAttr.g1.Tex4CoordElements, vtxAttr.g2.Tex5CoordElements,
|
||||
vtxAttr.g2.Tex6CoordElements, vtxAttr.g2.Tex7CoordElements
|
||||
};
|
||||
|
||||
const int tcFormat[8] =
|
||||
{
|
||||
vtxAttr.g0.Tex0CoordFormat, vtxAttr.g1.Tex1CoordFormat, vtxAttr.g1.Tex2CoordFormat,
|
||||
vtxAttr.g1.Tex3CoordFormat, vtxAttr.g1.Tex4CoordFormat, vtxAttr.g2.Tex5CoordFormat,
|
||||
vtxAttr.g2.Tex6CoordFormat, vtxAttr.g2.Tex7CoordFormat
|
||||
};
|
||||
|
||||
// Add position and texture matrix indices
|
||||
u64 vtxDescHex = cpMem.vtxDesc.Hex;
|
||||
for (int i = 0; i < 9; ++i)
|
||||
{
|
||||
sizes[i] = vtxDescHex & 1;
|
||||
vtxDescHex >>= 1;
|
||||
}
|
||||
|
||||
// Position
|
||||
sizes[9] = VertexLoader_Position::GetSize(vtxDesc.Position, vtxAttr.g0.PosFormat, vtxAttr.g0.PosElements);
|
||||
|
||||
// Normals
|
||||
if (vtxDesc.Normal != NOT_PRESENT)
|
||||
{
|
||||
sizes[10] = VertexLoader_Normal::GetSize(vtxDesc.Normal, vtxAttr.g0.NormalFormat, vtxAttr.g0.NormalElements, vtxAttr.g0.NormalIndex3);
|
||||
}
|
||||
else
|
||||
{
|
||||
sizes[10] = 0;
|
||||
}
|
||||
|
||||
// Colors
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
switch (colDesc[i])
|
||||
{
|
||||
case NOT_PRESENT:
|
||||
break;
|
||||
case DIRECT:
|
||||
switch (colComp[i])
|
||||
{
|
||||
case FORMAT_16B_565: size = 2; break;
|
||||
case FORMAT_24B_888: size = 3; break;
|
||||
case FORMAT_32B_888x: size = 4; break;
|
||||
case FORMAT_16B_4444: size = 2; break;
|
||||
case FORMAT_24B_6666: size = 3; break;
|
||||
case FORMAT_32B_8888: size = 4; break;
|
||||
default: _assert_(0); break;
|
||||
}
|
||||
break;
|
||||
case INDEX8:
|
||||
size = 1;
|
||||
break;
|
||||
case INDEX16:
|
||||
size = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
sizes[11 + i] = size;
|
||||
}
|
||||
|
||||
// Texture coordinates
|
||||
vtxDescHex = vtxDesc.Hex >> 17;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
sizes[13 + i] = VertexLoader_TextCoord::GetSize(vtxDescHex & 3, tcFormat[i], tcElements[i]);
|
||||
vtxDescHex >>= 2;
|
||||
}
|
||||
}
|
||||
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "FifoAnalyzer.h"
|
||||
|
||||
#include "Core.h"
|
||||
|
||||
#include "VertexLoader.h"
|
||||
#include "VertexLoader_Position.h"
|
||||
#include "VertexLoader_Normal.h"
|
||||
#include "VertexLoader_TextCoord.h"
|
||||
|
||||
namespace FifoAnalyzer
|
||||
{
|
||||
|
||||
void Init()
|
||||
{
|
||||
VertexLoader_Normal::Init();
|
||||
VertexLoader_Position::Init();
|
||||
VertexLoader_TextCoord::Init();
|
||||
}
|
||||
|
||||
u8 ReadFifo8(u8 *&data)
|
||||
{
|
||||
u8 value = data[0];
|
||||
data += 1;
|
||||
return value;
|
||||
}
|
||||
|
||||
u16 ReadFifo16(u8 *&data)
|
||||
{
|
||||
u16 value = Common::swap16(data);
|
||||
data += 2;
|
||||
return value;
|
||||
}
|
||||
|
||||
u32 ReadFifo32(u8 *&data)
|
||||
{
|
||||
u32 value = Common::swap32(data);
|
||||
data += 4;
|
||||
return value;
|
||||
}
|
||||
|
||||
void InitBPMemory(BPMemory *bpMem)
|
||||
{
|
||||
memset(bpMem, 0, sizeof(BPMemory));
|
||||
bpMem->bpMask = 0x00FFFFFF;
|
||||
}
|
||||
|
||||
BPCmd DecodeBPCmd(u32 value, const BPMemory &bpMem)
|
||||
{
|
||||
//handle the mask register
|
||||
int opcode = value >> 24;
|
||||
int oldval = ((u32*)&bpMem)[opcode];
|
||||
int newval = (oldval & ~bpMem.bpMask) | (value & bpMem.bpMask);
|
||||
int changes = (oldval ^ newval) & 0xFFFFFF;
|
||||
|
||||
BPCmd bp = {opcode, changes, newval};
|
||||
|
||||
return bp;
|
||||
}
|
||||
|
||||
void LoadBPReg(const BPCmd &bp, BPMemory &bpMem)
|
||||
{
|
||||
((u32*)&bpMem)[bp.address] = bp.newvalue;
|
||||
|
||||
//reset the mask register
|
||||
if (bp.address != 0xFE)
|
||||
bpMem.bpMask = 0xFFFFFF;
|
||||
}
|
||||
|
||||
void GetTlutLoadData(u32 &tlutAddr, u32 &memAddr, u32 &tlutXferCount, BPMemory &bpMem)
|
||||
{
|
||||
tlutAddr = (bpMem.tlutXferDest & 0x3FF) << 9;
|
||||
tlutXferCount = (bpMem.tlutXferDest & 0x1FFC00) >> 5;
|
||||
|
||||
// TODO - figure out a cleaner way.
|
||||
if (Core::g_CoreStartupParameter.bWii)
|
||||
memAddr = bpmem.tlutXferSrc << 5;
|
||||
else
|
||||
memAddr = (bpmem.tlutXferSrc & 0xFFFFF) << 5;
|
||||
}
|
||||
|
||||
void LoadCPReg(u32 subCmd, u32 value, CPMemory &cpMem)
|
||||
{
|
||||
switch (subCmd & 0xF0)
|
||||
{
|
||||
case 0x50:
|
||||
cpMem.vtxDesc.Hex &= ~0x1FFFF; // keep the Upper bits
|
||||
cpMem.vtxDesc.Hex |= value;
|
||||
break;
|
||||
|
||||
case 0x60:
|
||||
cpMem.vtxDesc.Hex &= 0x1FFFF; // keep the lower 17Bits
|
||||
cpMem.vtxDesc.Hex |= (u64)value << 17;
|
||||
break;
|
||||
|
||||
case 0x70:
|
||||
_assert_((subCmd & 0x0F) < 8);
|
||||
cpMem.vtxAttr[subCmd & 7].g0.Hex = value;
|
||||
break;
|
||||
|
||||
case 0x80:
|
||||
_assert_((subCmd & 0x0F) < 8);
|
||||
cpMem.vtxAttr[subCmd & 7].g1.Hex = value;
|
||||
break;
|
||||
|
||||
case 0x90:
|
||||
_assert_((subCmd & 0x0F) < 8);
|
||||
cpMem.vtxAttr[subCmd & 7].g2.Hex = value;
|
||||
break;
|
||||
|
||||
case 0xA0:
|
||||
cpMem.arrayBases[subCmd & 0xF] = value;
|
||||
break;
|
||||
|
||||
case 0xB0:
|
||||
cpMem.arrayStrides[subCmd & 0xF] = value & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
u32 CalculateVertexSize(int vatIndex, const CPMemory &cpMem)
|
||||
{
|
||||
u32 vertexSize = 0;
|
||||
|
||||
int sizes[21];
|
||||
CalculateVertexElementSizes(sizes, vatIndex, cpMem);
|
||||
|
||||
for (int i = 0; i < 21; ++i)
|
||||
vertexSize += sizes[i];
|
||||
|
||||
return vertexSize;
|
||||
}
|
||||
|
||||
void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory &cpMem)
|
||||
{
|
||||
const TVtxDesc &vtxDesc = cpMem.vtxDesc;
|
||||
const VAT &vtxAttr = cpMem.vtxAttr[vatIndex];
|
||||
|
||||
// Colors
|
||||
const int colDesc[2] = {vtxDesc.Color0, vtxDesc.Color1};
|
||||
const int colComp[2] = {vtxAttr.g0.Color0Comp, vtxAttr.g0.Color1Comp};
|
||||
|
||||
const int tcElements[8] =
|
||||
{
|
||||
vtxAttr.g0.Tex0CoordElements, vtxAttr.g1.Tex1CoordElements, vtxAttr.g1.Tex2CoordElements,
|
||||
vtxAttr.g1.Tex3CoordElements, vtxAttr.g1.Tex4CoordElements, vtxAttr.g2.Tex5CoordElements,
|
||||
vtxAttr.g2.Tex6CoordElements, vtxAttr.g2.Tex7CoordElements
|
||||
};
|
||||
|
||||
const int tcFormat[8] =
|
||||
{
|
||||
vtxAttr.g0.Tex0CoordFormat, vtxAttr.g1.Tex1CoordFormat, vtxAttr.g1.Tex2CoordFormat,
|
||||
vtxAttr.g1.Tex3CoordFormat, vtxAttr.g1.Tex4CoordFormat, vtxAttr.g2.Tex5CoordFormat,
|
||||
vtxAttr.g2.Tex6CoordFormat, vtxAttr.g2.Tex7CoordFormat
|
||||
};
|
||||
|
||||
// Add position and texture matrix indices
|
||||
u64 vtxDescHex = cpMem.vtxDesc.Hex;
|
||||
for (int i = 0; i < 9; ++i)
|
||||
{
|
||||
sizes[i] = vtxDescHex & 1;
|
||||
vtxDescHex >>= 1;
|
||||
}
|
||||
|
||||
// Position
|
||||
sizes[9] = VertexLoader_Position::GetSize(vtxDesc.Position, vtxAttr.g0.PosFormat, vtxAttr.g0.PosElements);
|
||||
|
||||
// Normals
|
||||
if (vtxDesc.Normal != NOT_PRESENT)
|
||||
{
|
||||
sizes[10] = VertexLoader_Normal::GetSize(vtxDesc.Normal, vtxAttr.g0.NormalFormat, vtxAttr.g0.NormalElements, vtxAttr.g0.NormalIndex3);
|
||||
}
|
||||
else
|
||||
{
|
||||
sizes[10] = 0;
|
||||
}
|
||||
|
||||
// Colors
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
switch (colDesc[i])
|
||||
{
|
||||
case NOT_PRESENT:
|
||||
break;
|
||||
case DIRECT:
|
||||
switch (colComp[i])
|
||||
{
|
||||
case FORMAT_16B_565: size = 2; break;
|
||||
case FORMAT_24B_888: size = 3; break;
|
||||
case FORMAT_32B_888x: size = 4; break;
|
||||
case FORMAT_16B_4444: size = 2; break;
|
||||
case FORMAT_24B_6666: size = 3; break;
|
||||
case FORMAT_32B_8888: size = 4; break;
|
||||
default: _assert_(0); break;
|
||||
}
|
||||
break;
|
||||
case INDEX8:
|
||||
size = 1;
|
||||
break;
|
||||
case INDEX16:
|
||||
size = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
sizes[11 + i] = size;
|
||||
}
|
||||
|
||||
// Texture coordinates
|
||||
vtxDescHex = vtxDesc.Hex >> 17;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
sizes[13 + i] = VertexLoader_TextCoord::GetSize(vtxDescHex & 3, tcFormat[i], tcElements[i]);
|
||||
vtxDescHex >>= 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +1,54 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FIFOANALYZER_H
|
||||
#define _FIFOANALYZER_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include "BPMemory.h"
|
||||
#include "CPMemory.h"
|
||||
|
||||
namespace FifoAnalyzer
|
||||
{
|
||||
void Init();
|
||||
|
||||
u8 ReadFifo8(u8 *&data);
|
||||
u16 ReadFifo16(u8 *&data);
|
||||
u32 ReadFifo32(u8 *&data);
|
||||
|
||||
// TODO- move to video common
|
||||
void InitBPMemory(BPMemory *bpMem);
|
||||
BPCmd DecodeBPCmd(u32 value, const BPMemory &bpMem);
|
||||
void LoadBPReg(const BPCmd &bp, BPMemory &bpMem);
|
||||
void GetTlutLoadData(u32 &tlutAddr, u32 &memAddr, u32 &tlutXferCount, BPMemory &bpMem);
|
||||
|
||||
struct CPMemory
|
||||
{
|
||||
TVtxDesc vtxDesc;
|
||||
VAT vtxAttr[8];
|
||||
u32 arrayBases[16];
|
||||
u32 arrayStrides[16];
|
||||
};
|
||||
|
||||
void LoadCPReg(u32 subCmd, u32 value, CPMemory &cpMem);
|
||||
|
||||
u32 CalculateVertexSize(int vatIndex, const CPMemory &cpMem);
|
||||
void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory &cpMem);
|
||||
}
|
||||
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FIFOANALYZER_H
|
||||
#define _FIFOANALYZER_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include "BPMemory.h"
|
||||
#include "CPMemory.h"
|
||||
|
||||
namespace FifoAnalyzer
|
||||
{
|
||||
void Init();
|
||||
|
||||
u8 ReadFifo8(u8 *&data);
|
||||
u16 ReadFifo16(u8 *&data);
|
||||
u32 ReadFifo32(u8 *&data);
|
||||
|
||||
// TODO- move to video common
|
||||
void InitBPMemory(BPMemory *bpMem);
|
||||
BPCmd DecodeBPCmd(u32 value, const BPMemory &bpMem);
|
||||
void LoadBPReg(const BPCmd &bp, BPMemory &bpMem);
|
||||
void GetTlutLoadData(u32 &tlutAddr, u32 &memAddr, u32 &tlutXferCount, BPMemory &bpMem);
|
||||
|
||||
struct CPMemory
|
||||
{
|
||||
TVtxDesc vtxDesc;
|
||||
VAT vtxAttr[8];
|
||||
u32 arrayBases[16];
|
||||
u32 arrayStrides[16];
|
||||
};
|
||||
|
||||
void LoadCPReg(u32 subCmd, u32 value, CPMemory &cpMem);
|
||||
|
||||
u32 CalculateVertexSize(int vatIndex, const CPMemory &cpMem);
|
||||
void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory &cpMem);
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,64 +1,64 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FIFOPLAYBACKANALYZER_H_
|
||||
#define _FIFOPLAYBACKANALYZER_H_
|
||||
|
||||
#include "FifoAnalyzer.h"
|
||||
#include "FifoDataFile.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct AnalyzedFrameInfo
|
||||
{
|
||||
std::vector<u32> objectStarts;
|
||||
std::vector<u32> objectEnds;
|
||||
std::vector<MemoryUpdate> memoryUpdates;
|
||||
};
|
||||
|
||||
class FifoPlaybackAnalyzer
|
||||
{
|
||||
public:
|
||||
FifoPlaybackAnalyzer();
|
||||
|
||||
void AnalyzeFrames(FifoDataFile *file, std::vector<AnalyzedFrameInfo> &frameInfo);
|
||||
|
||||
private:
|
||||
struct MemoryRange
|
||||
{
|
||||
u32 begin;
|
||||
u32 end;
|
||||
};
|
||||
|
||||
void AddMemoryUpdate(MemoryUpdate memUpdate, AnalyzedFrameInfo &frameInfo);
|
||||
|
||||
u32 DecodeCommand(u8 *data);
|
||||
void LoadBP(u32 value0);
|
||||
|
||||
void StoreEfbCopyRegion();
|
||||
void StoreWrittenRegion(u32 address, u32 size);
|
||||
|
||||
bool m_DrawingObject;
|
||||
|
||||
std::vector<MemoryRange> m_WrittenMemory;
|
||||
|
||||
BPMemory m_BpMem;
|
||||
FifoAnalyzer::CPMemory m_CpMem;
|
||||
};
|
||||
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FIFOPLAYBACKANALYZER_H_
|
||||
#define _FIFOPLAYBACKANALYZER_H_
|
||||
|
||||
#include "FifoAnalyzer.h"
|
||||
#include "FifoDataFile.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct AnalyzedFrameInfo
|
||||
{
|
||||
std::vector<u32> objectStarts;
|
||||
std::vector<u32> objectEnds;
|
||||
std::vector<MemoryUpdate> memoryUpdates;
|
||||
};
|
||||
|
||||
class FifoPlaybackAnalyzer
|
||||
{
|
||||
public:
|
||||
FifoPlaybackAnalyzer();
|
||||
|
||||
void AnalyzeFrames(FifoDataFile *file, std::vector<AnalyzedFrameInfo> &frameInfo);
|
||||
|
||||
private:
|
||||
struct MemoryRange
|
||||
{
|
||||
u32 begin;
|
||||
u32 end;
|
||||
};
|
||||
|
||||
void AddMemoryUpdate(MemoryUpdate memUpdate, AnalyzedFrameInfo &frameInfo);
|
||||
|
||||
u32 DecodeCommand(u8 *data);
|
||||
void LoadBP(u32 value0);
|
||||
|
||||
void StoreEfbCopyRegion();
|
||||
void StoreWrittenRegion(u32 address, u32 size);
|
||||
|
||||
bool m_DrawingObject;
|
||||
|
||||
std::vector<MemoryRange> m_WrittenMemory;
|
||||
|
||||
BPMemory m_BpMem;
|
||||
FifoAnalyzer::CPMemory m_CpMem;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,56 +1,56 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FIFORECORDANALYZER_H_
|
||||
#define _FIFORECORDANALYZER_H_
|
||||
|
||||
#include "FifoAnalyzer.h"
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include "BPMemory.h"
|
||||
|
||||
class FifoRecordAnalyzer
|
||||
{
|
||||
public:
|
||||
FifoRecordAnalyzer();
|
||||
|
||||
// Must call this before analyzing GP commands
|
||||
void Initialize(u32 *bpMem, u32 *cpMem);
|
||||
|
||||
// Assumes data contains all information for the command
|
||||
// Calls FifoRecorder::WriteMemory
|
||||
void AnalyzeGPCommand(u8 *data);
|
||||
|
||||
private:
|
||||
void DecodeOpcode(u8 *data);
|
||||
|
||||
void ProcessLoadTlut1();
|
||||
void ProcessLoadIndexedXf(u32 val, int array);
|
||||
void ProcessVertexArrays(u8 *data, u8 vtxAttrGroup);
|
||||
void ProcessTexMaps();
|
||||
|
||||
void WriteVertexArray(int arrayIndex, u8 *vertexData, int vertexSize, int numVertices);
|
||||
void WriteTexMapMemory(int texMap, u32 &writtenTexMaps);
|
||||
|
||||
bool m_DrawingObject;
|
||||
|
||||
BPMemory *m_BpMem;
|
||||
FifoAnalyzer::CPMemory m_CpMem;
|
||||
};
|
||||
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FIFORECORDANALYZER_H_
|
||||
#define _FIFORECORDANALYZER_H_
|
||||
|
||||
#include "FifoAnalyzer.h"
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include "BPMemory.h"
|
||||
|
||||
class FifoRecordAnalyzer
|
||||
{
|
||||
public:
|
||||
FifoRecordAnalyzer();
|
||||
|
||||
// Must call this before analyzing GP commands
|
||||
void Initialize(u32 *bpMem, u32 *cpMem);
|
||||
|
||||
// Assumes data contains all information for the command
|
||||
// Calls FifoRecorder::WriteMemory
|
||||
void AnalyzeGPCommand(u8 *data);
|
||||
|
||||
private:
|
||||
void DecodeOpcode(u8 *data);
|
||||
|
||||
void ProcessLoadTlut1();
|
||||
void ProcessLoadIndexedXf(u32 val, int array);
|
||||
void ProcessVertexArrays(u8 *data, u8 vtxAttrGroup);
|
||||
void ProcessTexMaps();
|
||||
|
||||
void WriteVertexArray(int arrayIndex, u8 *vertexData, int vertexSize, int numVertices);
|
||||
void WriteTexMapMemory(int texMap, u32 &writtenTexMaps);
|
||||
|
||||
bool m_DrawingObject;
|
||||
|
||||
BPMemory *m_BpMem;
|
||||
FifoAnalyzer::CPMemory m_CpMem;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -28,6 +28,7 @@ else:
|
||||
'Src/Debugger/MemoryWindow.cpp',
|
||||
'Src/Debugger/RegisterView.cpp',
|
||||
'Src/Debugger/RegisterWindow.cpp',
|
||||
'Src/FifoPlayerDlg.cpp',
|
||||
'Src/Frame.cpp',
|
||||
'Src/FrameAui.cpp',
|
||||
'Src/FrameTools.cpp',
|
||||
|
||||
Reference in New Issue
Block a user