there might be an off by 1 error...
This commit is contained in:
+27
-2
@@ -17,7 +17,7 @@ struct broadway {
|
||||
void execute(ircolib::u32, mem &);
|
||||
|
||||
bool disasm_available = true;
|
||||
ircolib::u32 pc = 0, lr = 0, ctr = 0, cr = 0, srr0;
|
||||
ircolib::u32 pc = 0, lr = 0, ctr = 0, cr = 0, srr0 = 0, fpscr = 0, msr = 0;
|
||||
union {
|
||||
struct {
|
||||
unsigned bytecount : 7;
|
||||
@@ -43,7 +43,13 @@ struct broadway {
|
||||
|
||||
std::array<ircolib::u32, 16> ibat, dbat;
|
||||
std::array<ircolib::u32, 32> gpr{};
|
||||
std::array<double, 32> fpr{};
|
||||
|
||||
struct Fgr {
|
||||
ircolib::u64 ps0, ps1;
|
||||
};
|
||||
|
||||
std::array<Fgr, 32> fgrs{};
|
||||
|
||||
// ircolib::u32 const_gpr_lookup{};
|
||||
csh capstone;
|
||||
// Xbyak::CodeGenerator code;
|
||||
@@ -51,6 +57,7 @@ struct broadway {
|
||||
// instructions
|
||||
void decode_special1(ircolib::u32, mem &);
|
||||
void decode_special2(ircolib::u32, mem &);
|
||||
void decode_special3(ircolib::u32, mem &);
|
||||
|
||||
void branch(bool, bool, ircolib::u32);
|
||||
bool test_cond_and_ctr(ircolib::u32);
|
||||
@@ -66,14 +73,25 @@ struct broadway {
|
||||
void mftspr(bool, ircolib::u32);
|
||||
void stw(ircolib::u32, mem &);
|
||||
void stwu(ircolib::u32, mem &);
|
||||
void stbu(ircolib::u32, mem &);
|
||||
void sth(ircolib::u32, mem &);
|
||||
void lwz(ircolib::u32, mem &);
|
||||
void lfd(ircolib::u32, mem &);
|
||||
void bclrx(ircolib::u32);
|
||||
void cmpi(ircolib::u32);
|
||||
void cmpli(ircolib::u32);
|
||||
void cmp(ircolib::u32);
|
||||
void cmpl(ircolib::u32);
|
||||
void rlwinm(ircolib::u32);
|
||||
void lwzu(ircolib::u32, mem &);
|
||||
void rfi(ircolib::u32);
|
||||
void mtfsf(ircolib::u32);
|
||||
void mtfsb1(ircolib::u32);
|
||||
void mtfsb0(ircolib::u32);
|
||||
void mfmsr(ircolib::u32);
|
||||
void nand(ircolib::u32);
|
||||
void subf(ircolib::u32);
|
||||
void or (ircolib::u32);
|
||||
|
||||
inline void cr0_update(bool condition, ircolib::s32 result) {
|
||||
if (condition) {
|
||||
@@ -84,5 +102,12 @@ struct broadway {
|
||||
set_cr((b0 << 3) | (b1 << 2) | (b2 << 1) | (b3 << 0), 0);
|
||||
}
|
||||
}
|
||||
|
||||
inline void cr1_update(bool condition) {
|
||||
if (condition) {
|
||||
const ircolib::u8 field = (fpscr >> 28) & 0xf;
|
||||
set_cr(field, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace weee::core
|
||||
|
||||
Reference in New Issue
Block a user