Skip to content

Commit

Permalink
CPX CPY opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jul 1, 2024
1 parent 4979778 commit a487568
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions src/huc6280_opcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,8 @@ void HuC6280::OPCode0xBF()

void HuC6280::OPCode0xC0()
{
// CPY #$n
// OK
// CPY #nn
OPCodes_CMP(&m_Y, ImmediateAddressing());
}

Expand Down Expand Up @@ -1329,7 +1330,8 @@ void HuC6280::OPCode0xC3()

void HuC6280::OPCode0xC4()
{
// CPY $n
// OK
// CPY ZZ
OPCodes_CMP(&m_Y, m_memory->Read(ZeroPageAddressing()));
}

Expand Down Expand Up @@ -1381,7 +1383,8 @@ void HuC6280::OPCode0xCB()

void HuC6280::OPCode0xCC()
{
// CPY $nn
// OK
// CPY hhll
OPCodes_CMP(&m_Y, m_memory->Read(AbsoluteAddressing()));
}

Expand Down Expand Up @@ -1517,7 +1520,8 @@ void HuC6280::OPCode0xDF()

void HuC6280::OPCode0xE0()
{
// CPX #$n
// OK
// CPX #nn
OPCodes_CMP(&m_X, ImmediateAddressing());
}

Expand All @@ -1543,7 +1547,8 @@ void HuC6280::OPCode0xE3()

void HuC6280::OPCode0xE4()
{
// CPX $n
// OK
// CPX ZZ
OPCodes_CMP(&m_X, m_memory->Read(ZeroPageAddressing()));
}

Expand Down Expand Up @@ -1592,7 +1597,8 @@ void HuC6280::OPCode0xEB()

void HuC6280::OPCode0xEC()
{
// CPX $nn
// OK
// CPX hhll
OPCodes_CMP(&m_X, m_memory->Read(AbsoluteAddressing()));
}

Expand Down
4 changes: 2 additions & 2 deletions src/huc6280_timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const u8 k_opcode_tstates[256] =
/* 0x90 */ 2, 6, 2, 6, 4, 4, 4, 4, 2, 5, 2, 5, 5, 5, 5, 6,
/* 0xA0 */ 2, 6, 2, 6, 3, 3, 3, 3, 2, 2, 2, 2, 4, 4, 4, 6,
/* 0xB0 */ 2, 5, 2, 5, 4, 4, 4, 4, 2, 4, 2, 4, 4, 4, 4, 6,
/* 0xC0 */ 2, 7, 2, 8, 3, 4, 5, 5, 2, 2, 2, 2, 4, 5, 6, 6,
/* 0xC0 */ 2, 7, 2, 8, 4, 4, 5, 5, 2, 2, 2, 2, 5, 5, 6, 6,
/* 0xD0 */ 2, 7, 7, 8, 4, 4, 6, 6, 2, 5, 2, 7, 4, 5, 7, 6,
/* 0xE0 */ 2, 6, 2, 8, 3, 3, 5, 5, 2, 2, 2, 2, 4, 4, 6, 6,
/* 0xE0 */ 2, 6, 2, 8, 4, 3, 5, 5, 2, 2, 2, 2, 5, 4, 6, 6,
/* 0xF0 */ 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 6
};

Expand Down

0 comments on commit a487568

Please sign in to comment.