From d31aed21b27fbda68abe088d657ba18455607cc4 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Mon, 17 Aug 2020 20:37:44 -0400 Subject: - Fixed some bugs in the emulator's assembler. - Simplified the effective address functions. - Made SuBEditor a bit faster. - JSR, and RTS now support using the RS prefix, which is used to specify the return address size, with an RS prefix of 0 being a return address size of 64 bits, rather than 8 bits. --- sux.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sux.c') diff --git a/sux.c b/sux.c index 9442cd4..62ef371 100644 --- a/sux.c +++ b/sux.c @@ -201,7 +201,7 @@ void *run(void *args) { step = 1; } if (isrw(opcode) && am != REL) { - value = read_value(cpu, address.u64, size, 1, check_io); + value.u64 = read_value(cpu, address.u64, size, 1, check_io); } } switch(opcode) { @@ -474,7 +474,7 @@ void *run(void *args) { case JSR_IN: /* JSR Indirect. */ case JSR_AB: /* Jump to SubRoutine. */ case JSR_Z: /* JSR Zero Matrix. */ - push(cpu, cpu->pc, 7, thread); + push(cpu, cpu->pc, (size) ? size : 7, thread); cpu->pc = address.u64; break; case INC_AB: /* INC Absolute. */ @@ -484,9 +484,10 @@ void *run(void *args) { case NOP_IMP: /* No OPeration. */ break; case RTI_IMP: /* ReTurn from Interrupt routine. */ - cpu->ps.u64 = pull(cpu, 0, thread); + cpu->ps.u8[thread] = pull(cpu, 0, thread); + size = 0; case RTS_IMP: /* ReTurn from Subroutine. */ - cpu->pc = pull(cpu, 7, thread); + cpu->pc = pull(cpu, (size) ? size : 7, thread); break; case DEC_AB: /* DEC Absolute. */ case DEC_Z: /* DEC Zero Matrix. */ @@ -513,6 +514,10 @@ void *run(void *args) { default: break; } + /*if (cpu->pc <= 0xFF) { + step = 1; + wrefresh(scr); + }*/ #if !IO ins++; #endif @@ -534,7 +539,7 @@ void *run(void *args) { #if getclk wprintw(scr, ", Clock cycles: %"PRIu64, cpu->clk); #endif - if (step && !subdbg) { + if (step || !subdbg) { wrefresh(scr); } #if keypoll -- cgit v1.2.3-13-gbd6f