From: leslie Date: Sat, 5 Jan 2008 10:51:27 +0000 (+0100) Subject: nagra: add NX protection to emu X-Git-Tag: 0.8.7~14 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=77c065f972ffdd7af2ec87247b3113eab793d611;p=sasc-ng.git nagra: add NX protection to emu --- 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; }