From 77c065f972ffdd7af2ec87247b3113eab793d611 Mon Sep 17 00:00:00 2001 From: leslie Date: Sat, 5 Jan 2008 11:51:27 +0100 Subject: [PATCH] nagra: add NX protection to emu --- systems/nagra/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/systems/nagra/cpu.c b/systems/nagra/cpu.c index c84dd4d..b4b34c0 100644 --- a/systems/nagra/cpu.c +++ b/systems/nagra/cpu.c @@ -405,6 +405,10 @@ int c6805::Run(int max_count) PRINTF(L_SYS_EMU,"stack underflow (count=%d)",count); return 1; } + if(pc>0x0400 && mapMap[pc+PAGEOFF(pc,cr)]==0) { + PRINTF(L_SYS_EMU,"NX protection at %04x (count=%d)",pc,count); + return 1; + } count++; if(!LOG(L_SYS_DISASM) && LOG(L_SYS_DISASM80)) { @@ -977,9 +981,11 @@ int c6805::Run(int max_count) case 0x31: case 0x32: PRINTF(L_SYS_EMU,"pre-byte %02x in command decoding (count=%d)",ins,count); + loglb->cLineBuff::Flush(); return 3; default: PRINTF(L_SYS_EMU,"unsupported instruction 0x%02x (count=%d)",ins,count); + loglb->cLineBuff::Flush(); return 3; } -- 2.39.5