unsigned SWIFT_GetDynamicDeviceData (void) { memset (&RMI, 0, sizeof(RMI)); RMI.ax = 0x53C2; // SWIFT: Get Dynamic Device Data MouseInt (&RMI); return ((unsigned)RMI.ax); }
int SWIFT_GetStaticDeviceInfo (SWIFT_StaticData far *psd) { memset (&RMI, 0, sizeof (RMI)); RMI.ax = 0x53C1; // SWIFT: Get Static Device Data RMI.es = segment; // DOS buffer real-mode segment RMI.dx = 0; // " " " " offset MouseInt (&RMI); // get data into DOS buffer *psd = *(SWIFT_StaticData *)pdosmem; // then copy into caller's buffer return (RMI.ax == 1); // return success }
void SWIFT_TactileFeedback (int d, int on, int off) { // Use DPMI call 300h to issue mouse interrupt memset (&RMI, 0, sizeof(RMI)); RMI.ax = 0x5330; // SWIFT: Get Position & Buttons RMI.bx = (on / 5) << 8 + (off / 5); RMI.cx = d / 40; MouseInt (&RMI); #ifdef DBUG SoftError( "SWIFT_TactileFeedback (dur=%d ms, on=%d ms, off=%d ms)\n", d / 40 * 40, on/5*5, off/5*5); #endif }
void SWIFT_Get3DStatus (SWIFT_3DStatus far *pstat) { #ifdef DBUG if (!fActive) { SoftError( "SWIFT_Get3DStatus: SWIFT module not active!\n"); } #endif memset (&RMI, 0, sizeof (RMI)); RMI.ax = 0x5301; RMI.es = segment; RMI.dx = 0; MouseInt(&RMI); *pstat = *(SWIFT_3DStatus *)pdosmem; }
static char MouInit( void ) { char savedmode; unsigned short off, i, j, s1, s2; int ret; static int first_time = true; Points = _POINTS; /* MASSIVE KLUDGE: It turns out that the DOS debugger ends up calling MouInit & MouDeInit every time a screen swap occurs (no matter what the flipping mechanism is). Doing the mouse driver initialization every time is extremely slow. Things seem to work if we only do the driver initialization the first time through. Talk to Brian Stecher/John Dahms if you run into problems with not doing the initialization all the time. */ if( first_time ) { first_time = false; savedmode = _peekb( BIOS_PAGE, 0x49 ); /* Save video mode */ _pokeb( BIOS_PAGE, 0x49, 6 ); /* Set magic mode */ ret = MouseInt( 0, 0, 0, 0 ); /* Reset driver for change */ _pokeb( BIOS_PAGE, 0x49, savedmode ); /* Put the old mode back */ if( ret != -1 ) { return( false ); } } SetSequencer(); /* Program the sequencer */ off = 0; for( i = 0; i < 2; i++ ) { s1 = ( DEFCHAR + i ) * 32; s2 = ( DEFCHAR2 + i ) * 32; for( j = 0; j < Points; j++ ) { SaveDefs[off++] = _peekb( 0xa000, s2++ ); SaveDefs[off++] = _peekb( 0xa000, s1++ ); } } ResetSequencer(); return( true ); }
bool UIAPI uiinitgmouse( int install ) { MouseInstalled = false; if( install > 0 && installed( BIOS_MOUSE ) ) { if( install > 1 ) { if( CheckEgaVga() ) { if( MouInit() ) { UIData->mouse_yscale = _POINTS; UIData->mouse_xscale = 8; } else { install = 0; } } else if( MouseInt( 0, 0, 0, 0 ) != -1 ) { install = 0; } } if( install > 0 ) { setupmouse(); } } return( MouseInstalled ); }