| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 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 |
|
| 34 |
#define BIOS_MAX_DISK 10 |
| 35 |
|
| 36 |
#define MAX_SWAPPABLE_DISKS 20 |
| 37 |
struct diskGeo { |
| 38 |
Bit32u ksize; |
| 39 |
Bit16u secttrack; |
| 40 |
Bit16u headscyl; |
| 41 |
Bit16u cylcount; |
| 42 |
Bit16u biosval; |
| 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; |
| 80 |
extern RealPt imgDTAPtr; |
| 81 |
extern DOS_DTA *imgDTA; |
| 82 |
|
| 83 |
void swapInDisks(void); |
| 84 |
void swapInNextDisk(void); |
| 85 |
bool getSwapRequest(void); |
| 86 |
|
| 87 |
#endif |