7 #include <conio.h> /* this is where Open Watcom hides the outp() etc. functions */
17 #include <hw/cpu/cpu.h>
18 #include <hw/dos/dos.h>
19 #include <hw/dos/tgusumid.h>
21 #if !defined(TARGET_WINDOWS) && !defined(TARGET_OS2)
22 /* returns interrupt vector */
23 int gravis_ultramid_detect() {
24 unsigned char FAR *ex;
29 #if TARGET_MSDOS == 32
30 o = *((uint16_t*)(i*4U));
31 s = *((uint16_t*)((i*4U)+2U));
33 o = *((uint16_t far*)MK_FP(0,(uint16_t)i*4U));
34 s = *((uint16_t far*)MK_FP(0,((uint16_t)i*4U)+2U));
37 if (o == 0xFFFF || s == 0x0000 || s == 0xFFFF) {
42 /* we're looking for "ULTRAMID" signature */
43 #if TARGET_MSDOS == 32
44 ex = (unsigned char*)((s << 4UL) + 0x103);
45 if (memcmp(ex,"ULTRAMID",8) == 0) return i;
48 if (_fmemcmp(ex,"ULTRAMID",8) == 0) return i;
56 #endif /* !defined(TARGET_WINDOWS) */