mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Refactoring (#6143)
Prefer vm::ptr<>::ptr over vm::get_addr. Prefer vm::_ptr/base over vm::g_base_addr with offset. Added methods atomic_t<>::bts and atomic_t<>::btr . Removed obsolute rsx:🧵:Read/WriteIO32 methods. Removed wrong check in semaphore_release. Added handling for PUTRx commands for RawSPU MFC proxy. Prefer overloaded methods of v128 instead of _mm_... in VPKSHUS ppu interpreter precise. Fixed more potential overflows that may result in wrong behaviour. Added io/size alignment check for sys_rsx_context_iounmap. Added rsx::constants::local_mem_base which represents RSX local memory base address. Removed obsolute rsx:🧵:main_mem_addr/ioSize/ioAddress members.
This commit is contained in:
parent
e043412be4
commit
1ee7b91646
20 changed files with 64 additions and 81 deletions
|
@ -53,8 +53,7 @@ namespace rsx
|
|||
case CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER:
|
||||
case CELL_GCM_LOCATION_LOCAL:
|
||||
{
|
||||
// TODO: Don't use unnamed constants like 0xC0000000
|
||||
return 0xC0000000 + offset;
|
||||
return rsx::constants::local_mem_base + offset;
|
||||
}
|
||||
|
||||
case CELL_GCM_CONTEXT_DMA_MEMORY_HOST_BUFFER:
|
||||
|
@ -1747,12 +1746,9 @@ namespace rsx
|
|||
rsx::method_registers.reset();
|
||||
}
|
||||
|
||||
void thread::init(u32 ioAddress, u32 ioSize, u32 ctrlAddress, u32 localAddress)
|
||||
void thread::init(u32 ctrlAddress)
|
||||
{
|
||||
ctrl = vm::_ptr<RsxDmaControl>(ctrlAddress);
|
||||
this->ioAddress = ioAddress;
|
||||
this->ioSize = ioSize;
|
||||
local_mem_addr = localAddress;
|
||||
flip_status = CELL_GCM_DISPLAY_FLIP_STATUS_DONE;
|
||||
|
||||
memset(display_buffers, 0, sizeof(display_buffers));
|
||||
|
@ -1792,27 +1788,7 @@ namespace rsx
|
|||
address = get_address(tile->offset, location);
|
||||
}
|
||||
|
||||
return{ address, base, tile, (u8*)vm::base(address) };
|
||||
}
|
||||
|
||||
u32 thread::ReadIO32(u32 addr)
|
||||
{
|
||||
if (u32 ea = RSXIOMem.RealAddr(addr))
|
||||
{
|
||||
return vm::read32(ea);
|
||||
}
|
||||
|
||||
fmt::throw_exception("%s(addr=0x%x): RSXIO memory not mapped" HERE, __FUNCTION__, addr);
|
||||
}
|
||||
|
||||
void thread::WriteIO32(u32 addr, u32 value)
|
||||
{
|
||||
if (u32 ea = RSXIOMem.RealAddr(addr))
|
||||
{
|
||||
return vm::write32(ea, value);
|
||||
}
|
||||
|
||||
fmt::throw_exception("%s(addr=0x%x): RSXIO memory not mapped" HERE, __FUNCTION__, addr);
|
||||
return{ address, base, tile, vm::_ptr<u8>(address) };
|
||||
}
|
||||
|
||||
std::pair<u32, u32> thread::calculate_memory_requirements(const vertex_input_layout& layout, u32 first_vertex, u32 vertex_count)
|
||||
|
@ -2294,7 +2270,7 @@ namespace rsx
|
|||
|
||||
void thread::on_notify_memory_unmapped(u32 address, u32 size)
|
||||
{
|
||||
if (!m_rsx_thread_exiting && address < 0xC0000000)
|
||||
if (!m_rsx_thread_exiting && address < rsx::constants::local_mem_base)
|
||||
{
|
||||
u32 ea = address >> 20, io = RSXIOMem.io[ea];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue