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