A long time since my last commit but i have a lot of work. hope to find some time to fix more things.
some little corrections in dlist cache code, i thing they will not have effect in the remaining issues but now the code behaves more correctly in some situations. i discover the solution for the remaining issues bur requires some changes in the vertex translator so will work on them after the upcoming Release. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7556 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
e4fa493a27
commit
fa7a521086
|
@ -224,7 +224,7 @@ inline u64 CreateVMapId(u32 VATUSED)
|
||||||
for(int i = 0; i < 12; i++)
|
for(int i = 0; i < 12; i++)
|
||||||
{
|
{
|
||||||
if(VATUSED & (1 << (i + 16)))
|
if(VATUSED & (1 << (i + 16)))
|
||||||
vmap_id ^= (((u64)cached_arraybases[i]) ^ (((u64)arraystrides[i]) << i));
|
vmap_id ^= (((u64)arraybases[i]) ^ (((u64)arraystrides[i]) << 32));
|
||||||
}
|
}
|
||||||
return vmap_id;
|
return vmap_id;
|
||||||
}
|
}
|
||||||
|
@ -353,6 +353,8 @@ u32 AnalyzeAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||||
{
|
{
|
||||||
// load vertices (use computed vertex size from FifoCommandRunnable above)
|
// load vertices (use computed vertex size from FifoCommandRunnable above)
|
||||||
u16 numVertices = DataReadU16();
|
u16 numVertices = DataReadU16();
|
||||||
|
if(numVertices > 0)
|
||||||
|
{
|
||||||
result |= 1 << (cmd_byte & GX_VAT_MASK);
|
result |= 1 << (cmd_byte & GX_VAT_MASK);
|
||||||
VertexLoaderManager::RunVertices(
|
VertexLoaderManager::RunVertices(
|
||||||
cmd_byte & GX_VAT_MASK, // Vertex loader index (0 - 7)
|
cmd_byte & GX_VAT_MASK, // Vertex loader index (0 - 7)
|
||||||
|
@ -371,6 +373,7 @@ u32 AnalyzeAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(VIDEO, "OpcodeDecoding::Decode: Illegal command %02x", cmd_byte);
|
ERROR_LOG(VIDEO, "OpcodeDecoding::Decode: Illegal command %02x", cmd_byte);
|
||||||
|
@ -537,8 +540,10 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||||
{
|
{
|
||||||
// load vertices (use computed vertex size from FifoCommandRunnable above)
|
// load vertices (use computed vertex size from FifoCommandRunnable above)
|
||||||
|
|
||||||
// Execute
|
|
||||||
u16 numVertices = DataReadU16();
|
u16 numVertices = DataReadU16();
|
||||||
|
if(numVertices > 0)
|
||||||
|
{
|
||||||
|
// Execute
|
||||||
u8* StartAddress = VertexManager::s_pBaseBufferPointer;
|
u8* StartAddress = VertexManager::s_pBaseBufferPointer;
|
||||||
VertexManager::Flush();
|
VertexManager::Flush();
|
||||||
VertexLoaderManager::RunVertices(
|
VertexLoaderManager::RunVertices(
|
||||||
|
@ -547,7 +552,7 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||||
numVertices);
|
numVertices);
|
||||||
u8* EndAddress = VertexManager::s_pCurBufferPointer;
|
u8* EndAddress = VertexManager::s_pCurBufferPointer;
|
||||||
u32 Vdatasize = (u32)(EndAddress - StartAddress);
|
u32 Vdatasize = (u32)(EndAddress - StartAddress);
|
||||||
if (size > 0 && numVertices > 0)
|
if (Vdatasize > 0)
|
||||||
{
|
{
|
||||||
// Compile
|
// Compile
|
||||||
ReferencedDataRegion* NewRegion = new ReferencedDataRegion;
|
ReferencedDataRegion* NewRegion = new ReferencedDataRegion;
|
||||||
|
@ -558,8 +563,6 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||||
dl->InsertRegion(NewRegion);
|
dl->InsertRegion(NewRegion);
|
||||||
memcpy(NewRegion->start_address, StartAddress, Vdatasize);
|
memcpy(NewRegion->start_address, StartAddress, Vdatasize);
|
||||||
emitter.ABI_CallFunctionCCCP((void *)&VertexLoaderManager::RunCompiledVertices, cmd_byte & GX_VAT_MASK, (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, numVertices, NewRegion->start_address);
|
emitter.ABI_CallFunctionCCCP((void *)&VertexLoaderManager::RunCompiledVertices, cmd_byte & GX_VAT_MASK, (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, numVertices, NewRegion->start_address);
|
||||||
|
|
||||||
}
|
|
||||||
const int tc[12] = {
|
const int tc[12] = {
|
||||||
g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord,
|
g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord,
|
||||||
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
|
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
|
||||||
|
@ -574,6 +577,9 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(VIDEO, "DLCache::CompileAndRun: Illegal command %02x", cmd_byte);
|
ERROR_LOG(VIDEO, "DLCache::CompileAndRun: Illegal command %02x", cmd_byte);
|
||||||
|
@ -635,7 +641,6 @@ void ProgressiveCleanup()
|
||||||
CachedDisplayList &entry = childiter->second;
|
CachedDisplayList &entry = childiter->second;
|
||||||
int limit = 3600;
|
int limit = 3600;
|
||||||
if (entry.frame_count < frameCount - limit) {
|
if (entry.frame_count < frameCount - limit) {
|
||||||
// entry.Destroy();
|
|
||||||
entry.ClearRegions();
|
entry.ClearRegions();
|
||||||
ParentEntry.dl_map.erase(childiter++); // (this is gcc standard!)
|
ParentEntry.dl_map.erase(childiter++); // (this is gcc standard!)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue