]> git.sur5r.net Git - cc65/blob - include/geos/gdisk.h
68eea97e632308d8dad96f7afb3ecdd73a837653
[cc65] / include / geos / gdisk.h
1 /*
2   GEOS functions from disk driver
3
4   ported to small C on 21.12.1999
5   by Maciej 'YTM/Alliance' Witkowiak
6 */
7
8 #ifndef _GDISK_H
9 #define _GDISK_H
10
11 #ifndef _GSTRUCT_H
12 #include <geos/gstruct.h>
13 #endif
14
15 char __fastcall__ ReadBuff(struct tr_se *myTrSe);
16 char __fastcall__ WriteBuff(struct tr_se *myTrSe);
17
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);
23
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);
29
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 '='
37
38 char __fastcall__ GetDirHead(void);
39 char __fastcall__ PutDirHead(void);
40 void __fastcall__ GetPtrCurDkNm(char *name);
41
42 void __fastcall__ EnterTurbo(void);
43 void __fastcall__ ExitTurbo(void);
44 void __fastcall__ PurgeTurbo(void);
45
46 char __fastcall__ ChangeDiskDevice(char newdev);
47
48 /* disk header offsets  */
49 #define OFF_TO_BAM      4
50 #define OFF_DISK_NAME   144
51 #define OFF_GS_DTYPE    189
52 #define OFF_OP_TR_SC    171
53 #define OFF_GS_ID       173
54 /* disk errors */
55 #define ANY_FAULT       0xf0
56 #define G_EOF           0
57 #define NO_BLOCKS       1
58 #define INV_TRACK       2
59 #define INSUFF_SPACE    3
60 #define FULL_DIRECTORY  4
61 #define FILE_NOT_FOUND  5
62 #define BAD_BAM         6
63 #define UNOPENED_VLIR   7
64 #define INV_RECORD      8
65 #define OUT_OF_RECORDS  9
66 #define STRUCT_MISMAT   10
67 #define BFR_OVERFLOW    11
68 #define CANCEL_ERR      12
69 #define DEV_NOT_FOUND   13
70 #define INCOMPATIBLE    14
71 #define HDR_NOT_THERE   0x20
72 #define NO_SYNC         0x21
73 #define DBLK_NOT_THERE  0x22
74 #define DAT_CHKSUM_ERR  0x23
75 #define WR_VER_ERR      0x25
76 #define WR_PR_ON        0x26
77 #define HDR_CHKSUM_ERR  0x27
78 #define DSK_ID_MISMAT   0x29
79 #define BYTE_DEC_ERR    0x2e
80 #define DOS_MISMATCH    0x73
81
82 #endif