Refine stack overflow and underflow for the fpu a bit.
Overflow is still treated as Exit. Underflow is ignored in release mode as it happens every now and then and doesn't seem to cause issues if ignored, thus restoring 0.74 behaviour. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4199
This commit is contained in:
parent
c9c97f13af
commit
4a1ef4d3d7
3 changed files with 96 additions and 5 deletions
|
@ -19,6 +19,11 @@
|
|||
#ifndef DOSBOX_FPU_H
|
||||
#define DOSBOX_FPU_H
|
||||
|
||||
#ifndef DOSBOX_DOSBOX_H
|
||||
//So the right config.h gets included for C_DEBUG
|
||||
#include "dosbox.h"
|
||||
#endif
|
||||
|
||||
#ifndef DOSBOX_MEM_H
|
||||
#include "mem.h"
|
||||
#endif
|
||||
|
@ -150,5 +155,22 @@ static INLINE void FPU_SET_C3(Bitu C){
|
|||
if(C) fpu.sw |= 0x4000;
|
||||
}
|
||||
|
||||
#define DB_FPU_STACK_CHECK_NONE 0
|
||||
#define DB_FPU_STACK_CHECK_LOG 1
|
||||
#define DB_FPU_STACK_CHECK_EXIT 2
|
||||
//NONE is 0.74 behavior: not care about stack overflow/underflow
|
||||
//Overflow is always logged/exited on.
|
||||
//Underflow can be controlled with by this.
|
||||
//LOG is giving a message when encountered
|
||||
//EXIT is to hard exit.
|
||||
//Currently pop is ignored in release mode and overflow is exit.
|
||||
//in debug mode: pop will log and overflow is exit.
|
||||
#if C_DEBUG
|
||||
#define DB_FPU_STACK_CHECK_POP DB_FPU_STACK_CHECK_LOG
|
||||
#define DB_FPU_STACK_CHECK_PUSH DB_FPU_STACK_CHECK_EXIT
|
||||
#else
|
||||
#define DB_FPU_STACK_CHECK_POP DB_FPU_STACK_CHECK_NONE
|
||||
#define DB_FPU_STACK_CHECK_PUSH DB_FPU_STACK_CHECK_EXIT
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue