Skip to content

Commit

Permalink
fix trace hex output 02X 04X transpositions
Browse files Browse the repository at this point in the history
  • Loading branch information
davervw committed May 6, 2024
1 parent 89d880c commit 58a78f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions emu6502.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,37 +923,37 @@ void Emu6502::Ind(char *dis, int dis_size, const char* opcode, ushort addr, usho
*p_bytes = 3;
ushort addr1 = (ushort)(GetMemory((ushort)(addr + 1)) | (GetMemory((ushort)(addr + 2)) << 8));
*p_addr2 = (ushort)(GetMemory(addr1) | (GetMemory((ushort)(addr1 + 1)) << 8));
snprintf(dis, dis_size, "%s ($%0X4)", opcode, addr1);
snprintf(dis, dis_size, "%s ($%04X)", opcode, addr1);
}

void Emu6502::IndX(char *dis, int dis_size, const char* opcode, ushort addr, byte *p_bytes)
{
*p_bytes = 2;
snprintf(dis, dis_size, "%s ($%0X2,X)", opcode, GetMemory((ushort)(addr + 1)));
snprintf(dis, dis_size, "%s ($%02X,X)", opcode, GetMemory((ushort)(addr + 1)));
}

void Emu6502::IndY(char *dis, int dis_size, const char* opcode, ushort addr, byte *p_bytes)
{
*p_bytes = 2;
snprintf(dis, dis_size, "%s ($%0X2),Y", opcode, GetMemory((ushort)(addr + 1)));
snprintf(dis, dis_size, "%s ($%02X),Y", opcode, GetMemory((ushort)(addr + 1)));
}

void Emu6502::ZP(char *dis, int dis_size, const char* opcode, ushort addr, byte *p_bytes)
{
*p_bytes = 2;
snprintf(dis, dis_size, "%s $%0X2", opcode, GetMemory((ushort)(addr + 1)));
snprintf(dis, dis_size, "%s $%02X", opcode, GetMemory((ushort)(addr + 1)));
}

void Emu6502::ZPX(char *dis, int dis_size, const char* opcode, ushort addr, byte *p_bytes)
{
*p_bytes = 2;
snprintf(dis, dis_size, "%s $%0X2,X", opcode, GetMemory((ushort)(addr + 1)));
snprintf(dis, dis_size, "%s $%02X,X", opcode, GetMemory((ushort)(addr + 1)));
}

void Emu6502::ZPY(char *dis, int dis_size, const char* opcode, ushort addr, byte *p_bytes)
{
*p_bytes = 2;
snprintf(dis, dis_size, "%s $%0X2,Y", opcode, GetMemory((ushort)(addr + 1)));
snprintf(dis, dis_size, "%s $%02X,Y", opcode, GetMemory((ushort)(addr + 1)));
}

void Emu6502::ABS(char *dis, int dis_size, const char* opcode, ushort addr, byte *p_bytes)
Expand Down

0 comments on commit 58a78f9

Please sign in to comment.