summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index e69eb77..c97aab3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -91,8 +91,19 @@ int main(int argc, char *argv[])
while(!quit)
{
+ Z80State s1,s2;
+
+ Z80GetState(z80,&s1);
Z80SingleStep(z80);
+ Z80GetState(z80,&s2);
+
+ if (s2.PC>0x3fff)
+ {
+ printf("PC > 0x3fff - from 0x%4.4x\n",s1.PC);
+ return 0;
+ }
+
if (trace)
{
DisplayState(z80);