diff options
author | bunnei <bunneidev@gmail.com> | 2019-04-05 23:32:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-05 23:32:26 -0400 |
commit | 8a1bcc3d30ecf907db569f09e7d026a24a0e363b (patch) | |
tree | 9fe8a7727546baa94cdaf0bb8d91189101e403fd | |
parent | d6b7195192057a61b448a353bcf109cc2ddd2d73 (diff) | |
parent | 00e7190e29c0368abb7ef172a73f524d975ed7c9 (diff) |
Merge pull request #2351 from lioncash/macro
video_core/macro_interpreter: Simplify GetRegister()
-rw-r--r-- | src/video_core/macro_interpreter.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/video_core/macro_interpreter.cpp b/src/video_core/macro_interpreter.cpp index 64f75db43..524d9ea5a 100644 --- a/src/video_core/macro_interpreter.cpp +++ b/src/video_core/macro_interpreter.cpp @@ -223,27 +223,21 @@ void MacroInterpreter::ProcessResult(ResultOperation operation, u32 reg, u32 res } u32 MacroInterpreter::FetchParameter() { - ASSERT(next_parameter_index < parameters.size()); - return parameters[next_parameter_index++]; + return parameters.at(next_parameter_index++); } u32 MacroInterpreter::GetRegister(u32 register_id) const { - // Register 0 is supposed to always return 0. - if (register_id == 0) - return 0; - - ASSERT(register_id < registers.size()); - return registers[register_id]; + return registers.at(register_id); } 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. - if (register_id == 0) + // Register 0 is hardwired as the zero register. + // Ensure no writes to it actually occur. + if (register_id == 0) { return; + } - ASSERT(register_id < registers.size()); - registers[register_id] = value; + registers.at(register_id) = value; } void MacroInterpreter::SetMethodAddress(u32 address) { |