diff options
Diffstat (limited to 'src/video_core/macro_interpreter.cpp')
| -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 | |||
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | u32 MacroInterpreter::FetchParameter() { | 225 | u32 MacroInterpreter::FetchParameter() { |
| 226 | ASSERT(next_parameter_index < parameters.size()); | 226 | return parameters.at(next_parameter_index++); |
| 227 | return parameters[next_parameter_index++]; | ||
| 228 | } | 227 | } |
| 229 | 228 | ||
| 230 | u32 MacroInterpreter::GetRegister(u32 register_id) const { | 229 | u32 MacroInterpreter::GetRegister(u32 register_id) const { |
| 231 | // Register 0 is supposed to always return 0. | 230 | 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 | } | 231 | } |
| 238 | 232 | ||
| 239 | void MacroInterpreter::SetRegister(u32 register_id, u32 value) { | 233 | 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 | 234 | // Register 0 is hardwired as the zero register. |
| 241 | // register. | 235 | // Ensure no writes to it actually occur. |
| 242 | if (register_id == 0) | 236 | if (register_id == 0) { |
| 243 | return; | 237 | return; |
| 238 | } | ||
| 244 | 239 | ||
| 245 | ASSERT(register_id < registers.size()); | 240 | registers.at(register_id) = value; |
| 246 | registers[register_id] = value; | ||
| 247 | } | 241 | } |
| 248 | 242 | ||
| 249 | void MacroInterpreter::SetMethodAddress(u32 address) { | 243 | void MacroInterpreter::SetMethodAddress(u32 address) { |