Cop0's Index as a union

This commit is contained in:
SimoneN64
2023-08-28 15:58:18 +02:00
parent 1a338de8b9
commit 367a82c11d
3 changed files with 34 additions and 24 deletions

View File

@@ -5,6 +5,7 @@
namespace n64 {
#define STATUS_MASK 0xFF57FFFF
#define CONFIG_MASK 0x0F00800F
#define INDEX_MASK 0x8000003F
#define COP0_REG_INDEX 0
#define COP0_REG_RANDOM 1
#define COP0_REG_ENTRYLO0 2
@@ -133,6 +134,15 @@ union PageMask {
};
};
union Index {
u32 raw;
struct {
unsigned i:6;
unsigned:25;
unsigned p:1;
};
};
struct TLBEntry {
bool initialized;
union {
@@ -220,7 +230,7 @@ struct Cop0 {
PageMask pageMask{};
EntryHi entryHi{};
EntryLo entryLo0{}, entryLo1{};
u32 index{};
Index index{};
Cop0Context context{};
u32 wired{}, r7{};
u64 badVaddr{}, count{};