diff --git a/rpcs3/Emu/Cell/RawSPUThread.cpp b/rpcs3/Emu/Cell/RawSPUThread.cpp index c78fb3f8c8..00776bd9e8 100644 --- a/rpcs3/Emu/Cell/RawSPUThread.cpp +++ b/rpcs3/Emu/Cell/RawSPUThread.cpp @@ -319,20 +319,18 @@ bool spu_thread::write_reg(const u32 addr, const u32 value) void spu_load_exec(const spu_exec_object& elf) { - auto ls0 = vm::addr_t{RAW_SPU_BASE_ADDR}; - spu_thread::g_raw_spu_ctr++; + auto spu = idm::make_ptr>("TEST_SPU", nullptr, 0, "", 0); + for (const auto& prog : elf.progs) { if (prog.p_type == 0x1u /* LOAD */ && prog.p_memsz) { - std::memcpy(vm::base(ls0 + prog.p_vaddr), prog.bin.data(), prog.p_filesz); + std::memcpy(spu->_ptr(prog.p_vaddr), prog.bin.data(), prog.p_filesz); } } - auto spu = idm::make_ptr>("TEST_SPU", nullptr, 0, "", 0); - spu_thread::g_raw_spu_id[0] = spu->id; spu->status_npc = {SPU_STATUS_RUNNING, elf.header.e_entry};