1997-10-12 18:30:17 +02:00
|
|
|
/*
|
|
|
|
* BIOS interrupt 15h handler
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* Copyright 1997 Jan Willamowius
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1997-10-12 18:30:17 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2003-11-15 01:13:20 +01:00
|
|
|
#include "dosexe.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2002-11-24 23:34:04 +01:00
|
|
|
#include "wine/winbase16.h"
|
1997-10-12 18:30:17 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(int);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1997-10-12 18:30:17 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
2010-01-04 16:29:19 +01:00
|
|
|
* DOSVM_Int15Handler
|
1997-10-12 18:30:17 +02:00
|
|
|
*
|
2000-08-20 20:47:48 +02:00
|
|
|
* Handler for int 15h
|
1997-10-12 18:30:17 +02:00
|
|
|
*/
|
2010-10-20 15:48:31 +02:00
|
|
|
void WINAPI DOSVM_Int15Handler( CONTEXT *context )
|
1997-10-12 18:30:17 +02:00
|
|
|
{
|
|
|
|
switch(AH_reg(context))
|
|
|
|
{
|
2004-03-25 06:28:54 +01:00
|
|
|
case 0x4f: /*catch keyboard*/
|
2004-04-06 22:14:09 +02:00
|
|
|
FIXME("INT15: intercept keyboard not handled yet\n");
|
|
|
|
break;
|
2004-03-25 06:28:54 +01:00
|
|
|
case 0x83: /* start timer*/
|
|
|
|
switch(AL_reg(context))
|
|
|
|
{
|
|
|
|
case 0x00: /* Start Timer*/
|
|
|
|
FIXME("INT15: Start Timer not handled yet\n");
|
|
|
|
break;
|
|
|
|
case 0x01: /* stop timer*/
|
|
|
|
FIXME("INT15: Stop Timer not handled yet\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2000-08-20 20:47:48 +02:00
|
|
|
case 0x84: /* read joystick information */
|
|
|
|
FIXME("Read joystick information not implemented\n");
|
|
|
|
|
|
|
|
/* FIXME: report status as if no game port exists */
|
|
|
|
switch(DX_reg(context))
|
|
|
|
{
|
|
|
|
case 0x0: /* read joystick switches */
|
2002-08-31 20:47:00 +02:00
|
|
|
SET_AL( context, 0x0 ); /* all switches open */
|
2000-08-20 20:47:48 +02:00
|
|
|
break;
|
|
|
|
case 0x1: /* read joystick position */
|
2002-08-31 20:47:00 +02:00
|
|
|
SET_AX( context, 0x0 );
|
|
|
|
SET_BX( context, 0x0 );
|
|
|
|
SET_CX( context, 0x0 );
|
|
|
|
SET_DX( context, 0x0 );
|
2000-08-20 20:47:48 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
INT_BARF( context, 0x15 );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
RESET_CFLAG(context);
|
|
|
|
break;
|
2004-03-25 06:28:54 +01:00
|
|
|
case 0x85: /* sysreq - key used*/
|
|
|
|
FIXME("INT15: SysReq - Key not handled yet\n");
|
|
|
|
break;
|
|
|
|
case 0x86: /* wait*/
|
|
|
|
FIXME("INT15: Wait not correctly handled yet\n");
|
2005-11-10 13:14:56 +01:00
|
|
|
if ( AL_reg( context ) != 0x00 ) ERR("Invalid Input to Int15 function 0x86h AL != 0x00\n");
|
2004-03-25 06:28:54 +01:00
|
|
|
break;
|
|
|
|
case 0x87: /* move memory regions*/
|
|
|
|
FIXME("INT15: Move memory regions not implemented\n");
|
|
|
|
break;
|
2000-08-20 20:47:48 +02:00
|
|
|
|
1997-10-12 18:30:17 +02:00
|
|
|
case 0x88: /* get size of memory above 1 M */
|
2002-08-31 20:47:00 +02:00
|
|
|
SET_AX( context, 64 ); /* FIXME: are 64K ok? */
|
1997-10-12 18:30:17 +02:00
|
|
|
RESET_CFLAG(context);
|
|
|
|
break;
|
2004-04-06 22:14:09 +02:00
|
|
|
case 0x89: /* Switch to protected mode*/
|
|
|
|
FIXME("INT15: switching to protected mode not supported\n");
|
|
|
|
break;
|
|
|
|
case 0x90:/* OS hook - Device busy*/
|
|
|
|
FIXME("INT15: OS hook - device busy\n");
|
|
|
|
break;
|
|
|
|
case 0x91: /* OS hook - Device post*/
|
|
|
|
FIXME("INT15: OS hook - device post\n");
|
|
|
|
break;
|
1997-10-12 18:30:17 +02:00
|
|
|
|
1999-01-24 10:32:10 +01:00
|
|
|
case 0xc0: /* GET CONFIGURATION */
|
2002-11-24 23:34:04 +01:00
|
|
|
{
|
|
|
|
/* KERNEL.194: __F000H - protected mode selector */
|
|
|
|
FARPROC16 proc = GetProcAddress16( GetModuleHandle16("KERNEL"),
|
|
|
|
(LPCSTR)(ULONG_PTR)194 );
|
|
|
|
context->SegEs = LOWORD(proc);
|
|
|
|
}
|
2002-08-31 20:47:00 +02:00
|
|
|
SET_BX( context, 0xe6f5 );
|
|
|
|
SET_AH( context, 0x0 );
|
1999-01-24 10:32:10 +01:00
|
|
|
RESET_CFLAG(context);
|
|
|
|
break;
|
2002-11-24 23:34:04 +01:00
|
|
|
|
1999-03-17 16:15:14 +01:00
|
|
|
case 0xc2:
|
|
|
|
switch(AL_reg(context))
|
|
|
|
{
|
|
|
|
case 0x00: /* Enable-Disable Pointing Device (mouse) */
|
|
|
|
/* BH = newstate, 00h = disabled 01h = enabled */
|
2002-06-01 01:06:46 +02:00
|
|
|
switch(BH_reg(context))
|
1999-03-17 16:15:14 +01:00
|
|
|
{
|
|
|
|
case 0x00:
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("Disable Pointing Device - not implemented\n");
|
1999-03-17 16:15:14 +01:00
|
|
|
break;
|
|
|
|
case 0x01:
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("Enable Pointing Device - not implemented\n");
|
1999-03-17 16:15:14 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
INT_BARF( context, 0x15 );
|
|
|
|
break;
|
|
|
|
}
|
2002-08-31 20:47:00 +02:00
|
|
|
SET_AH( context, 0x00 ); /* successful */
|
1999-03-17 16:15:14 +01:00
|
|
|
break;
|
|
|
|
case 0x02: /* Set Sampling Rate */
|
|
|
|
/* BH = sampling rate */
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("Set Sampling Rate - not implemented\n");
|
2002-08-31 20:47:00 +02:00
|
|
|
SET_AH( context, 0x00 ); /* successful */
|
1999-03-17 16:15:14 +01:00
|
|
|
break;
|
|
|
|
case 0x04: /* Get Pointing Device Type */
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("Get Pointing Device Type - not implemented\n");
|
2002-11-24 23:34:04 +01:00
|
|
|
/* FIXME: BH = Device id, What is it supposed to be? */
|
|
|
|
SET_BH( context, 0x01 );
|
1999-03-17 16:15:14 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
INT_BARF( context, 0x15 );
|
|
|
|
}
|
|
|
|
break;
|
2004-04-06 22:14:09 +02:00
|
|
|
case 0xc3: /* set carry flag, so BorlandRTM doesn't assume a Vectra/PS2*/
|
|
|
|
FIXME("INT15: 0xc3\n");
|
|
|
|
SET_AH( context , 0x86 );
|
|
|
|
break;
|
2006-12-14 17:59:46 +01:00
|
|
|
case 0xc4: /* BIOS POS Program option select */
|
2004-04-06 22:14:09 +02:00
|
|
|
FIXME("INT15: option 0xc4 not handled!\n");
|
|
|
|
break;
|
1999-01-24 10:32:10 +01:00
|
|
|
|
1997-10-12 18:30:17 +02:00
|
|
|
default:
|
|
|
|
INT_BARF( context, 0x15 );
|
|
|
|
}
|
|
|
|
}
|