/* -*-C-*-
********************************************************************************
*
* File:         rwdisk.h
* RCS:          $Header: rwdisk.h,v 1.1 93/03/19 14:25:01 mjp Exp $
* Description:  Read and Write Emax Disc Banks from disk
* Author:       Mike Prudence, (mjp@hplb.hpl.hp.com)
* Created:      Wed Mar 17 15:04:03 1993
* Modified:     Fri Mar 19 17:35:49 1993 (Mike Prudence) mjp@prudence
* Language:     C
*
* (c) Copyright 1993, Mike Prudence
*
********************************************************************************
*/

#ifndef __RWDISK_H
#define __RWDISK_H

#define __RWDISK_VERSION	"1.1"
#define __RWDISK_DATE		"Fri Mar 19 13:30:51 1993"

#define DEFAULT_OS_FILE "EMAXOS.EMX"

#define EMAXUTIL_HDR "emaxutil v%3s %24s\n"
#define EMAXUTIL_HDRLEN 39

#include "emaxio.h"
#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>

#define BANK_LOW 368
#define BANK_HIGH 423
#define SAMPLE_LOW 440
#define SAMPLE_HIGH 1463
#define OS1_LOW 0
#define OS1_HIGH 367
#define OS2_LOW 424
#define OS2_HIGH 439
#define OS3_LOW 1464
#define OS3_HIGH 1599

#define TOTAL_BLKS ((BANK_HIGH-BANK_LOW)+(SAMPLE_HIGH-SAMPLE_LOW))

#define TOTAL_OS ((OS1_HIGH-OS1_LOW)+(OS2_HIGH-OS2_LOW)+(OS3_HIGH-OS3_LOW))

/*
 * The above defines give us the following tracks/sectors that must be read
 * from the disc :
 *
 * Track 18, head 0, sectors 9-10
 * Track 18, head 1    thru to   Track 20, head 1
 * Track 21, head 0, sectors 1-4
 * Track 22, head 0    thru to   Track 72, head 1
 * Track 73, head 0, sectors 1-4
 *
 * Blocks are numbered 0 to 1599. Block 11 is stored on 
 * track 0, head 1, sector 0, and so on up to block 1599.
 * 
 * Yuck - how messy.
 */

extern int ReadDisk (int drive, char* fn);

extern int WriteDisk (char* fn, int drive);

extern int VerifyDisk (int drive);

#endif
