mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-13 11:39:47 +00:00
Rough implementation of GCM_CONTEXT_DMA methods
Rough implementation of GCM_CONTEXT_DMA methods. Fixes #1487
This commit is contained in:
parent
5605b4ee70
commit
65104b5909
1 changed files with 41 additions and 25 deletions
|
@ -102,41 +102,57 @@ namespace rsx
|
||||||
|
|
||||||
u32 get_address(u32 offset, u32 location)
|
u32 get_address(u32 offset, u32 location)
|
||||||
{
|
{
|
||||||
u32 res = 0;
|
|
||||||
|
|
||||||
switch (location)
|
switch (location)
|
||||||
{
|
{
|
||||||
case CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER:
|
case CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER:
|
||||||
case CELL_GCM_LOCATION_LOCAL:
|
case CELL_GCM_LOCATION_LOCAL:
|
||||||
{
|
|
||||||
//TODO: don't use not named constants like 0xC0000000
|
|
||||||
res = 0xC0000000 + offset;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case CELL_GCM_CONTEXT_DMA_MEMORY_HOST_BUFFER:
|
|
||||||
case CELL_GCM_LOCATION_MAIN:
|
|
||||||
{
|
|
||||||
res = (u32)RSXIOMem.RealAddr(offset); // TODO: Error Check?
|
|
||||||
if (res == 0)
|
|
||||||
{
|
{
|
||||||
fmt::throw_exception("GetAddress(offset=0x%x, location=0x%x): RSXIO memory not mapped" HERE, offset, location);
|
// TODO: Don't use unnamed constants like 0xC0000000
|
||||||
|
return 0xC0000000 + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (fxm::get<GSRender>()->strict_ordering[offset >> 20])
|
case CELL_GCM_CONTEXT_DMA_MEMORY_HOST_BUFFER:
|
||||||
//{
|
case CELL_GCM_LOCATION_MAIN:
|
||||||
// _mm_mfence(); // probably doesn't have any effect on current implementation
|
{
|
||||||
//}
|
if (u32 result = RSXIOMem.RealAddr(offset))
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt::throw_exception("GetAddress(offset=0x%x, location=0x%x): RSXIO memory not mapped" HERE, offset, location);
|
||||||
|
|
||||||
|
//if (fxm::get<GSRender>()->strict_ordering[offset >> 20])
|
||||||
|
//{
|
||||||
|
// _mm_mfence(); // probably doesn't have any effect on current implementation
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
case CELL_GCM_CONTEXT_DMA_TO_MEMORY_GET_REPORT:
|
||||||
|
return 0x100000 + offset; // TODO: Properly implement
|
||||||
|
|
||||||
|
case CELL_GCM_CONTEXT_DMA_REPORT_LOCATION_MAIN:
|
||||||
|
return 0x800 + offset; // TODO: Properly implement
|
||||||
|
|
||||||
|
case CELL_GCM_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY0:
|
||||||
|
return 0x40 + offset; // TODO: Properly implement
|
||||||
|
|
||||||
|
case CELL_GCM_CONTEXT_DMA_NOTIFY_MAIN_0:
|
||||||
|
fmt::throw_exception("Unimplemented CELL_GCM_CONTEXT_DMA_NOTIFY_MAIN_0 (offset=0x%x, location=0x%x)" HERE, offset, location);
|
||||||
|
|
||||||
|
case CELL_GCM_CONTEXT_DMA_SEMAPHORE_RW:
|
||||||
|
case CELL_GCM_CONTEXT_DMA_SEMAPHORE_R:
|
||||||
|
return 0x100 + offset; // TODO: Properly implement
|
||||||
|
|
||||||
|
case CELL_GCM_CONTEXT_DMA_DEVICE_RW:
|
||||||
|
fmt::throw_exception("Unimplemented CELL_GCM_CONTEXT_DMA_DEVICE_RW (offset=0x%x, location=0x%x)" HERE, offset, location);
|
||||||
|
|
||||||
|
case CELL_GCM_CONTEXT_DMA_DEVICE_R:
|
||||||
|
fmt::throw_exception("Unimplemented CELL_GCM_CONTEXT_DMA_DEVICE_R (offset=0x%x, location=0x%x)" HERE, offset, location);
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
fmt::throw_exception("Invalid location (offset=0x%x, location=0x%x)" HERE, offset, location);
|
fmt::throw_exception("Invalid location (offset=0x%x, location=0x%x)" HERE, offset, location);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 get_vertex_type_size_on_host(vertex_base_type type, u32 size)
|
u32 get_vertex_type_size_on_host(vertex_base_type type, u32 size)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue