dec_raw -> dec_flags
This commit is contained in:
parent
06031ad649
commit
f9915c6ebf
|
@ -61,7 +61,7 @@ impl Cpu {
|
|||
|
||||
pub(crate) fn dec(&mut self, reg: Reg8) {
|
||||
let result = self.reg.get_8(reg);
|
||||
let val = self.dec_raw(result);
|
||||
let val = self.dec_flags(result);
|
||||
self.reg.set_8(reg, val);
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ impl Cpu {
|
|||
result
|
||||
}
|
||||
|
||||
pub(crate) fn dec_raw(&mut self, val: u8) -> u8 {
|
||||
pub(crate) fn dec_flags(&mut self, val: u8) -> u8 {
|
||||
let result = val.wrapping_sub(0x1);
|
||||
self.set_flag(Flags::NSubtract);
|
||||
self.set_or_clear_flag(Flags::Zero, result == 0x0);
|
||||
|
|
|
@ -285,7 +285,7 @@ impl Cpu {
|
|||
3
|
||||
}
|
||||
0x35 => {
|
||||
let val = self.dec_raw(self.memory.get(self.reg.hl));
|
||||
let val = self.dec_flags(self.memory.get(self.reg.hl));
|
||||
self.memory.set(self.reg.hl, val);
|
||||
3
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue