Improve nuinterpreter.h

This commit is contained in:
Maxim Poliakovski 2020-11-15 23:43:40 +01:00
parent cc56e391bd
commit 95fb5d053d
2 changed files with 30 additions and 30 deletions

View File

@ -4,29 +4,7 @@
#include "ppcmmu.h"
#include "ppcdefs.h"
#include "jittables.h"
struct CachedInstr; // forward declaration
typedef void (*ImplSubr)(const CachedInstr *);
struct CachedInstr {
ImplSubr call_me;
union {
struct {
uint8_t d1;
uint8_t d2;
uint8_t d3;
uint8_t d4;
};
int32_t bt; // branch target
};
union {
int32_t simm;
uint32_t uimm;
};
};
#include "nuinterpreter.h"
CachedInstr* interp_tpc;
bool interp_running;
@ -133,12 +111,6 @@ bool PreDecode(uint32_t next_pc, CachedInstr* c_instr)
c_instr->call_me = p_instr->emu_fn;
if (p_instr->info.cflow_type == CFlowType::CFL_UNCOND_BRANCH) {
// finish translation block when an uncoditional branch is encountered
done = true;
continue;
}
/* pre-decode operands, immediate values etc. */
switch (p_instr->info.ops_fmt) {
case InstrOps::opDA:

View File

@ -1,2 +1,30 @@
//void PreDecode(uint32_t next_pc);
#ifndef NU_INTERPRETER_H
#define NU_INTERPRETER_H
struct CachedInstr; // forward declaration
typedef void (*ImplSubr)(const CachedInstr *);
struct CachedInstr {
ImplSubr call_me;
union {
struct {
uint8_t d1;
uint8_t d2;
uint8_t d3;
uint8_t d4;
};
int32_t bt; // branch target
};
union {
int32_t simm;
uint32_t uimm;
};
};
bool PreDecode(uint32_t next_pc, CachedInstr* c_instr);
void NuInterpExec(uint32_t start_addr);
#endif // NU_INTERPRETER_H