]> git.sur5r.net Git - cc65/blob - include/geos/gdisk.h
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / include / geos / gdisk.h
1 /*
2   GEOS functions from disk driver
3
4   by Maciej 'YTM/Elysium' Witkowiak
5 */
6
7 #ifndef _GDISK_H
8 #define _GDISK_H
9
10 #ifndef _GSTRUCT_H
11 #include <geos/gstruct.h>
12 #endif
13
14 char __fastcall__ ReadBuff(struct tr_se *myTrSe);
15 char __fastcall__ WriteBuff(struct tr_se *myTrSe);
16
17 char __fastcall__ GetBlock(struct tr_se *myTrSe, char *buffer);
18 char __fastcall__ PutBlock(struct tr_se *myTrSe, const char *buffer);
19 char __fastcall__ ReadBlock(struct tr_se *myTrSe, char *buffer);
20 char __fastcall__ WriteBlock(struct tr_se *myTrSe, const char *buffer);
21 char __fastcall__ VerWriteBlock(struct tr_se *myTrSe, const char *buffer);
22
23 unsigned CalcBlksFree(void);
24 char ChkDkGEOS(void);
25 char SetGEOSDisk(void);
26 char NewDisk(void);
27 char OpenDisk(void);
28
29 char __fastcall__ FindBAMBit(struct tr_se *myTrSe);
30 char __fastcall__ BlkAlloc(struct tr_se output[], unsigned length);
31 char __fastcall__ NxtBlkAlloc(struct tr_se *startTrSe,
32                               struct tr_se output[], unsigned length);
33 char __fastcall__ FreeBlock(struct tr_se *myTrSe);
34 struct tr_se __fastcall__ SetNextFree(struct tr_se *myTrSe);
35 // above needs (unsigned) casts on both sides of '='
36
37 char GetDirHead(void);
38 char PutDirHead(void);
39 void __fastcall__ GetPtrCurDkNm(char *name);
40
41 void EnterTurbo(void);
42 void ExitTurbo(void);
43 void PurgeTurbo(void);
44
45 char __fastcall__ ChangeDiskDevice(char newdev);
46
47 /* disk header offsets i.e. index curDirHead with these */
48 #define OFF_TO_BAM      4
49 #define OFF_DISK_NAME   144
50 #define OFF_GS_DTYPE    189
51 #define OFF_OP_TR_SC    171
52 #define OFF_GS_ID       173
53 /* disk errors reported in _oserror */
54 #define ANY_FAULT       0xf0
55 #define G_EOF           0
56 #define NO_BLOCKS       1
57 #define INV_TRACK       2
58 #define INSUFF_SPACE    3
59 #define FULL_DIRECTORY  4
60 #define FILE_NOT_FOUND  5
61 #define BAD_BAM         6
62 #define UNOPENED_VLIR   7
63 #define INV_RECORD      8
64 #define OUT_OF_RECORDS  9
65 #define STRUCT_MISMAT   10
66 #define BFR_OVERFLOW    11
67 #define CANCEL_ERR      12
68 #define DEV_NOT_FOUND   13
69 #define INCOMPATIBLE    14
70 #define HDR_NOT_THERE   0x20
71 #define NO_SYNC         0x21
72 #define DBLK_NOT_THERE  0x22
73 #define DAT_CHKSUM_ERR  0x23
74 #define WR_VER_ERR      0x25
75 #define WR_PR_ON        0x26
76 #define HDR_CHKSUM_ERR  0x27
77 #define DSK_ID_MISMAT   0x29
78 #define BYTE_DEC_ERR    0x2e
79 #define DOS_MISMATCH    0x73
80
81 #endif