Skip to content

Commit 63ccc46

Browse files
committed
Fix NV flags in BIT imm instruction. Fix #80
1 parent 39a8519 commit 63ccc46

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

src/huc6280.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ class HuC6280
220220
void OPCodes_ASL_Memory(u16 address);
221221
void OPcodes_Branch(bool condition);
222222
void OPCodes_BIT(u16 address);
223-
void OPCodes_BIT_Immediate(u16 address);
224223
void OPCodes_BRK();
225224
void OPCodes_Subroutine();
226225
void OPCodes_CMP(EightBitRegister* reg, u8 value);

src/huc6280_opcodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ void HuC6280::OPCode0x88()
853853
void HuC6280::OPCode0x89()
854854
{
855855
// BIT #nn
856-
OPCodes_BIT_Immediate(m_PC.GetValue());
856+
OPCodes_BIT(m_PC.GetValue());
857857
m_PC.Increment();
858858
}
859859

src/huc6280_opcodes_inline.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,6 @@ INLINE void HuC6280::OPCodes_BIT(u16 address)
158158
m_P.SetValue(flags);
159159
}
160160

161-
INLINE void HuC6280::OPCodes_BIT_Immediate(u16 address)
162-
{
163-
u8 value = m_memory->Read(address);
164-
u8 result = m_A.GetValue() & value;
165-
ClearFlag(FLAG_ZERO);
166-
u8 flags = m_P.GetValue();
167-
flags |= (m_zn_flags_lut[result] & FLAG_ZERO);
168-
m_P.SetValue(flags);
169-
}
170-
171161
INLINE void HuC6280::OPCodes_BRK()
172162
{
173163
u16 pc = m_PC.GetValue();

0 commit comments

Comments
 (0)