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