2013-07-06 04:37:13 +00:00
|
|
|
/*
|
2013-06-11 07:08:15 +00:00
|
|
|
* Apple // emulator for Linux: Defines for Disk ][ emulation
|
|
|
|
*
|
|
|
|
* Copyright 1994 Alexander Jean-Claude Bottema
|
|
|
|
* Copyright 1995 Stephen Lee
|
|
|
|
* Copyright 1997, 1998 Aaron Culliney
|
|
|
|
* Copyright 1998, 1999, 2000 Michael Deutschmann
|
|
|
|
*
|
|
|
|
* This software package is subject to the GNU General Public License
|
2013-07-06 04:37:13 +00:00
|
|
|
* version 2 or later (your choice) as published by the Free Software
|
2013-06-11 07:08:15 +00:00
|
|
|
* Foundation.
|
|
|
|
*
|
2013-07-06 04:37:13 +00:00
|
|
|
* THERE ARE NO WARRANTIES WHATSOEVER.
|
2013-06-11 07:08:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef A2_DISK_H
|
2013-12-01 18:57:24 +00:00
|
|
|
#define A2_DISK_H
|
|
|
|
|
|
|
|
#include "common.h"
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2014-12-28 21:07:13 +00:00
|
|
|
#define DSK_SIZE 143360
|
|
|
|
#define NIB_SIZE 232960
|
|
|
|
#define NI2_SIZE 223440
|
|
|
|
|
|
|
|
#define NUM_TRACKS 35
|
|
|
|
#define NUM_SECTORS 16
|
|
|
|
|
|
|
|
#define DSK_TRACK_SIZE 0x1000 // DOS order, ProDOS order
|
|
|
|
#define NIB_TRACK_SIZE 0x1A00 // NIB format
|
|
|
|
#define NI2_TRACK_SIZE 0x18F0 // NI2 format
|
|
|
|
|
|
|
|
#define PHASE_BYTES (NIB_TRACK_SIZE/2)
|
|
|
|
#define NIB_SEC_SIZE (NIB_TRACK_SIZE/NUM_SECTORS)
|
|
|
|
|
|
|
|
#define DSK_VOLUME 254
|
|
|
|
|
|
|
|
typedef struct diskette_t {
|
|
|
|
uint8_t track_image[NIB_TRACK_SIZE];
|
2013-06-19 07:07:41 +00:00
|
|
|
char file_name[1024];
|
2014-03-26 05:11:01 +00:00
|
|
|
bool nibblized;
|
|
|
|
bool is_protected;
|
2014-12-28 21:07:13 +00:00
|
|
|
bool track_valid;
|
|
|
|
bool track_dirty;
|
|
|
|
int *skew_table;
|
2013-06-11 07:08:15 +00:00
|
|
|
int sector;
|
2014-12-28 21:07:13 +00:00
|
|
|
long nib_count;
|
2013-06-11 07:08:15 +00:00
|
|
|
int phase;
|
2013-07-06 04:37:13 +00:00
|
|
|
int run_byte;
|
2013-06-11 07:08:15 +00:00
|
|
|
FILE *fp;
|
2014-12-28 21:07:13 +00:00
|
|
|
} diskette_t;
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2014-12-28 21:07:13 +00:00
|
|
|
typedef struct drive_t {
|
2013-06-11 07:08:15 +00:00
|
|
|
int motor;
|
|
|
|
int drive;
|
|
|
|
int ddrw;
|
|
|
|
int disk_byte;
|
|
|
|
int exor_value;
|
2014-12-28 21:07:13 +00:00
|
|
|
diskette_t disk[2];
|
|
|
|
} drive_t;
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2014-12-28 21:07:13 +00:00
|
|
|
extern drive_t disk6;
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2014-11-02 03:02:44 +00:00
|
|
|
void c_init_6(void);
|
2014-09-17 03:40:42 +00:00
|
|
|
const char *c_new_diskette_6(int drive, const char * const file_name, int force);
|
|
|
|
const char *c_eject_6(int drive);
|
2014-03-26 05:11:01 +00:00
|
|
|
void disk_io_initialize(unsigned int slot);
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2014-11-15 19:14:01 +00:00
|
|
|
#if DISK_TRACING
|
|
|
|
void c_toggle_disk_trace_6(const char *read_file, const char *write_file);
|
2014-10-12 01:31:19 +00:00
|
|
|
void c_begin_disk_trace_6(const char *read_file, const char *write_file);
|
|
|
|
void c_end_disk_trace_6(void);
|
|
|
|
#endif
|
|
|
|
|
2013-06-11 07:08:15 +00:00
|
|
|
#endif
|