1997-01-01 18:29:55 +01:00
|
|
|
/*
|
|
|
|
* BIOS interrupt 11h handler
|
|
|
|
*/
|
|
|
|
|
2001-10-14 18:18:52 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-11-26 23:39:50 +01:00
|
|
|
#include <stdio.h>
|
1997-01-01 18:29:55 +01:00
|
|
|
#include <stdlib.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2000-11-25 02:31:17 +01:00
|
|
|
|
2000-11-30 02:31:28 +01:00
|
|
|
#include "windef.h"
|
1997-01-01 18:29:55 +01:00
|
|
|
#include "miscemu.h"
|
|
|
|
#include "msdos.h"
|
1999-06-26 21:09:08 +02:00
|
|
|
#include "debugtools.h"
|
2000-10-12 22:42:23 +02:00
|
|
|
#include "options.h"
|
1997-01-01 18:29:55 +01:00
|
|
|
|
|
|
|
/**********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* INT_Int11Handler (WPROCS.117)
|
1997-01-01 18:29:55 +01:00
|
|
|
*
|
|
|
|
* Handler for int 11h (get equipment list).
|
|
|
|
*/
|
1999-06-26 20:40:24 +02:00
|
|
|
void WINAPI INT_Int11Handler( CONTEXT86 *context )
|
1997-01-01 18:29:55 +01:00
|
|
|
{
|
|
|
|
int diskdrives = 0;
|
|
|
|
int parallelports = 0;
|
|
|
|
int serialports = 0;
|
|
|
|
int x;
|
|
|
|
|
|
|
|
/* borrowed from Ralph Brown's interrupt lists
|
|
|
|
|
|
|
|
bits 15-14: number of parallel devices
|
|
|
|
bit 13: [Conv] Internal modem
|
|
|
|
bit 12: reserved
|
|
|
|
bits 11- 9: number of serial devices
|
|
|
|
bit 8: reserved
|
|
|
|
bits 7- 6: number of diskette drives minus one
|
|
|
|
bits 5- 4: Initial video mode:
|
|
|
|
00b = EGA,VGA,PGA
|
|
|
|
01b = 40 x 25 color
|
|
|
|
10b = 80 x 25 color
|
|
|
|
11b = 80 x 25 mono
|
|
|
|
bit 3: reserved
|
|
|
|
bit 2: [PS] =1 if pointing device
|
|
|
|
[non-PS] reserved
|
|
|
|
bit 1: =1 if math co-processor
|
|
|
|
bit 0: =1 if diskette available for boot
|
|
|
|
*/
|
|
|
|
/* Currently the only of these bits correctly set are:
|
|
|
|
bits 15-14 } Added by William Owen Smith,
|
|
|
|
bits 11-9 } wos@dcs.warwick.ac.uk
|
|
|
|
bits 7-6
|
|
|
|
bit 2 (always set)
|
|
|
|
*/
|
|
|
|
|
2000-12-12 01:44:42 +01:00
|
|
|
if (GetDriveTypeA("A:\\") == DRIVE_REMOVABLE) diskdrives++;
|
|
|
|
if (GetDriveTypeA("B:\\") == DRIVE_REMOVABLE) diskdrives++;
|
1997-01-01 18:29:55 +01:00
|
|
|
if (diskdrives) diskdrives--;
|
|
|
|
|
2000-10-13 19:11:30 +02:00
|
|
|
for (x=0; x < 9; x++)
|
1997-01-01 18:29:55 +01:00
|
|
|
{
|
2000-10-12 22:42:23 +02:00
|
|
|
char temp[16],name[16];
|
|
|
|
|
2000-11-26 23:39:50 +01:00
|
|
|
sprintf(name,"COM%d",x+1);
|
2000-10-12 22:42:23 +02:00
|
|
|
PROFILE_GetWineIniString("serialports",name,"*",temp,sizeof temp);
|
|
|
|
if(strcmp(temp,"*"))
|
1997-01-01 18:29:55 +01:00
|
|
|
serialports++;
|
2000-10-12 22:42:23 +02:00
|
|
|
|
2000-11-26 23:39:50 +01:00
|
|
|
sprintf(name,"LPT%d",x+1);
|
2000-10-12 22:42:23 +02:00
|
|
|
PROFILE_GetWineIniString("parallelports",name,"*",temp,sizeof temp);
|
|
|
|
if(strcmp(temp,"*"))
|
1997-01-01 18:29:55 +01:00
|
|
|
parallelports++;
|
|
|
|
}
|
|
|
|
if (serialports > 7) /* 3 bits -- maximum value = 7 */
|
|
|
|
serialports=7;
|
|
|
|
if (parallelports > 3) /* 2 bits -- maximum value = 3 */
|
|
|
|
parallelports=3;
|
|
|
|
|
|
|
|
AX_reg(context) = (diskdrives << 6) | (serialports << 9) |
|
|
|
|
(parallelports << 14) | 0x02;
|
|
|
|
}
|