1 #ifndef CAPS_CAPSIMAGE_H
2 #define CAPS_CAPSIMAGE_H
5 #include <exec/types.h>
6 typedef UBYTE CapsUByte
;
8 typedef ULONG CapsULong
;
11 typedef uint8_t CapsUByte
;
12 typedef int32_t CapsLong
;
13 typedef uint32_t CapsULong
;
16 #define CAPS_FILEEXT "ipf"
17 #define CAPS_FILEPFX ".ipf"
18 #define CAPS_NAME "capsimage.device"
22 // Flags provided for locking, in order:
23 // 0: re-align data as index synced recording
24 // 1: decode track to word aligned size
25 // 2: generate cell density for variable density tracks
26 // 3: generate density for automatically sized cells
27 // 4: generate density for unformatted cells
28 // 5: generate unformatted data
29 // 6: generate unformatted data, that changes each revolution
30 // 7: directly use source memory buffer supplied with LockImageMemory
31 // 8: flakey data is created on one revolution, updated with each lock
32 // 9: ...Info.type holds the expected structure type
33 #define DI_LOCK_INDEX (1L<<0)
34 #define DI_LOCK_ALIGN (1L<<1)
35 #define DI_LOCK_DENVAR (1L<<2)
36 #define DI_LOCK_DENAUTO (1L<<3)
37 #define DI_LOCK_DENNOISE (1L<<4)
38 #define DI_LOCK_NOISE (1L<<5)
39 #define DI_LOCK_NOISEREV (1L<<6)
40 #define DI_LOCK_MEMREF (1L<<7)
41 #define DI_LOCK_UPDATEFD (1L<<8)
42 #define DI_LOCK_TYPE (1L<<9)
44 #define CAPS_MAXPLATFORM 4
47 #define CTIT_FLAG_FLAKEY (1L<<31)
48 #define CTIT_MASK_TYPE 0xff
50 #if defined(__GNUC__) && !defined(__mc68000__)
54 // decoded caps date.time
55 struct CapsDateTimeExt
{
65 // library version information block
66 struct CapsVersionInfo
{
67 CapsULong type
; // library type
68 CapsULong release
; // release ID
69 CapsULong revision
; // revision ID
70 CapsULong flag
; // supported flags
73 // disk image information block
74 struct CapsImageInfo
{
75 CapsULong type
; // image type
76 CapsULong release
; // release ID
77 CapsULong revision
; // release revision ID
78 CapsULong mincylinder
; // lowest cylinder number
79 CapsULong maxcylinder
; // highest cylinder number
80 CapsULong minhead
; // lowest head number
81 CapsULong maxhead
; // highest head number
82 struct CapsDateTimeExt crdt
; // image creation date.time
83 CapsULong platform
[CAPS_MAXPLATFORM
]; // intended platform(s)
86 // disk track information block
87 struct CapsTrackInfo
{
88 CapsULong type
; // track type
89 CapsULong cylinder
; // cylinder#
90 CapsULong head
; // head#
91 CapsULong sectorcnt
; // available sectors
92 CapsULong sectorsize
; // sector size
93 CapsULong trackcnt
; // track variant count
94 CapsUByte
*trackbuf
; // track buffer memory
95 CapsULong tracklen
; // track buffer memory length
96 CapsUByte
*trackdata
[CAPS_MTRS
]; // track data pointer if available
97 CapsULong tracksize
[CAPS_MTRS
]; // track data size
98 CapsULong timelen
; // timing buffer length
99 CapsULong
*timebuf
; // timing buffer
102 // disk track information block
103 struct CapsTrackInfoT1
{
104 CapsULong type
; // track type
105 CapsULong cylinder
; // cylinder#
106 CapsULong head
; // head#
107 CapsULong sectorcnt
; // available sectors
108 CapsULong sectorsize
; // sector size
109 CapsUByte
*trackbuf
; // track buffer memory
110 CapsULong tracklen
; // track buffer memory length
111 CapsULong timelen
; // timing buffer length
112 CapsULong
*timebuf
; // timing buffer
113 CapsULong overlap
; // overlap position
116 #if defined(__GNUC__) && !defined(__mc68000__)
122 ciitNA
=0, // invalid image type
123 ciitFDD
// floppy disk
126 // platform IDs, not about configuration, but intended use
128 ciipNA
=0, // invalid platform (dummy entry)
130 ciipAtariST
, // Atari ST
136 ctitNA
=0, // invalid type
137 ctitNoise
, // cells are unformatted (random size)
138 ctitAuto
, // automatic cell size, according to track size
139 ctitVar
// variable density
142 // image error status
162 #endif // CAPS_CAPSIMAGE_H