Commit

Comments (0)

Files changed (4)

File UniPCemu/cpu/cpu.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 				{
 					memset(&CPU[activeCPU].instructionfetch,0,sizeof(CPU[activeCPU].instructionfetch)); //Finished fetching!
 					CPU[activeCPU].instructionfetch.CPU_isFetching = CPU[activeCPU].instructionfetch.CPU_fetchphase = 1; //Start fetching the next instruction when available(not repeating etc.)!
-					CPU[activeCPU].executed = 1; //We're counting as an finished instruction!
+					CPU[activeCPU].executed = 0; //We're counting as an unfinished instruction to handle the fault!
 				}
 				goto fetchinginstruction; //Process prefix(es) and read OPCode!
 			}

File UniPCemu/cpu/cpu_execution.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 void CPU_executionphase_taskswitch() //Are we to switch tasks?
 {
 	//TODO: Execute task switch!
-	if (CPU_switchtask(TASKSWITCH_INFO.whatsegment, &TASKSWITCH_INFO.LOADEDDESCRIPTOR,TASKSWITCH_INFO.segment, TASKSWITCH_INFO.destinationtask, TASKSWITCH_INFO.isJMPorCALL, TASKSWITCH_INFO.gated, TASKSWITCH_INFO.errorcode)==0) //Finished task switch?
+	if (CPU_switchtask(TASKSWITCH_INFO.whatsegment, &TASKSWITCH_INFO.LOADEDDESCRIPTOR,TASKSWITCH_INFO.segment, TASKSWITCH_INFO.destinationtask, TASKSWITCH_INFO.isJMPorCALL, TASKSWITCH_INFO.gated, TASKSWITCH_INFO.errorcode)!=0) //Unfinished task switch?
 	{
-		CPU[activeCPU].executed = 1; //Finished and ready for execution!
+		CPU[activeCPU].executed = 0; //Finished and ready for execution!
 	}
 }
 

File UniPCemu/cpu/cpu_interrupts.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 {
 	char errorcodestr[256];
 	word destCS;
-	CPU_interruptraised = 1; //We've raised an interrupt!
 	CPU[activeCPU].executed = 0; //Default: still busy executing!
+	CPU_interruptraised = 1; //We've raised an interrupt!
 	if (getcpumode()==CPU_MODE_REAL) //Use IVT structure in real mode only!
 	{
 		if (CPU[activeCPU].registers->IDTR.limit<((intnr<<2)|3)) //IVT limit too low?

File UniPCemu/cpu/multitasking.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 			hascallinterrupttaken_type = OTHERGATE_NORMALTSS; //Normal TSS direct call!
 		}
 	}
-
-	CPU[activeCPU].executed = 1; //We've executed, start any post-instruction stuff!
-	return 0; //Abort any running instruction operation!
+	return 0; //Abort any running instruction operation, finish up!
 }
 
 void CPU_TSSFault(word segmentval, byte is_external, byte tbl)