diff --git a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp index 11ed6fc465..34e656f13a 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp @@ -80,8 +80,7 @@ void InitOffsetTable() memset(offsetTable.eaAddress.get_ptr(), 0xFF, 512 * sizeof(u16)); memset(IoMapTable, 0, 3072 * sizeof(u16)); - memset(RSXIOMem.ea, 0xFF, 512 * sizeof(u16)); - memset(RSXIOMem.io, 0xFF, 3072 * sizeof(u16)); + memset(&RSXIOMem, 0xFF, sizeof(RSXIOMem)); } //---------------------------------------------------------------------------- diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index 1e2967a725..788402e573 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -124,8 +124,7 @@ s32 sys_rsx_context_allocate(vm::ptr context_id, vm::ptr lpar_dma_cont dmaControl.put = 0; dmaControl.ref = 0xFFFFFFFF; - memset(RSXIOMem.ea, 0xFF, 512 * sizeof(u16)); - memset(RSXIOMem.io, 0xFF, 3072 * sizeof(u16)); + memset(&RSXIOMem, 0xFF, sizeof(RSXIOMem)); if (false/*system_mode == CELL_GCM_SYSTEM_MODE_IOMAP_512MB*/) rsx::get_current_renderer()->main_mem_size = 0x20000000; //512MB diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 8fec3c11c6..cb9db9f7f1 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -29,26 +29,21 @@ extern u64 get_system_time(); struct RSXIOTable { - u16 ea[512]; + u16 ea[4096]; u16 io[3072]; // try to get the real address given a mapped address // return non zero on success inline u32 RealAddr(u32 offs) { - if (offs & 0xE0000000) - { - return 0; // offset is beyond the limit - } + const u32 upper = this->ea[offs >> 20]; - const s32 upper = this->ea[offs >> 20] << 20; - - if (upper < 0) + if (static_cast(upper) < 0) { return 0; } - return upper | (offs & 0xFFFFF); + return (upper << 20) | (offs & 0xFFFFF); } };