Release 960521
[wine.git] / miscemu / int13.c
blobf867a92652362b702f5a5274da425a7c7a536473
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "registers.h"
4 #include "wine.h"
5 #include "miscemu.h"
6 #include "stddebug.h"
7 /* #define DEBUG_INT */
8 #include "debug.h"
11 /**********************************************************************
12 * INT_Int13Handler
14 * Handler for int 13h (disk I/O).
16 void INT_Int13Handler( struct sigcontext_struct context )
18 switch(AH_reg(&context))
20 case 0x00: /* RESET DISK SYSTEM */
21 case 0x04: /* VERIFY DISK SECTOR(S) */
22 AH_reg(&context) = 0;
23 break;
25 case 0x05: /* FORMAT TRACK */
26 AH_reg(&context) = 0x0c;
27 SET_CFLAG(&context);
28 break;
30 case 0x06: /* FORMAT TRACK AND SET BAD SECTOR FLAGS */
31 case 0x07: /* FORMAT DRIVE STARTING AT GIVEN TRACK */
32 AH_reg(&context) = 0x0c;
33 break;
35 case 0x08: /* GET DRIVE PARAMETERS */
36 AH_reg(&context) = (DL_reg(&context) & 0x80) ? 0x07 : 0x01;
37 SET_CFLAG(&context);
38 break;
40 case 0x09: /* INITIALIZE CONTROLLER WITH DRIVE PARAMETERS */
41 case 0x0c: /* SEEK TO CYLINDER */
42 case 0x0d: /* RESET HARD DISKS */
43 case 0x10: /* CHECK IF DRIVE READY */
44 case 0x11: /* RECALIBRATE DRIVE */
45 case 0x14: /* CONTROLLER INTERNAL DIAGNOSTIC */
46 AH_reg(&context) = 0;
47 break;
49 case 0x0e: /* READ SECTOR BUFFER (XT only) */
50 case 0x0f: /* WRITE SECTOR BUFFER (XT only) */
51 case 0x12: /* CONTROLLER RAM DIAGNOSTIC (XT,PS) */
52 case 0x13: /* DRIVE DIAGNOSTIC (XT,PS) */
53 AH_reg(&context) = 0x01;
54 SET_CFLAG(&context);
55 break;
57 default:
58 INT_BARF( &context, 0x13 );