Fix INX and DCX not being wrapping

This commit is contained in:
pjht 2024-10-10 11:21:23 -05:00
parent dcbce1a1a5
commit 227e1e779b
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -401,8 +401,8 @@ impl I8080 {
self.update_arith_flags(ac, self.carry, res); self.update_arith_flags(ac, self.carry, res);
self.regs[src] = res; self.regs[src] = res;
} }
Opcode::Inx(dst) => self.set_pair(dst, self.get_pair(dst) + 1), Opcode::Inx(dst) => self.set_pair(dst, self.get_pair(dst).wrapping_add(1)),
Opcode::Dcx(dst) => self.set_pair(dst, self.get_pair(dst) + 2), Opcode::Dcx(dst) => self.set_pair(dst, self.get_pair(dst).wrapping_sub(1)),
Opcode::Dad(src) => { Opcode::Dad(src) => {
let a = u32::from(self.get_pair(RegisterPair::HL)); let a = u32::from(self.get_pair(RegisterPair::HL));
let b = u32::from(self.get_pair(src)); let b = u32::from(self.get_pair(src));