/* * This file is part of zaniWok. * * zaniWok 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, or (at your option) * any later version. See the file COPYING for more information. * * zaniWok 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. */ #import #import /* typedef BOOL */ #define NUM_TRACKS 35 #define NUM_HALF_TRACKS (2 * NUM_TRACKS) #define NUM_QUARTER_TRACKS (4 * NUM_TRACKS) #define NUM_SECTORS 16 typedef enum { DISK_PRODOS = 0, /* Do not change these numbers, as they are */ DISK_DOS33 = 1, /* present in files which already exist. If */ DISK_HALFTRACKS = 2, /* you wish to add a type, choose a new number. */ DISK_FULLTRACKS = 3, DISK_QUARTERTRACKS = 4, /* Is anyone psycho enough to support this? */ } DiskType; typedef struct { DiskType type; /* Specifies the type of disk. */ int data_offset; /* Offset into the file where real data begins. */ FILE *fp; /* File pointer for this disk file. */ BOOL write_protected; /* 'nuff said. */ union { struct { int num_blocks; /* Total # of blocks on the disk. */ int current_block; unsigned char **block; /* Array of pointers to the base of each block. */ } prodos; struct { int num_tracks; /* Total # of tracks on the disk. */ int current_track, current_sector; unsigned char *sector[NUM_TRACKS][NUM_SECTORS]; } dos33; struct { int num_tracks; struct { int track_length; /* Length of this track. */ int file_offset; /* Offset into file where this track begins. */ unsigned char *data; /* Raw data for this track. */ } track[NUM_QUARTER_TRACKS]; /* Housekeeping stuff for raw mode. */ unsigned long last_read_cycles; /* Cycle count at last read. */ int current_track; /* Might really be half track. */ int head_position; /* "bytes" into current track. */ unsigned char write_register; /* Write register for disk writes. */ BOOL magnet[4]; /* Status of stepper motor magnets. */ } raw; } u; void *auxdata; /* This can be anything. */ } Disk; extern void init_disk_hacks (const char *disk1, const char *disk2); extern int disk_ref (AccessType rw, MemoryElement *m, MachineState *state); extern void swap_d1_d2 (void); extern int rwts (MachineState *state);