CPU/Recompiler: Get rid of non-constant offsetofs
This commit is contained in:
@ -84,6 +84,9 @@ struct State
|
||||
std::array<u8, DCACHE_SIZE> dcache = {};
|
||||
std::array<u32, ICACHE_LINES> icache_tags = {};
|
||||
std::array<u8, ICACHE_SIZE> icache_data = {};
|
||||
|
||||
static constexpr u32 GPRRegisterOffset(u32 index) { return offsetof(State, regs.r) + (sizeof(u32) * index); }
|
||||
static constexpr u32 GTERegisterOffset(u32 index) { return offsetof(State, gte_regs.r32) + (sizeof(u32) * index); }
|
||||
};
|
||||
|
||||
extern State g_state;
|
||||
|
||||
Reference in New Issue
Block a user