mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 13:01:50 +01:00
Fix 32-bit register reading/writing
Co-Authored-By: Ryan Teal <rynteal@protonmail.com>
This commit is contained in:
parent
9a36d5fcf9
commit
9657064740
@ -107,10 +107,10 @@ namespace lightSwitch::hw {
|
||||
}
|
||||
|
||||
uint64_t Cpu::GetRegister(wreg reg_id) {
|
||||
return (reinterpret_cast<uint32_t *>(regs.regs))[wreg_lut[reg_id]];
|
||||
return (reinterpret_cast<uint32_t *>(®s.regs))[wreg_lut[reg_id]];
|
||||
}
|
||||
|
||||
void Cpu::SetRegister(wreg reg_id, uint32_t value) {
|
||||
(reinterpret_cast<uint32_t *>(regs.regs))[wreg_lut[reg_id]] = value;
|
||||
(reinterpret_cast<uint32_t *>(®s.regs))[wreg_lut[reg_id]] = value;
|
||||
}
|
||||
}
|
@ -34,7 +34,7 @@ namespace lightSwitch::hw {
|
||||
|
||||
void WriteBreakpoint(uint64_t address, uint64_t size);
|
||||
|
||||
uint8_t wreg_lut[31] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61};
|
||||
uint8_t wreg_lut[31] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60};
|
||||
|
||||
public:
|
||||
~Cpu();
|
||||
|
Loading…
Reference in New Issue
Block a user