From a7ff891008b7c7320819333d5f0b7837e0b11d1b Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 12 Apr 2010 23:51:36 +0300 Subject: [PATCH] Report #NP if segment (O16 A16 CALL FAR) is not present This allows Jazz Jackrabbit to get to GFX mode switch. --- org/jpc/emulator/memory/codeblock/optimised/ProtectedModeUBlock.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org/jpc/emulator/memory/codeblock/optimised/ProtectedModeUBlock.java b/org/jpc/emulator/memory/codeblock/optimised/ProtectedModeUBlock.java index 64dea49..2ea0172 100644 --- a/org/jpc/emulator/memory/codeblock/optimised/ProtectedModeUBlock.java +++ b/org/jpc/emulator/memory/codeblock/optimised/ProtectedModeUBlock.java @@ -4841,6 +4841,9 @@ System.err.println("Accessed LDT selector global byte 5:" + cpu.readSupervisorBy case 0x1a: // Non-conforming Code Segment case 0x1b: // Non-conforming Code Segment { + if(!newSegment.isPresent()) + throw new ProcessorException(ProcessorException.Type.NOT_PRESENT, newSegment.getSelector(), true); + if ((cpu.esp < 4) && (cpu.esp > 0)) throw ProcessorException.STACK_SEGMENT_0; -- 2.11.4.GIT