/*
	FS1541

	disk.h

*/

#include <devices/trackdisk.h>

/* Some lame fixes by Joe Forster/STA, trying to make this ugly source also
   support 40-track disk images. Be warned, the BAM handling _will_ choke
   on 40 tracks because it assumes that the BAM is contiguous, which a
   40-track BAM isn't! */

/* Uncomment these two lines for 35-track disk image support */

/*
#define DiskSizeTracks 35
#define DiskSizeSectors 683
*/

/* Uncomment these two lines for 40-track disk image support */


#define DiskSizeTracks 40
#define DiskSizeSectors 768


#define DiskSizeBytes (DiskSizeSectors*256)

LONG InitDiskSS(STRPTR device, ULONG unit, ULONG flags);
void QuitDiskSS(void);

void ResetDisk(void);
BOOL LoadDisk(void);
void MotorOff(void);

struct DataBlock *getblock_ts(UBYTE t, UBYTE s);
struct DataBlock *putblock_ts(UBYTE t, UBYTE s, APTR data);
struct DataBlock *getputblock(ULONG blk, BOOL write);

extern BOOL autoscan;
extern LONG numsofterrors;
extern struct IOExtTD *diskreq;
extern int wprotected, hardwprot;
extern struct MsgPort *dpsender;
extern ULONG chgcount;


#define D64_SIZE DiskSizeSectors*256		/* 174848 */

#define SEC_NOT_LOADED 0
#define SEC_OK 1
#define SEC_ERROR -1
