optimized Thumbulator.cxx

This commit is contained in:
thrust26 2019-02-21 22:56:18 +01:00
parent 330f4d8f29
commit 9a09675e55
2 changed files with 851 additions and 347 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@
// This class provides Thumb emulation code ("Thumbulator")
// by David Welch (dwelch@dwelch.com)
// Modified by Fred Quimby
// Optimized by Christina Speckner and Thomas Jentzsch
// Code is public domain and used with the author's consent
//============================================================================
@ -140,6 +141,12 @@ class Thumbulator
uxth
};
struct Instruction
{
Op op;
uInt32 rb, rd, rm, rn, rs;
};
private:
uInt32 read_register(uInt32 reg);
void write_register(uInt32 reg, uInt32 data);
@ -152,7 +159,7 @@ class Thumbulator
void write32(uInt32 addr, uInt32 data);
void updateTimer(uInt32 cycles);
static Op decodeInstructionWord(uint16_t inst);
void decodeInstructionWord(uint16_t inst, Instruction& instr);
void do_zflag(uInt32 x);
void do_nflag(uInt32 x);
@ -175,7 +182,7 @@ class Thumbulator
private:
const uInt16* rom;
uInt16 romSize;
const unique_ptr<Op[]> decodedRom;
const unique_ptr<Instruction[]> decodedInstruction;
uInt16* ram;
uInt32 reg_norm[16]; // normal execution mode, do not have a thread mode