| ... | @@ -11,6 +11,9 @@ pub fn Interpreter(comptime Bus: type) type { | ... | @@ -11,6 +11,9 @@ pub fn Interpreter(comptime Bus: type) type { |
| 11 | /// This is set to true when we hit an undefined0 instruction, allowing it to | 11 | /// This is set to true when we hit an undefined0 instruction, allowing it to |
| 12 | /// be used as a trap for testing purposes | 12 | /// be used as a trap for testing purposes |
| 13 | undefined0: bool = false, | 13 | undefined0: bool = false, |
| | 14 | /// This is set to true when we hit an undefined1 instruction, allowing it to |
| | 15 | /// be used as a trap for testing purposes. undefined1 is used as a breakpoint. |
| | 16 | undefined1: bool = false, |
| 14 | bus: Bus, | 17 | bus: Bus, |
| 15 | | 18 | |
| 16 | pub fn ExecuteBlock(self: *@This(), comptime size: ?u32) !void { | 19 | pub fn ExecuteBlock(self: *@This(), comptime size: ?u32) !void { |
| ... | @@ -122,7 +125,11 @@ pub fn Interpreter(comptime Bus: type) type { | ... | @@ -122,7 +125,11 @@ pub fn Interpreter(comptime Bus: type) type { |
| 122 | // Break out of the loop, and let the caller decide what to do | 125 | // Break out of the loop, and let the caller decide what to do |
| 123 | return; | 126 | return; |
| 124 | }, | 127 | }, |
| 125 | .undefined1 => return error.BadInstruction, | 128 | .undefined1 => { |
| | 129 | self.undefined1 = true; |
| | 130 | // Break out of the loop, and let the caller decide what to do |
| | 131 | return; |
| | 132 | }, |
| 126 | .signext => if ((val0 & 0x80) != 0) | 133 | .signext => if ((val0 & 0x80) != 0) |
| 127 | (val0 & 0xFF) | 0xFF00 | 134 | (val0 & 0xFF) | 0xFF00 |
| 128 | else | 135 | else |