Release 940804
[wine/gsoc-2012-control.git] / miscemu / int13.c
blob55fb5b23e1b65271a2be2fb8085498f8594c7a94
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "msdos.h"
4 #include "wine.h"
6 int do_int13(struct sigcontext_struct *context)
8 switch((context->sc_eax >> 8) & 0xff)
10 case 0x00: /* RESET DISK SYSTEM */
11 case 0x04: /* VERIFY DISK SECTOR(S) */
12 EAX = (EAX & 0xffff00ff);
13 break;
15 case 0x05: /* FORMAT TRACK */
16 EAX = (EAX & 0xffff00ff) | 0x0c;
17 SetCflag;
18 break;
20 case 0x06: /* FORMAT TRACK AND SET BAD SECTOR FLAGS */
21 case 0x07: /* FORMAT DRIVE STARTING AT GIVEN TRACK */
22 EAX = (EAX & 0xffff00ff) | 0x0c;
23 break;
25 case 0x08: /* GET DRIVE PARAMETERS */
26 EAX = (EAX & 0xffff00ff) | ((EDX & 0x00000080)? 0x07: 0x01);
27 SetCflag;
28 break;
30 case 0x09: /* INITIALIZE CONTROLLER WITH DRIVE PARAMETERS */
31 case 0x0c: /* SEEK TO CYLINDER */
32 case 0x0d: /* RESET HARD DISKS */
33 case 0x10: /* CHECK IF DRIVE READY */
34 case 0x11: /* RECALIBRATE DRIVE */
35 case 0x14: /* CONTROLLER INTERNAL DIAGNOSTIC */
36 EAX = (EAX & 0xffff00ff);
37 break;
39 case 0x0e: /* READ SECTOR BUFFER (XT only) */
40 case 0x0f: /* WRITE SECTOR BUFFER (XT only) */
41 case 0x12: /* CONTROLLER RAM DIAGNOSTIC (XT,PS) */
42 case 0x13: /* DRIVE DIAGNOSTIC (XT,PS) */
43 EAX = (EAX & 0xffff00ff) | 0x01;
44 SetCflag;
45 break;
50 default:
51 IntBarf(0x13, context);
53 return 1;