Debian Codegraph @

include/bios_disk.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2002-2010 The DOSBox Team
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19 #ifndef DOSBOX_BIOS_DISK_H
20 #define DOSBOX_BIOS_DISK_H
21
22 #include <stdio.h>
23 #ifndef DOSBOX_MEM_H
24 #include "mem.h"
25 #endif
26 #ifndef DOSBOX_DOS_INC_H
27 #include "dos_inc.h"
28 #endif
29 #ifndef DOSBOX_BIOS_H
30 #include "bios.h"
31 #endif
32
33 /* The Section handling Bios Disk Access */
34 #define BIOS_MAX_DISK 10
35
36 #define MAX_SWAPPABLE_DISKS 20
37 struct diskGeo {
38 Bit32u ksize; /* Size in kilobytes */
39 Bit16u secttrack; /* Sectors per track */
40 Bit16u headscyl; /* Heads per cylinder */
41 Bit16u cylcount; /* Cylinders per side */
42 Bit16u biosval; /* Type to return from BIOS */
43 };
44 extern diskGeo DiskGeometryList[];
45
46 class imageDisk {
47 public:
48 Bit8u Read_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data);
49 Bit8u Write_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data);
50 Bit8u Read_AbsoluteSector(Bit32u sectnum, void * data);
51 Bit8u Write_AbsoluteSector(Bit32u sectnum, void * data);
52
53 void Set_Geometry(Bit32u setHeads, Bit32u setCyl, Bit32u setSect, Bit32u setSectSize);
54 void Get_Geometry(Bit32u * getHeads, Bit32u *getCyl, Bit32u *getSect, Bit32u *getSectSize);
55 Bit8u GetBiosType(void);
56 Bit32u getSectSize(void);
57 imageDisk(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHardDisk);
58 ~imageDisk() { if(diskimg != NULL) { fclose(diskimg); } };
59
60 bool hardDrive;
61 bool active;
62 FILE *diskimg;
63 Bit8u diskname[512];
64 Bit8u floppytype;
65
66 Bit32u sector_size;
67 Bit32u heads,cylinders,sectors;
68 };
69
70 void updateDPT(void);
71
72 #define MAX_HDD_IMAGES 2
73 #define MAX_DISK_IMAGES (2 + MAX_HDD_IMAGES)
74
75 extern imageDisk *imageDiskList[MAX_DISK_IMAGES];
76 extern imageDisk *diskSwap[MAX_SWAPPABLE_DISKS];
77
78 extern Bits swapPosition;
79 extern Bit16u imgDTASeg; /* Real memory location of temporary DTA pointer for fat image disk access */
80 extern RealPt imgDTAPtr; /* Real memory location of temporary DTA pointer for fat image disk access */
81 extern DOS_DTA *imgDTA;
82
83 void swapInDisks(void);
84 void swapInNextDisk(void);
85 bool getSwapRequest(void);
86
87 #endif