- [NEW] Simbols de sistema de la Atari 2600 inclosos
- [FIX] opcodes accesibles - [NEW] El desensamblador ja no mostra parts del mapa de memòria que no son RAM o ROM - [FIX] Ja se mostren gràficament tots els branch - [NEW] memdebuginfo de tots els dispositius mapejats disponible
This commit is contained in:
+24
-4
@@ -5,6 +5,7 @@
|
||||
#include "mem.h"
|
||||
#include "6502m.h"
|
||||
#include "6502dis.h"
|
||||
#include "6502_opcodes.h"
|
||||
#include "display.h"
|
||||
#include "ui.h"
|
||||
#include "ui_window.h"
|
||||
@@ -435,6 +436,8 @@ namespace m6502debugger
|
||||
|
||||
void printDissasemblerLine(const uint16_t address, const int line, const bool heuristics=false)
|
||||
{
|
||||
const bool isMemory = mem::debug::getInfo(address).memType & mdtMemory;
|
||||
|
||||
uint8_t colors[4] = { COLOR_RED, COLOR_CYAN, COLOR_WHITE, COLOR_WHITE};
|
||||
const uint8_t tag = tags[address];
|
||||
if ( !(tag & (MEMTAG_TINST | MEMTAG_TREPEAT)) ) colors[3]=COLOR_GRAY;
|
||||
@@ -448,6 +451,8 @@ namespace m6502debugger
|
||||
if (breakpoints[address]&9) ui::printtxt(0,line,"*", colors[0]);
|
||||
ui::printtxt(1,line,tohex(address,4), colors[1]);
|
||||
|
||||
if (!isMemory) return;
|
||||
|
||||
if ( (tag & MEMTAG_INST) || heuristics ) {
|
||||
const char *sym = m6502dis::getSymbol(address);
|
||||
if (sym[0]!=0) ui::printtxt(7,line, sym, COLOR_YELLOW);
|
||||
@@ -493,20 +498,21 @@ namespace m6502debugger
|
||||
printDissasemblerLine(pc, (num_lines/2)-1, true);
|
||||
|
||||
for (int i=num_lines/2;i<num_lines;++i) {
|
||||
pos += m6502dis::getOpcodeSize(pos);
|
||||
pos += mem::debug::getInfo(pos).memType&mdtMemory ? m6502dis::getOpcodeSize(pos) : 1;
|
||||
line_address[i] = pos;
|
||||
printDissasemblerLine(pos, i, true);
|
||||
}
|
||||
|
||||
pos = pc;
|
||||
for (int i=(num_lines/2)-2;i>=0;--i) {
|
||||
pos = find_previous_opcode(pos);
|
||||
pos = mem::debug::getInfo(pos).memType&mdtMemory ? find_previous_opcode(pos) : 1;
|
||||
line_address[i] = pos;
|
||||
printDissasemblerLine(pos, i, true);
|
||||
}
|
||||
|
||||
for (int i=0;i<num_lines;++i) {
|
||||
if (mem::read(line_address[i])==0xd0) {
|
||||
if (m6502::opcodes::instructions[m6502::opcodes::opcodeDescriptors[mem::read(line_address[i])].instr].group == m6502::opcodes::fgBranch) {
|
||||
// if (mem::read(line_address[i])==0xd0) {
|
||||
int8_t offset = mem::read(line_address[i]+1);
|
||||
uint16_t target_address = line_address[i] + 2 + offset;
|
||||
if (offset<0) {
|
||||
@@ -526,7 +532,21 @@ namespace m6502debugger
|
||||
ui::printvline(17,i,-1,COLOR_RED);
|
||||
}
|
||||
} else {
|
||||
|
||||
int j = i;
|
||||
while (j<num_lines){
|
||||
if (line_address[j] == target_address) {
|
||||
ui::printhline(17,i,18,COLOR_RED);
|
||||
ui::printhline(17,j,18,COLOR_RED);
|
||||
ui::printvline(17,i,j,COLOR_RED);
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
if (j==num_lines) {
|
||||
ui::printhline(17,i,18,COLOR_RED);
|
||||
//ui::printhline(17,0,18,COLOR_RED);
|
||||
ui::printvline(17,i,num_lines,COLOR_RED);
|
||||
}
|
||||
}
|
||||
//ui::printtxt(6,i,tohex(target_address,4),COLOR_BLACK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user