mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-01 06:10:00 +01:00
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#pragma once
|
|
#include "Emu/CPU/CPUDecoder.h"
|
|
#include "PPCInstrTable.h"
|
|
|
|
class PPCDecoder
|
|
{
|
|
protected:
|
|
u32 m_code;
|
|
|
|
public:
|
|
u32 GetCode() const { return m_code; }
|
|
|
|
virtual void Decode(const u32 code)=0;
|
|
};
|
|
|
|
|
|
template<typename TO, uint from, uint to>
|
|
static InstrList<1 << CodeField<from, to>::size, TO>* new_list(const CodeField<from, to>& func, InstrCaller<TO>* error_func = nullptr)
|
|
{
|
|
return new InstrList<1 << CodeField<from, to>::size, TO>(func, error_func);
|
|
}
|
|
|
|
template<int count, typename TO, uint from, uint to>
|
|
static InstrList<1 << CodeField<from, to>::size, TO>* new_list(InstrList<count, TO>* parent, int opcode, const CodeField<from, to>& func, InstrCaller<TO>* error_func = nullptr)
|
|
{
|
|
return connect_list(parent, new InstrList<1 << CodeField<from, to>::size, TO>(func, error_func), opcode);
|
|
}
|
|
|
|
template<int count, typename TO, uint from, uint to>
|
|
static InstrList<1 << CodeField<from, to>::size, TO>* new_list(InstrList<count, TO>* parent, const CodeField<from, to>& func, InstrCaller<TO>* error_func = nullptr)
|
|
{
|
|
return connect_list(parent, new InstrList<1 << CodeField<from, to>::size, TO>(func, error_func));
|
|
} |