PPU: Allow HLE execution from pure instruction decoder type interpreter

This commit is contained in:
Eladash 2020-12-14 13:32:04 +02:00 committed by Ivan
parent 0445ef393f
commit bfe1a8673a
8 changed files with 38 additions and 27 deletions

View file

@ -6,6 +6,7 @@
#include "PPUThread.h"
#include "Utilities/sysinfo.h"
#include "Emu/Cell/Common.h"
#include "Emu/Cell/PPUFunction.h"
#include <bit>
#include <cmath>
@ -5173,5 +5174,15 @@ bool ppu_interpreter::FCFID(ppu_thread& ppu, ppu_opcode_t op)
bool ppu_interpreter::UNK(ppu_thread& ppu, ppu_opcode_t op)
{
// HLE function index
const u32 index = (ppu.cia - ppu_function_manager::addr) / 8;
const auto& hle_funcs = ppu_function_manager::get();
if (ppu.cia % 8 == 4 && index < hle_funcs.size())
{
return hle_funcs[index](ppu);
}
fmt::throw_exception("Unknown/Illegal opcode: 0x%08x at 0x%x", op.opcode, ppu.cia);
}