diff options
author | 2024-02-08 23:48:06 +0100 | |
---|---|---|
committer | 2024-02-08 23:48:06 +0100 | |
commit | 33a2fe7045731f071b849d18c7737accd005267f (patch) | |
tree | dd9911ac33ad129a3a8ab9b19c6e622e83ff0946 /src/devices/cpu/h8/h8.cpp | |
parent | 77c19bfbb53da158c93a28ca9bebf70228cbdf8a (diff) |
h8: like subx, addx does not modify Z flag if result is 0,
h8: correct H8/300 opcode map (i suspect H8/300H also has opcodes in the map that belong to newer arch but didnt check)
Diffstat (limited to 'src/devices/cpu/h8/h8.cpp')
-rw-r--r-- | src/devices/cpu/h8/h8.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp index e08adcfc2a8..0aba57b2527 100644 --- a/src/devices/cpu/h8/h8.cpp +++ b/src/devices/cpu/h8/h8.cpp @@ -514,16 +514,16 @@ int h8_device::trapa_setup() uint8_t h8_device::do_addx8(uint8_t v1, uint8_t v2) { uint16_t res = v1 + v2 + (m_CCR & F_C ? 1 : 0); - m_CCR &= ~(F_N|F_V|F_Z|F_C); + m_CCR &= ~(F_N|F_V|F_C); if(m_has_hc) { m_CCR &= ~F_H; if(((v1 & 0xf) + (v2 & 0xf) + (m_CCR & F_C ? 1 : 0)) & 0x10) m_CCR |= F_H; } - if(!uint8_t(res)) - m_CCR |= F_Z; - else if(int8_t(res) < 0) + if(uint8_t(res)) + m_CCR &= ~F_Z; + if(int8_t(res) < 0) m_CCR |= F_N; if(~(v1^v2) & (v1^res) & 0x80) m_CCR |= F_V; |