mirror of
https://github.com/yuzu-emu/yuzu-mainline.git
synced 2024-12-27 20:45:41 +00:00
Merge pull request #2351 from lioncash/macro
video_core/macro_interpreter: Simplify GetRegister()
This commit is contained in:
commit
8a1bcc3d30
|
@ -223,27 +223,21 @@ void MacroInterpreter::ProcessResult(ResultOperation operation, u32 reg, u32 res
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 MacroInterpreter::FetchParameter() {
|
u32 MacroInterpreter::FetchParameter() {
|
||||||
ASSERT(next_parameter_index < parameters.size());
|
return parameters.at(next_parameter_index++);
|
||||||
return parameters[next_parameter_index++];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 MacroInterpreter::GetRegister(u32 register_id) const {
|
u32 MacroInterpreter::GetRegister(u32 register_id) const {
|
||||||
// Register 0 is supposed to always return 0.
|
return registers.at(register_id);
|
||||||
if (register_id == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ASSERT(register_id < registers.size());
|
|
||||||
return registers[register_id];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroInterpreter::SetRegister(u32 register_id, u32 value) {
|
void MacroInterpreter::SetRegister(u32 register_id, u32 value) {
|
||||||
// Register 0 is supposed to always return 0. NOP is implemented as a store to the zero
|
// Register 0 is hardwired as the zero register.
|
||||||
// register.
|
// Ensure no writes to it actually occur.
|
||||||
if (register_id == 0)
|
if (register_id == 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT(register_id < registers.size());
|
registers.at(register_id) = value;
|
||||||
registers[register_id] = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroInterpreter::SetMethodAddress(u32 address) {
|
void MacroInterpreter::SetMethodAddress(u32 address) {
|
||||||
|
|
Loading…
Reference in a new issue