diff options
Diffstat (limited to 'disasm.c')
-rw-r--r-- | disasm.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -107,14 +107,15 @@ void disasm(struct sux *cpu, uint8_t lines, uint8_t opcode, uint8_t prefix, uint if (subdbg) { uint8_t ln = 33; uint16_t line_idx = 0; - uint32_t tmpad = 0x31000; + uint32_t tmpad = 0x20237; int row, col; uint8_t iscursor = 0; union reg ptr; ptr.u64 = 0; uint32_t adr; if (address == CTRL_ADDR || addr[STEP_ADDR]) { - adr = 0x30000; + adr = read_value(cpu, 0, tmpad, 7, 0, 0); + tmpad += 8; wprintw(scr, ", scr_row: %02u, scr_col: %02u, scr_str: %02u, scr_end: %02u", addr[0], addr[1], addr[2], addr[3]); wmove(scr, 32, 0); wprintw(scr, "bitabl: "); @@ -125,10 +126,11 @@ void disasm(struct sux *cpu, uint8_t lines, uint8_t opcode, uint8_t prefix, uint wmove(scr, ln++, 0); uint8_t maxrow = 10; int line_offset = (addr[0]-(maxrow-1) >= 0) ? addr[0]-(maxrow-1) : 0; + adr = read_value(cpu, 0, tmpad, 7, 0, 0); for (uint8_t i = 0; i < maxrow; i++) { line_idx = (i+addr[2]+line_offset << 6) + (i+addr[2]+line_offset << 4); for (uint8_t j = 0; j < 0x50; j++) { - wprintw(scr, "%02X", addr[tmpad+j+line_idx]); + wprintw(scr, "%02X", addr[adr+j+line_idx]); if ((addr[0] == i+line_offset) && addr[1] == j) { iscursor=1; getyx(scr,row, col); @@ -183,7 +185,7 @@ void disasm(struct sux *cpu, uint8_t lines, uint8_t opcode, uint8_t prefix, uint wmove(scr, 31, 0); wclrtoeol(scr); - adr = 0x204CA; + adr = 0x200CA; ptr.u64 = read_value(cpu, 0, adr, 3, 0, 0); wprintw(scr, "t_id: $%02X", ptr.u8[0]); wprintw(scr, ", t_type: $%02X", ptr.u8[1]); @@ -209,7 +211,8 @@ void disasm(struct sux *cpu, uint8_t lines, uint8_t opcode, uint8_t prefix, uint wprintw(scr, " d: $%02X,", addr[0x0D]); wprintw(scr, " e: $%02X,", addr[0x0E]); wprintw(scr, " f: $%02X", addr[0x0F]); - tmpad = 0x33000; + tmpad += 8; + adr = read_value(cpu, 0, tmpad, 7, 0, 0); line_idx = 0; wprintw(scr, "cmd_buf:"); for (uint8_t i = 0; i < 1; i++) { @@ -217,7 +220,7 @@ void disasm(struct sux *cpu, uint8_t lines, uint8_t opcode, uint8_t prefix, uint wclrtoeol(scr); line_idx = (i << 4)+(i << 6); for (uint8_t j = 0; j < 0x50; j++) { - wprintw(scr, "%02X", addr[tmpad+j+line_idx]); + wprintw(scr, "%02X", addr[adr+j+line_idx]); } wprintw(scr, ", i: %02X", i); }*/ |