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 /* Watcom C does not provide getvect/setvect for Win16, so we abuse the DPMI server within and provide one anyway */
32 #if defined(TARGET_WINDOWS) && TARGET_MSDOS == 16
34 /* NTS: This only allows for exception interrupts 0x00-0x1F */
35 void far *win16_getexhandler(unsigned char n) {
36 unsigned short s=0,o=0;
51 /* NTS: This only allows for exception interrupts 0x00-0x1F */
52 int win16_setexhandler(unsigned char n,void far *x) {
53 unsigned short s=FP_SEG(x),o=FP_OFF(x);
70 void far *win16_getvect(unsigned char n) {
71 unsigned short s=0,o=0;
86 /* NTS: This only allows for exception interrupts 0x00-0x1F */
87 int win16_setvect(unsigned char n,void far *x) {
88 unsigned short s=FP_SEG(x),o=FP_OFF(x);