summaryrefslogtreecommitdiff
path: root/sux.c
diff options
context:
space:
mode:
Diffstat (limited to 'sux.c')
-rw-r--r--sux.c15
1 files changed, 10 insertions, 5 deletions
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