summaryrefslogtreecommitdiff
path: root/disasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'disasm.c')
-rw-r--r--disasm.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/disasm.c b/disasm.c
index db43acf..5ccede4 100644
--- a/disasm.c
+++ b/disasm.c
@@ -74,7 +74,7 @@ void disasm(struct sux *cpu, uint64_t *operands, uint8_t lines, uint8_t opcode,
uint8_t iscursor = 0;
union reg ptr;
uint32_t adr;
- wmove(scr, 30, 0);
+ /*wmove(scr, 30, 0);
wclrtoeol(scr);
adr = 0x25;
ptr.u8[0] = addr[adr+0]; ptr.u8[1] = addr[adr+1];
@@ -99,7 +99,7 @@ void disasm(struct sux *cpu, uint64_t *operands, uint8_t lines, uint8_t opcode,
ptr.u8[2] = addr[adr+2]; ptr.u8[3] = addr[adr+3];
ptr.u8[4] = addr[adr+4]; ptr.u8[5] = addr[adr+5];
ptr.u8[6] = addr[adr+6]; ptr.u8[7] = addr[adr+7];
- wprintw(scr, ", idx0: $%04"PRIX64, ptr.u64);
+ wprintw(scr, ", idx0: $%04"PRIX64, ptr.u64);*/
if (address == CTRL_ADDR || addr[STEP_ADDR]) {
mvwprintw(scr, 29, 0, "address: $%04"PRIX64", scr_row: %02u, scr_col: %02u, scr_str: %02u, scr_end: %02u\r", address, addr[0], addr[1], addr[0x22], addr[0x23]);
adr = 0x30000;
@@ -108,13 +108,15 @@ void disasm(struct sux *cpu, uint64_t *operands, uint8_t lines, uint8_t opcode,
for (uint8_t i = 0; i < 16; i++) {
wprintw(scr, "%02X", addr[adr+i]);
}
- mvwprintw(scr, ln++, 0, "buffer:\r");
+ mvwprintw(scr, ln++, 0, "buffer: ");
wmove(scr, ln++, 0);
- for (uint8_t i = 0; i < 10; i++) {
- line_idx = (i << 6) + (i << 4);
+ uint8_t maxrow = 10;
+ int line_offset = (addr[0]-(maxrow-1) >= 0) ? addr[0]-(maxrow-1) : 0;
+ for (uint8_t i = 0; i < maxrow; i++) {
+ line_idx = (i+addr[0x22]+line_offset << 6) + (i+addr[0x22]+line_offset << 4);
for (uint8_t j = 0; j < 0x50; j++) {
wprintw(scr, "%02X", addr[tmpad+j+line_idx]);
- if ((addr[0]+addr[0x22]) == i && addr[1] == j) {
+ if ((addr[0] == i+line_offset) && addr[1] == j) {
iscursor=1;
getyx(scr,row, col);
wmove(scr, ln++, 0);
@@ -133,19 +135,27 @@ void disasm(struct sux *cpu, uint64_t *operands, uint8_t lines, uint8_t opcode,
wmove(scr, ln++, 0);
}
}
- /*if (address == 0x4000 || tmpaddr == 0x4000 || addr[STEP_ADDR]) {
- ln = 46;
- tmpad = 0x4000;
- line_idx = 0;
- mvwprintw(scr, ln++, 0, "cmd_buf:");
- for (uint8_t i = 0; i < 5; i++) {
- wmove(scr, ln++, 0);
- line_idx = (i << 4)+(i << 6);
- for (uint8_t j = 0; j < 0x50; j++) {
- wprintw(scr, "%02X", addr[tmpad+j+line_idx]);
- }
- wprintw(scr, ", i: %02X", i);
+ /*
+ wmove(scr, 47, 0);
+ wclrtoeol(scr);
+ wprintw(scr, "a: $%02X,", addr[0x0A]);
+ wprintw(scr, " b: $%02X,", addr[0x0B]);
+ wprintw(scr, " c: $%02X,", addr[0x0C]);
+ wprintw(scr, " d: $%02X,", addr[0x0D]);
+ wprintw(scr, " e: $%02X,", addr[0x0E]);
+ wprintw(scr, " f: $%02X", addr[0x0F]);
+ tmpad = 0x33000;
+ line_idx = 0;
+ wprintw(scr, "cmd_buf:");
+ for (uint8_t i = 0; i < 1; i++) {
+ wmove(scr, ln++, 0);
+ 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, ", i: %02X", i);
}*/
+
}
}