diff options
Diffstat (limited to 'src/video_core/macro_interpreter.cpp')
| -rw-r--r-- | src/video_core/macro_interpreter.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/video_core/macro_interpreter.cpp b/src/video_core/macro_interpreter.cpp index 64f75db43..4c4e8d603 100644 --- a/src/video_core/macro_interpreter.cpp +++ b/src/video_core/macro_interpreter.cpp | |||
| @@ -228,22 +228,17 @@ u32 MacroInterpreter::FetchParameter() { | |||
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | u32 MacroInterpreter::GetRegister(u32 register_id) const { | 230 | u32 MacroInterpreter::GetRegister(u32 register_id) const { |
| 231 | // Register 0 is supposed to always return 0. | 231 | return registers.at(register_id); |
| 232 | if (register_id == 0) | ||
| 233 | return 0; | ||
| 234 | |||
| 235 | ASSERT(register_id < registers.size()); | ||
| 236 | return registers[register_id]; | ||
| 237 | } | 232 | } |
| 238 | 233 | ||
| 239 | void MacroInterpreter::SetRegister(u32 register_id, u32 value) { | 234 | void MacroInterpreter::SetRegister(u32 register_id, u32 value) { |
| 240 | // Register 0 is supposed to always return 0. NOP is implemented as a store to the zero | 235 | // Register 0 is hardwired as the zero register. |
| 241 | // register. | 236 | // Ensure no writes to it actually occur. |
| 242 | if (register_id == 0) | 237 | if (register_id == 0) { |
| 243 | return; | 238 | return; |
| 239 | } | ||
| 244 | 240 | ||
| 245 | ASSERT(register_id < registers.size()); | 241 | registers.at(register_id) = value; |
| 246 | registers[register_id] = value; | ||
| 247 | } | 242 | } |
| 248 | 243 | ||
| 249 | void MacroInterpreter::SetMethodAddress(u32 address) { | 244 | void MacroInterpreter::SetMethodAddress(u32 address) { |