File: diskconstants.h

package info (click to toggle)
vice 3.7.1%2Bdfsg1-2
  • links: PTS
  • area: contrib
  • in suites: bookworm
  • size: 49,876 kB
  • sloc: ansic: 431,530; cpp: 35,357; sh: 9,747; makefile: 7,010; perl: 1,822; yacc: 1,197; lex: 589; sed: 184; objc: 115; xml: 36
file content (203 lines) | stat: -rw-r--r-- 9,330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/** \file   src/diskconstants.h
 *
 * \brief   Disk drive specifications
 *
 * For customized disks, the values must fit beteen the NUM_ and MAX_
 * limits. Do not change the NUM_ values, as they define the standard
 * disk geometry.
 */

/*
 * Written by
 *  Andreas Boose <viceteam@t-online.de>
 *
 * This file is part of VICE, the Versatile Commodore Emulator.
 * See README for copyright notice.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 *  02111-1307  USA.
 *
 */

#ifndef VICE_DISKCONSTANTS_H
#define VICE_DISKCONSTANTS_H


/*
 * CBM 1541 constants
 */

#define NUM_TRACKS_1541        35   /**< number of tracks on a standard 1541
                                         floppy */
#define NUM_BLOCKS_1541        683  /**< number of blocks on a standard 1541
                                         floppy (664 free) */
#define EXT_TRACKS_1541        40   /**< number of tracks in an extended 1541
                                         floppy, used by SpeedDOS,
                                             ProLogic DOS, etc */
#define EXT_BLOCKS_1541        768  /**< number of blocks on an extended 1541
                                         floppy */
#define MAX_TRACKS_1541        42   /**< maximum number of accessible tracks for
                                         a 1541 drive: not all 1541 drives can
                                         do this */
#define MAX_BLOCKS_1541        802  /**< maximum number of blocks for a 1541
                                         floppy, using 42 tracks */
#define DIR_TRACK_1541         18   /**< 1541 directory track number */
#define DIR_SECTOR_1541        1    /**< 1541 directory sector number */
#define BAM_TRACK_1541         18   /**< 1541 BAM track number */
#define BAM_SECTOR_1541        0    /**< 1541 BAM sector number */
#define BAM_NAME_1541          144  /**< offset in BAM of the disk name in
                                         PETSCII, 16 bytes, padded with 0xa0 */
#define BAM_ID_1541            162  /**< offset in BAM of the disk ID in
                                         PETSCII, 2 bytes for standard DOS */
#define BAM_EXT_BIT_MAP_1541   192  /**< BAM bitmap entries for tracks 36-40 for
                                         extended floppies, only valid for
                                         SpeedDOS */


/* CBM 2040 constants */

#define NUM_TRACKS_2040        35   /**< number of tracks on a 2040 floppy */
#define NUM_BLOCKS_2040        690  /**< number of blocks on a 2040 floppy
                                         (670 free */
#define MAX_TRACKS_2040        35   /**< maximum number of tracks on a 2040
                                         floppy */
#define MAX_BLOCKS_2040        690  /**< maximum number of blocks on a 2040
                                         floppy */
#define DIR_TRACK_2040         18   /**< directory track number */
#define DIR_SECTOR_2040        1    /**< directory sector number */
#define BAM_TRACK_2040         18   /**< BAM track number */
#define BAM_SECTOR_2040        0    /**< BAM sector number */
#define BAM_NAME_2040          144  /**< offset in BAM of the disk name in
                                         PETSCII, 16 bytes, padded with 0xa0 */
#define BAM_ID_2040            162  /**< offset in BAM of the disk ID in
                                         PETSCII, 2 bytes */
#define BAM_EXT_BIT_MAP_2040   192  /**< BAM bitmap entries for tracks 36-40 for
                                         extended floppies (did these exist?) */


/* CBM 1571 constants, these constants are for a double-sided 1571
 *
 * FIXME: constants for the second BAM at (53,0) are missing
 * FIXME: extra constants for 80-track images are missing
 */

#define NUM_TRACKS_1571        70   /**< number of tracks on a 1571 floppy */
#define NUM_BLOCKS_1571        1366 /**< number of blocks on a 1571 floppy
                                         (1328 blocks free) */
#define MAX_TRACKS_1571        70   /**< maximum number of tracks on a 1571
                                         floppy */
#define MAX_BLOCKS_1571        1366 /**< maximum number of blocks on a 1571
                                         floppy */
#define DIR_TRACK_1571         18   /**< directory track number */
#define DIR_SECTOR_1571        1    /**< directory sector number */
#define BAM_TRACK_1571         18   /**< BAM track number (side 1 BAM) */
#define BAM_SECTOR_1571        0    /**< BAM sector number (side 1 BAM) */
#define BAM_NAME_1571          144  /**< offset in BAM of the disk name in
                                         PETSCII, 16 bytes, padded with 0xa0 */
#define BAM_ID_1571            162  /**< offset in BAM of the disk ID in
                                         PETSCII, 2 bytes */
#define BAM_EXT_BIT_MAP_1571   221  /**< BAM bitmap entries for tracks 36-40 for
                                         extended floppies (did these exist?) */


/* CBM 1581 constants */

#define NUM_TRACKS_1581        80   /**< number of tracks on a 1581 diskette */
#define NUM_SECTORS_1581       40   /**< number of sectors per track */
#define NUM_BLOCKS_1581        3200 /**< number of blocks on a 1581 diskette
                                         (3160 blocks free) */
#define MAX_TRACKS_1581        83   /**< maximum number of tracks on a 1581
                                         diskette */
#define MAX_BLOCKS_1581        3320 /**< maximum number of blocks on a 1581
                                         diskette when using 83 tracks */
#define DIR_TRACK_1581         40   /**< directory track number */
#define DIR_SECTOR_1581        3    /**< directory sector number */
#define BAM_TRACK_1581         40   /**< BAM track number */
#define BAM_SECTOR_1581        0    /**< BAM first sector number (the BAM of a
                                        1581 diskette is three sectors) */
#define BAM_NAME_1581          4    /**< offset in BAM of disk name in PETSCII,
                                         16 bytes, padded with 0xa0 */
#define BAM_ID_1581            22   /**< offset in BAM of disk ID in PETSCII,
                                         2 bytes */

/* FIXME: I'm not really familiar with the following drives, so documentation
 *        of these constants will have to wait.
 */

/* CBM 8050 constants */

#define NUM_TRACKS_8050        77
#define NUM_BLOCKS_8050        2083     /* 2052 free */
#define MAX_TRACKS_8050        77
#define MAX_BLOCKS_8050        2083
#define HDR_TRACK_8050         DIR_TRACK_8050   /* block w/disk name */
#define HDR_SECTOR_8050        0        /* block w/disk name */
#define BAM_TRACK_8050         38
#define BAM_SECTOR_8050        0
#define BAM_NAME_8050          6        /* pos. of disk name in header blk */
#define BAM_ID_8050            24       /* pos. of disk id in header blk */
#define DIR_TRACK_8050         39
#define DIR_SECTOR_8050        1

#define NUM_TRACKS_8250        154
#define NUM_BLOCKS_8250        4166     /* 4133 free */
#define MAX_TRACKS_8250        154
#define MAX_BLOCKS_8250        4166
#define HDR_TRACK_8250         HDR_TRACK_8050
#define HDR_SECTOR_8250        HDR_SECTOR_8050
#define BAM_TRACK_8250         BAM_TRACK_8050
#define BAM_SECTOR_8250        BAM_SECTOR_8050
#define BAM_NAME_8250          BAM_NAME_8050 /* pos. of disk name in hdr blk */
#define BAM_ID_8250            BAM_ID_8050   /* pos. of disk id in hdr blk */
#define DIR_TRACK_8250         DIR_TRACK_8050
#define DIR_SECTOR_8250        DIR_SECTOR_8050

#define MAX_TRACKS_9000        152      /* for now */
#define BAM_NAME_9000          6
#define BAM_ID_9000            24

#define NUM_TRACKS_1000        13
#define NUM_BLOCKS_1000        3240
#define NUM_SYS_SECTORS_1000   168      /* on system partition track */
#define MAX_TRACKS_1000        13
#define MAX_BLOCKS_1000        3240

#define NUM_TRACKS_2000        26
#define NUM_BLOCKS_2000        6480
#define NUM_SYS_SECTORS_2000   80       /* on system partition track */
#define MAX_TRACKS_2000        26
#define MAX_BLOCKS_2000        6480

#define NUM_TRACKS_4000        51
#define NUM_BLOCKS_4000        12960
#define NUM_SYS_SECTORS_4000   160      /* on system partition track */
#define MAX_TRACKS_4000        51
#define MAX_BLOCKS_4000        12960

#define DIR_TRACK_NP           1
#define DIR_SECTOR_NP          34
#define BAM_TRACK_NP           1
#define BAM_SECTOR_NP          1
#define BAM_NAME_NP            4
#define BAM_ID_NP              22

#define DIR_TRACK_4000         1
#define DIR_SECTOR_4000        34
#define BAM_TRACK_4000         1
#define BAM_SECTOR_4000        1
#define BAM_NAME_4000          4
#define BAM_ID_4000            22

#endif