summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-05-03 18:50:16 -0700
committerMike Pavone <pavone@retrodev.com>2013-05-03 18:50:16 -0700
commit85fa29f181f53537d539f58e07e9b319ddeb9a7b (patch)
treed0cc29d6de17e14dab5e51df2eb0bb3faa20151c
parent9b49e9e115489fcfdd18ff0b46e554625746de6e (diff)
Fix crash bug in Z80 interrupt support
-rw-r--r--blastem.c2
-rw-r--r--zruntime.S1
2 files changed, 2 insertions, 1 deletions
diff --git a/blastem.c b/blastem.c
index bcca8c7..05ef5ae 100644
--- a/blastem.c
+++ b/blastem.c
@@ -133,7 +133,7 @@ uint8_t busreq = 0;
uint8_t busack = 0;
uint32_t busack_cycle = CYCLE_NEVER;
uint8_t new_busack = 0;
-
+//#define DO_DEBUG_PRINT
#ifdef DO_DEBUG_PRINT
#define dprintf printf
#define dputs puts
diff --git a/zruntime.S b/zruntime.S
index ed1b397..02f817b 100644
--- a/zruntime.S
+++ b/zruntime.S
@@ -38,6 +38,7 @@ z80_handle_cycle_limit_int:
shr $8, %r13w
call z_inccycles
call z80_write_byte_noinc
+ pop %r14 /*dispose of return address */
/* TODO: Support interrupt mode 0 and 2 */
mov $0x38, %r13w
call z80_native_addr