- [FIX] Inicalitzar el buffer on es va escrivint la linea de desensamblat
This commit is contained in:
1 parent
f1e29d1904
commit
1dddc11722
1 file changed
+7
-4
@@ -451,10 +451,13 @@ namespace m6502debugger
|
||||
uint8_t column = 31;
|
||||
uint8_t colors[4] = {COLOR_PURPLE, COLOR_TEAL, COLOR_GRAY, COLOR_ORANGE};
|
||||
if (confirmed) for (int i=0; i<4; ++i) colors[i] += 8; //{COLOR_MAGENTA, COLOR_BLUE, COLOR_WHITE, COLOR_YELLOW};
|
||||
|
||||
m6502::opcodes::opcodeProperties op = m6502::opcodes::opcodeDescriptors[mem::read(address)];
|
||||
|
||||
const char *opcode_name = m6502::opcodes::instructions[op.instr].name;
|
||||
ui::printtxt(column,line, opcode_name, colors[0]);
|
||||
column += strlen(opcode_name)+1;
|
||||
|
||||
const char *opcode_prefix = m6502::opcodes::addressingModes[op.addrMode].preText;
|
||||
const char *opcode_postfix = m6502::opcodes::addressingModes[op.addrMode].postText;
|
||||
if (strlen(opcode_prefix)>0) {
|
||||
@@ -462,16 +465,16 @@ namespace m6502debugger
|
||||
column += strlen(opcode_prefix);
|
||||
}
|
||||
|
||||
char buffer[256];
|
||||
char buffer[256]; buffer[0] = 0;
|
||||
uint16_t value = 0;
|
||||
const uint8_t len = m6502::opcodes::addressingModes[op.addrMode].length;
|
||||
if (len>1) {
|
||||
value = mem::read(address+1);
|
||||
if (len>2) value |= (mem::read(address+2) << 8);
|
||||
|
||||
if (op.addrMode != m6502::opcodes::amImmediate && op.addrMode != m6502::opcodes::amRelative &&
|
||||
( m6502::opcodes::instructions[op.instr].group == m6502::opcodes::fgLoadStore || m6502::opcodes::instructions[op.instr].group == m6502::opcodes::fgJumpCall )) {
|
||||
if (m6502dis::symbols::get(value)[0]!=0) {
|
||||
if ( (op.addrMode != m6502::opcodes::amImmediate) && (op.addrMode != m6502::opcodes::amRelative) &&
|
||||
( (m6502::opcodes::instructions[op.instr].group == m6502::opcodes::fgLoadStore) || (m6502::opcodes::instructions[op.instr].group == m6502::opcodes::fgJumpCall) ) ) {
|
||||
if (m6502dis::symbols::get(value)[0] != 0) {
|
||||
sprintf(buffer, "%s", m6502dis::symbols::get(value));
|
||||
ui::printtxt(column,line, buffer, colors[2]);
|
||||
column += strlen(buffer);
|
||||
|
||||
Reference in new issue
Block a user