From e4d5e7c78b52e4b2ec6b401f627814f2c06a4a0a Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 1 Dec 2014 19:34:18 +0300 Subject: [PATCH] Some draft --- rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp | 22 ++++++++++++++++++---- rpcs3/Loader/ELF32.cpp | 3 +++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 5f53b45414..c867a010c9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -1176,14 +1176,28 @@ s32 cellGcmCallback(vm::ptr context, u32 count) const u32 address = context->current; const u32 upper = offsetTable.ioAddress[address >> 20]; // 12 bits assert(upper != 0xFFFF); - u32 offset = (upper << 20) | (address & 0xFFFFF); + const u32 offset = (upper << 20) | (address & 0xFFFFF); //ctrl.put.exchange(be_t::make(offset)); // update put pointer } - - // TODO: this may be wrong - vm::write32(context->current, CELL_GCM_METHOD_FLAG_JUMP | CELL_GCM_METHOD_FLAG_NON_INCREMENT | (0)); // set JUMP cmd + // preparations for changing the place (for optimized FIFO mode) + //auto cmd = vm::ptr::make(context->current.ToLE()); + //cmd[0] = 0x41D6C; + //cmd[1] = 0x20; + //cmd[2] = 0x41D74; + //cmd[3] = 0; // some incrementing by module value + //context->current += 0x10; + + { + const u32 address = context->begin; + const u32 upper = offsetTable.ioAddress[address >> 20]; // 12 bits + assert(upper != 0xFFFF); + const u32 offset = (upper << 20) | (address & 0xFFFFF); + vm::write32(context->current, CELL_GCM_METHOD_FLAG_JUMP | offset); // set JUMP cmd + } + context->current = context->begin; // rewind to the beginning + // TODO: something is missing return CELL_OK; } diff --git a/rpcs3/Loader/ELF32.cpp b/rpcs3/Loader/ELF32.cpp index 1466d56f52..5430dc2ff7 100644 --- a/rpcs3/Loader/ELF32.cpp +++ b/rpcs3/Loader/ELF32.cpp @@ -6,6 +6,7 @@ #include "ELF32.h" #include "Emu/Cell/SPUThread.h" #include "Emu/ARMv7/ARMv7Thread.h" +#include "Emu/ARMv7/PSVFuncList.h" #include "Emu/System.h" namespace loader @@ -88,6 +89,8 @@ namespace loader case MACHINE_MIPS: break; case MACHINE_ARM: { + list_known_psv_modules(); + auto armv7_thr_stop_data = vm::psv::ptr::make(Memory.PSV.RAM.AllocAlign(3 * 4)); armv7_thr_stop_data[0] = 0xf870; // HACK armv7_thr_stop_data[1] = 0x0001; // index 1