3 * Code to detect the surrounding DOS/Windows environment and support routines to work with it
4 * (C) 2009-2012 Jonathan Campbell.
5 * Hackipedia DOS library.
7 * This code is licensed under the LGPL.
8 * <insert LGPL legal text here>
16 #include <conio.h> /* this is where Open Watcom hides the outp() etc. functions */
26 #include <hw/cpu/cpu.h>
27 #include <hw/dos/dos.h>
28 #include <hw/dos/doswin.h>
29 #include <hw/dos/dosntvdm.h>
31 #if !defined(TARGET_WINDOWS) && TARGET_MSDOS == 16
33 /* NTS: This only allows for exception interrupts 0x00-0x1F */
34 void far *dpmi_getexhandler(unsigned char n) {
35 unsigned short s=0,o=0;
50 /* NTS: This only allows for exception interrupts 0x00-0x1F */
51 int dpmi_setexhandler(unsigned char n,void far *x) {
52 unsigned short s=FP_SEG(x),o=FP_OFF(x);
71 #if !defined(TARGET_WINDOWS) && TARGET_MSDOS == 32
73 /* NTS: This only allows for exception interrupts 0x00-0x1F */
74 void far *dpmi_getexhandler(unsigned char n) {
91 /* NTS: This only allows for exception interrupts 0x00-0x1F */
92 int dpmi_setexhandler(unsigned char n,void far *x) {
93 unsigned short s=FP_SEG(x);
94 unsigned int o=FP_OFF(x);