Release 941017
[wine/gsoc-2012-control.git] / miscemu / int13.c
blob1c08233fdefbd52999884db15736dfaa346a64e0
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "registers.h"
4 #include "wine.h"
5 #include "stddebug.h"
6 /* #define DEBUG_INT */
7 /* #undef DEBUG_INT */
8 #include "debug.h"
10 void IntBarf(int i, struct sigcontext_struct *context);
12 int do_int13(struct sigcontext_struct *context)
14 switch(AH) {
15 case 0x00: /* RESET DISK SYSTEM */
16 case 0x04: /* VERIFY DISK SECTOR(S) */
17 AH = 0;
18 break;
20 case 0x05: /* FORMAT TRACK */
21 AH = 0x0c;
22 SetCflag;
23 break;
25 case 0x06: /* FORMAT TRACK AND SET BAD SECTOR FLAGS */
26 case 0x07: /* FORMAT DRIVE STARTING AT GIVEN TRACK */
27 AH = 0x0c;
28 break;
30 case 0x08: /* GET DRIVE PARAMETERS */
31 AH = (DL & 0x80) ? 0x07 : 0x01;
32 SetCflag;
33 break;
35 case 0x09: /* INITIALIZE CONTROLLER WITH DRIVE PARAMETERS */
36 case 0x0c: /* SEEK TO CYLINDER */
37 case 0x0d: /* RESET HARD DISKS */
38 case 0x10: /* CHECK IF DRIVE READY */
39 case 0x11: /* RECALIBRATE DRIVE */
40 case 0x14: /* CONTROLLER INTERNAL DIAGNOSTIC */
41 AH = 0;
42 break;
44 case 0x0e: /* READ SECTOR BUFFER (XT only) */
45 case 0x0f: /* WRITE SECTOR BUFFER (XT only) */
46 case 0x12: /* CONTROLLER RAM DIAGNOSTIC (XT,PS) */
47 case 0x13: /* DRIVE DIAGNOSTIC (XT,PS) */
48 AH = 0x01;
49 SetCflag;
50 break;
52 default:
53 IntBarf(0x13, context);
55 return 1;