Skip to content

Commit

Permalink
STA STX STY opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jul 2, 2024
1 parent a751ad8 commit 619574d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
45 changes: 29 additions & 16 deletions src/huc6280_opcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ void HuC6280::OPCode0x80()

void HuC6280::OPCode0x81()
{
// STA $(nn,X)
// OK
// STA (ZZ,X)
OPCodes_Store(&m_A, ZeroPageIndexedIndirectAddressing());
}

Expand All @@ -972,19 +973,22 @@ void HuC6280::OPCode0x83()

void HuC6280::OPCode0x84()
{
// STY $n
// OK
// STY ZZ
OPCodes_Store(&m_Y, ZeroPageAddressing());
}

void HuC6280::OPCode0x85()
{
// STA $n
// OK
// STA ZZ
OPCodes_Store(&m_A, ZeroPageAddressing());
}

void HuC6280::OPCode0x86()
{
// STX $n
// OK
// STX ZZ
OPCodes_Store(&m_X, ZeroPageAddressing());
}

Expand Down Expand Up @@ -1025,19 +1029,22 @@ void HuC6280::OPCode0x8B()

void HuC6280::OPCode0x8C()
{
// STY $nn
// OK
// STY hhll
OPCodes_Store(&m_Y, AbsoluteAddressing());
}

void HuC6280::OPCode0x8D()
{
// STA $nn
// OK
// STA hhll
OPCodes_Store(&m_A, AbsoluteAddressing());
}

void HuC6280::OPCode0x8E()
{
// STX $nn
// OK
// STX hhll
OPCodes_Store(&m_X, AbsoluteAddressing());
}

Expand All @@ -1057,15 +1064,16 @@ void HuC6280::OPCode0x90()

void HuC6280::OPCode0x91()
{
// STA ($n),Y
// OK
// STA (ZZ),Y
OPCodes_Store(&m_A, ZeroPageIndirectIndexedAddressing());
}

void HuC6280::OPCode0x92()
{
// UNOFFICIAL
// KILL
UnofficialOPCode();
// OK
// STA (ZZ)
OPCodes_Store(&m_A, ZeroPageIndirectAddressing());
}

void HuC6280::OPCode0x93()
Expand All @@ -1077,19 +1085,22 @@ void HuC6280::OPCode0x93()

void HuC6280::OPCode0x94()
{
// STY $n,X
// OK
// STY ZZ,X
OPCodes_Store(&m_Y, ZeroPageAddressing(&m_X));
}

void HuC6280::OPCode0x95()
{
// STA $n,X
// OK
// STA ZZ,X
OPCodes_Store(&m_A, ZeroPageAddressing(&m_X));
}

void HuC6280::OPCode0x96()
{
// STX $n,Y
// OK
// STX ZZ,Y
OPCodes_Store(&m_X, ZeroPageAddressing(&m_Y));
}

Expand All @@ -1108,7 +1119,8 @@ void HuC6280::OPCode0x98()

void HuC6280::OPCode0x99()
{
// STA $nn,Y
// OK
// STA hhll,Y
OPCodes_Store(&m_A, AbsoluteAddressing(&m_Y));
}

Expand All @@ -1134,7 +1146,8 @@ void HuC6280::OPCode0x9C()

void HuC6280::OPCode0x9D()
{
// STA $nn,X
// OK
// STA hhll,X
OPCodes_Store(&m_A, AbsoluteAddressing(&m_X));
}

Expand Down
6 changes: 3 additions & 3 deletions src/huc6280_timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const u8 k_opcode_tstates[256] =
/* 0x50 */ 2, 7, 7, 8, 4, 4, 6, 7, 2, 5, 3, 7, 4, 5, 7, 6,
/* 0x60 */ 7, 7, 2, 8, 3, 4, 6, 7, 4, 2, 2, 2, 7, 5, 7, 6,
/* 0x70 */ 2, 7, 7, 8, 4, 4, 6, 7, 2, 5, 4, 7, 7, 5, 7, 6,
/* 0x80 */ 2, 6, 2, 6, 3, 3, 3, 7, 2, 2, 2, 2, 4, 4, 4, 6,
/* 0x90 */ 2, 6, 2, 6, 4, 4, 4, 7, 2, 5, 2, 5, 5, 5, 5, 6,
/* 0x80 */ 2, 7, 2, 6, 4, 4, 4, 7, 2, 2, 2, 2, 5, 5, 5, 6,
/* 0x90 */ 2, 7, 7, 6, 4, 4, 4, 7, 2, 5, 2, 5, 5, 5, 5, 6,
/* 0xA0 */ 2, 7, 2, 6, 4, 4, 4, 7, 2, 2, 2, 2, 5, 5, 5, 6,
/* 0xB0 */ 2, 7, 7, 5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