2012-11-15 00:39:56 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
2016-04-14 01:09:41 +02:00
|
|
|
#include "PPUOpcodes.h"
|
2014-08-22 23:15:02 +02:00
|
|
|
|
2016-07-27 23:43:22 +02:00
|
|
|
class ppu_thread;
|
2012-11-15 00:39:56 +01:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
using ppu_intrp_func_t = void(*)(ppu_thread& ppu_, ppu_opcode_t op, be_t<u32>* this_op, struct ppu_intrp_func* next_fn);
|
2017-12-19 22:01:03 +01:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
struct ppu_intrp_func
|
2015-01-17 23:04:45 +01:00
|
|
|
{
|
2021-12-30 17:39:18 +01:00
|
|
|
ppu_intrp_func_t fn;
|
|
|
|
|
};
|
2016-04-14 01:09:41 +02:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
template <typename IT>
|
|
|
|
|
struct ppu_interpreter_t;
|
2017-12-19 22:01:03 +01:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
namespace asmjit
|
|
|
|
|
{
|
|
|
|
|
struct ppu_builder;
|
|
|
|
|
}
|
2020-03-24 18:07:35 +01:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
struct ppu_interpreter_rt_base
|
2020-03-24 18:07:35 +01:00
|
|
|
{
|
2021-12-30 17:39:18 +01:00
|
|
|
protected:
|
|
|
|
|
std::unique_ptr<ppu_interpreter_t<ppu_intrp_func_t>> ptrs;
|
|
|
|
|
|
|
|
|
|
ppu_interpreter_rt_base() noexcept;
|
|
|
|
|
|
|
|
|
|
ppu_interpreter_rt_base(const ppu_interpreter_rt_base&) = delete;
|
2019-04-18 10:58:08 +02:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
ppu_interpreter_rt_base& operator=(const ppu_interpreter_rt_base&) = delete;
|
2019-04-18 10:58:08 +02:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
virtual ~ppu_interpreter_rt_base();
|
2016-04-14 01:09:41 +02:00
|
|
|
};
|
2015-12-05 19:32:25 +01:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
struct ppu_interpreter_rt : ppu_interpreter_rt_base
|
2012-11-15 00:39:56 +01:00
|
|
|
{
|
2021-12-30 17:39:18 +01:00
|
|
|
ppu_interpreter_rt() noexcept;
|
2019-04-18 10:58:08 +02:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
ppu_intrp_func_t decode(u32 op) const noexcept;
|
2019-04-18 10:58:08 +02:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
private:
|
|
|
|
|
ppu_decoder<ppu_interpreter_t<ppu_intrp_func_t>, ppu_intrp_func_t> table;
|
2012-11-15 00:39:56 +01:00
|
|
|
};
|