2 GEOS functions from disk driver
4 ported to small C on 21.12.1999
5 by Maciej 'YTM/Alliance' Witkowiak
12 #include <geos/gstruct.h>
15 char __fastcall__ ReadBuff(struct tr_se *myTrSe);
16 char __fastcall__ WriteBuff(struct tr_se *myTrSe);
18 char __fastcall__ GetBlock(struct tr_se *myTrSe, char *buffer);
19 char __fastcall__ PutBlock(struct tr_se *myTrSe, char *buffer);
20 char __fastcall__ ReadBlock(struct tr_se *myTrSe, char *buffer);
21 char __fastcall__ WriteBlock(struct tr_se *myTrSe, char *buffer);
22 char __fastcall__ VerWriteBlock(struct tr_se *myTrSe, char *buffer);
24 int __fastcall__ CalcBlksFree(void);
25 char __fastcall__ ChkDkGEOS(void);
26 char __fastcall__ SetGEOSDisk(void);
27 char __fastcall__ NewDisk(void);
28 char __fastcall__ OpenDisk(void);
30 char __fastcall__ FindBAMBit(struct tr_se *myTrSe);
31 char __fastcall__ BlkAlloc(struct tr_se output[], int length);
32 char __fastcall__ NxtBlkAlloc(struct tr_se *startTrSe,
33 struct tr_se output[], int length);
34 char __fastcall__ FreeBlock(struct tr_se *myTrSe);
35 struct tr_se __fastcall__ SetNextFree(struct tr_se *myTrSe);
36 // above needs (int) casts on both sides of '='
38 char __fastcall__ GetDirHead(void);
39 char __fastcall__ PutDirHead(void);
40 void __fastcall__ GetPtrCurDkNm(char *name);
42 void __fastcall__ EnterTurbo(void);
43 void __fastcall__ ExitTurbo(void);
44 void __fastcall__ PurgeTurbo(void);
46 char __fastcall__ ChangeDiskDevice(char newdev);
48 /* disk header offsets */
50 #define OFF_DISK_NAME 144
51 #define OFF_GS_DTYPE 189
52 #define OFF_OP_TR_SC 171
55 #define ANY_FAULT 0xf0
58 #define INSUFF_SPACE 3
59 #define FULL_DIRECTORY 4
60 #define FILE_NOT_FOUND 5
62 #define UNOPENED_VLIR 7
64 #define OUT_OF_RECORDS 9
65 #define STRUCT_MISMAT 10
66 #define BFR_OVERFLOW 11
68 #define DEV_NOT_FOUND 13
69 #define INCOMPATIBLE 14
70 #define HDR_NOT_THERE 0x20
72 #define DBLK_NOT_THERE 0x22
73 #define DAT_CHKSUM_ERR 0x23
74 #define WR_VER_ERR 0x25
76 #define HDR_CHKSUM_ERR 0x27
77 #define DSK_ID_MISMAT 0x29
78 #define BYTE_DEC_ERR 0x2e
79 #define DOS_MISMATCH 0x73