mirror of
https://github.com/holub/mame
synced 2025-05-19 03:59:35 +03:00
floppy: Add generic track data descriptors [O. Galibert]
This commit is contained in:
parent
27886f2f2b
commit
1a60586bc6
@ -23,148 +23,52 @@ int adf_format::identify(floppy_image *image)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MAX_TRACK_BYTES 12500
|
||||
#define ACTUAL_TRACK_BYTES 11968
|
||||
#define GAP_TRACK_BYTES ( MAX_TRACK_BYTES - ACTUAL_TRACK_BYTES )
|
||||
#define ONE_SECTOR_BYTES (544*2)
|
||||
#define ONE_REV_TIME 200 /* ms */
|
||||
#define MAX_WORDS_PER_DMA_CYCLE 32 /* 64 bytes per dma cycle */
|
||||
#define DISK_DETECT_DELAY 1
|
||||
#define MAX_TRACKS 160
|
||||
#define MAX_MFM_TRACK_LEN 16384
|
||||
const floppy_image_format_t::desc_e adf_format::desc[] = {
|
||||
{ SECTOR_LOOP_START, 0, 10 },
|
||||
{ MFM, 0x00, 2 },
|
||||
{ RAW, 0x4489, 2 },
|
||||
{ CRC_AMIGA_START, 1 },
|
||||
{ MFMBITS, 0xf, 4 },
|
||||
{ OFFSET_ID_O },
|
||||
{ SECTOR_ID_O },
|
||||
{ REMAIN_O, 11 },
|
||||
{ MFMBITS, 0xf, 4 },
|
||||
{ OFFSET_ID_E },
|
||||
{ SECTOR_ID_E },
|
||||
{ REMAIN_E, 11 },
|
||||
{ MFM, 0x00, 16 },
|
||||
{ CRC_END, 1 },
|
||||
{ CRC, 1 },
|
||||
{ CRC, 2 },
|
||||
{ CRC_AMIGA_START, 2 },
|
||||
{ SECTOR_DATA_O, -1 },
|
||||
{ SECTOR_DATA_E, -1 },
|
||||
{ CRC_END, 2 },
|
||||
{ SECTOR_LOOP_END },
|
||||
{ MFM, 0x00, 266 },
|
||||
{ END }
|
||||
};
|
||||
|
||||
bool adf_format::load(floppy_image *image)
|
||||
{
|
||||
desc_s sectors[11];
|
||||
UINT8 sectdata[512*11];
|
||||
for(int i=0; i<11; i++) {
|
||||
sectors[i].data = sectdata + 512*i;
|
||||
sectors[i].size = 512;
|
||||
}
|
||||
|
||||
UINT8 *mfm = NULL;
|
||||
UINT8 temp_cyl[512*11];
|
||||
UINT16 sector_len = 512*11;
|
||||
image->set_meta_data(80,2,300,(UINT16)253360);
|
||||
for(int track=0; track < 80; track++) {
|
||||
for(int side=0; side < 2; side++) {
|
||||
UINT16 offset = ((track<<1)+side);
|
||||
mfm = image->get_buffer(track,side);
|
||||
image->set_track_size(track, side, MAX_MFM_TRACK_LEN);
|
||||
image->image_read(temp_cyl, offset*sector_len, sector_len);
|
||||
memset( &mfm[ONE_SECTOR_BYTES*11], 0xaa, GAP_TRACK_BYTES );
|
||||
|
||||
for (int sector = 0; sector < 11; sector++ ) {
|
||||
int x;
|
||||
UINT8 *dest = ( &mfm[(ONE_SECTOR_BYTES*sector)] );
|
||||
UINT8 *src = &temp_cyl[sector*512];
|
||||
UINT32 tmp;
|
||||
UINT32 even, odd;
|
||||
UINT32 hck = 0, dck = 0;
|
||||
|
||||
/* Preamble and sync */
|
||||
*(dest + 0) = 0xaa;
|
||||
*(dest + 1) = 0xaa;
|
||||
*(dest + 2) = 0xaa;
|
||||
*(dest + 3) = 0xaa;
|
||||
*(dest + 4) = 0x44;
|
||||
*(dest + 5) = 0x89;
|
||||
*(dest + 6) = 0x44;
|
||||
*(dest + 7) = 0x89;
|
||||
|
||||
/* Track and sector info */
|
||||
|
||||
tmp = 0xff000000 | (offset<<16) | (sector<<8) | (11 - sector);
|
||||
odd = (tmp & 0x55555555) | 0xaaaaaaaa;
|
||||
even = ( ( tmp >> 1 ) & 0x55555555 ) | 0xaaaaaaaa;
|
||||
*(dest + 8) = (UINT8) ((even & 0xff000000)>>24);
|
||||
*(dest + 9) = (UINT8) ((even & 0xff0000)>>16);
|
||||
*(dest + 10) = (UINT8) ((even & 0xff00)>>8);
|
||||
*(dest + 11) = (UINT8) ((even & 0xff));
|
||||
*(dest + 12) = (UINT8) ((odd & 0xff000000)>>24);
|
||||
*(dest + 13) = (UINT8) ((odd & 0xff0000)>>16);
|
||||
*(dest + 14) = (UINT8) ((odd & 0xff00)>>8);
|
||||
*(dest + 15) = (UINT8) ((odd & 0xff));
|
||||
|
||||
/* Fill unused space */
|
||||
|
||||
for (x = 16 ; x < 48; x++)
|
||||
*(dest + x) = 0xaa;
|
||||
|
||||
/* Encode data section of sector */
|
||||
|
||||
for (x = 64 ; x < 576; x++)
|
||||
{
|
||||
tmp = *(src + x - 64);
|
||||
odd = (tmp & 0x55);
|
||||
even = (tmp>>1) & 0x55;
|
||||
*(dest + x) = (UINT8) (even | 0xaa);
|
||||
*(dest + x + 512) = (UINT8) (odd | 0xaa);
|
||||
}
|
||||
|
||||
/* Calculate checksum for unused space */
|
||||
|
||||
for(x = 8; x < 48; x += 4)
|
||||
hck ^= (((UINT32) *(dest + x))<<24) | (((UINT32) *(dest + x + 1))<<16) |
|
||||
(((UINT32) *(dest + x + 2))<<8) | ((UINT32) *(dest + x + 3));
|
||||
|
||||
even = odd = hck;
|
||||
odd >>= 1;
|
||||
even |= 0xaaaaaaaa;
|
||||
odd |= 0xaaaaaaaa;
|
||||
|
||||
*(dest + 48) = (UINT8) ((odd & 0xff000000)>>24);
|
||||
*(dest + 49) = (UINT8) ((odd & 0xff0000)>>16);
|
||||
*(dest + 50) = (UINT8) ((odd & 0xff00)>>8);
|
||||
*(dest + 51) = (UINT8) (odd & 0xff);
|
||||
*(dest + 52) = (UINT8) ((even & 0xff000000)>>24);
|
||||
*(dest + 53) = (UINT8) ((even & 0xff0000)>>16);
|
||||
*(dest + 54) = (UINT8) ((even & 0xff00)>>8);
|
||||
*(dest + 55) = (UINT8) (even & 0xff);
|
||||
|
||||
/* Calculate checksum for data section */
|
||||
|
||||
for(x = 64; x < 1088; x += 4)
|
||||
dck ^= (((UINT32) *(dest + x))<<24) | (((UINT32) *(dest + x + 1))<<16) |
|
||||
(((UINT32) *(dest + x + 2))<< 8) | ((UINT32) *(dest + x + 3));
|
||||
even = odd = dck;
|
||||
odd >>= 1;
|
||||
even |= 0xaaaaaaaa;
|
||||
odd |= 0xaaaaaaaa;
|
||||
*(dest + 56) = (UINT8) ((odd & 0xff000000)>>24);
|
||||
*(dest + 57) = (UINT8) ((odd & 0xff0000)>>16);
|
||||
*(dest + 58) = (UINT8) ((odd & 0xff00)>>8);
|
||||
*(dest + 59) = (UINT8) (odd & 0xff);
|
||||
*(dest + 60) = (UINT8) ((even & 0xff000000)>>24);
|
||||
*(dest + 61) = (UINT8) ((even & 0xff0000)>>16);
|
||||
*(dest + 62) = (UINT8) ((even & 0xff00)>>8);
|
||||
*(dest + 63) = (UINT8) (even & 0xff);
|
||||
}
|
||||
|
||||
// update MFM data with proper CLK signal
|
||||
int lastbit= 0;
|
||||
for(int i=0;i<MAX_TRACK_BYTES ;i++)
|
||||
{
|
||||
UINT8 c=mfm[i];
|
||||
UINT8 dat = 0;
|
||||
for(int j=0;j<8;j=j+2)
|
||||
{
|
||||
UINT8 c1=(c>>(6-j))&0x3;
|
||||
if(c1&0x1)
|
||||
{
|
||||
dat |= (0x01<<(6-j));
|
||||
lastbit=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(lastbit==0 && (c1&0x2))
|
||||
{
|
||||
dat |= (0x02<<(6-j));
|
||||
}
|
||||
else
|
||||
{
|
||||
dat |= (0x00<<(6-j));
|
||||
}
|
||||
lastbit=0;
|
||||
}
|
||||
}
|
||||
mfm[i] = dat;
|
||||
}
|
||||
image->set_track_size(track, side, 16384);
|
||||
image->image_read(sectdata, (track*2 + side)*512*11, 512*11);
|
||||
generate_track(desc, track, side, sectors, 11, 100000, mfm);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@ public:
|
||||
|
||||
virtual int identify(floppy_image *image);
|
||||
virtual bool load(floppy_image *image);
|
||||
|
||||
static const desc_e desc[];
|
||||
};
|
||||
|
||||
extern const floppy_format_type FLOPPY_ADF_FORMAT;
|
||||
|
@ -1029,3 +1029,277 @@ floppy_image_format_t::floppy_image_format_t(const char *name,const char *extens
|
||||
floppy_image_format_t::~floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
bool floppy_image_format_t::type_no_data(int type) const
|
||||
{
|
||||
return type == CRC_CCITT_START ||
|
||||
type == CRC_AMIGA_START ||
|
||||
type == CRC_END ||
|
||||
type == SECTOR_LOOP_START ||
|
||||
type == SECTOR_LOOP_END ||
|
||||
type == END;
|
||||
}
|
||||
|
||||
bool floppy_image_format_t::type_data_mfm(int type, int p1, const gen_crc_info *crcs) const
|
||||
{
|
||||
return !type_no_data(type) &&
|
||||
type != RAW &&
|
||||
type != RAWBITS &&
|
||||
(type != CRC || (crcs[p1].type != CRC_CCITT && crcs[p1].type != CRC_AMIGA));
|
||||
}
|
||||
|
||||
void floppy_image_format_t::collect_crcs(const desc_e *desc, gen_crc_info *crcs)
|
||||
{
|
||||
memset(crcs, 0, MAX_CRC_COUNT * sizeof(*crcs));
|
||||
for(int i=0; i != MAX_CRC_COUNT; i++)
|
||||
crcs[i].write = -1;
|
||||
|
||||
for(int i=0; desc[i].type != END; i++)
|
||||
switch(desc[i].type) {
|
||||
case CRC_CCITT_START:
|
||||
crcs[desc[i].p1].type = CRC_CCITT;
|
||||
break;
|
||||
case CRC_AMIGA_START:
|
||||
crcs[desc[i].p1].type = CRC_AMIGA;
|
||||
break;
|
||||
}
|
||||
|
||||
for(int i=0; desc[i].type != END; i++)
|
||||
if(desc[i].type == CRC) {
|
||||
int j;
|
||||
for(j = i+1; desc[j].type != END && type_no_data(desc[j].type); j++);
|
||||
crcs[desc[i].p1].fixup_mfm_clock = type_data_mfm(desc[j].type, desc[j].p1, crcs);
|
||||
}
|
||||
}
|
||||
|
||||
int floppy_image_format_t::crc_cells_size(int type) const
|
||||
{
|
||||
switch(type) {
|
||||
case CRC_CCITT: return 32;
|
||||
case CRC_AMIGA: return 64;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool floppy_image_format_t::bit_r(UINT8 *buffer, int offset)
|
||||
{
|
||||
return (buffer[offset >> 3] >> ((offset & 7) ^ 7)) & 1;
|
||||
}
|
||||
|
||||
void floppy_image_format_t::bit_w(UINT8 *buffer, int offset, bool val)
|
||||
{
|
||||
if(val)
|
||||
buffer[offset >> 3] |= 0x80 >> (offset & 7);
|
||||
else
|
||||
buffer[offset >> 3] &= ~(0x80 >> (offset & 7));
|
||||
}
|
||||
|
||||
void floppy_image_format_t::raw_w(UINT8 *buffer, int &offset, int n, UINT32 val)
|
||||
{
|
||||
for(int i=n-1; i>=0; i--)
|
||||
bit_w(buffer, offset++, (val >> i) & 1);
|
||||
}
|
||||
|
||||
void floppy_image_format_t::mfm_w(UINT8 *buffer, int &offset, int n, UINT32 val)
|
||||
{
|
||||
int prec = offset ? bit_r(buffer, offset-1) : 0;
|
||||
for(int i=n-1; i>=0; i--) {
|
||||
int bit = (val >> i) & 1;
|
||||
bit_w(buffer, offset++, !(prec || bit));
|
||||
bit_w(buffer, offset++, bit);
|
||||
prec = bit;
|
||||
}
|
||||
}
|
||||
|
||||
void floppy_image_format_t::mfm_half_w(UINT8 *buffer, int &offset, int start_bit, UINT32 val)
|
||||
{
|
||||
int prec = offset ? bit_r(buffer, offset-1) : 0;
|
||||
for(int i=start_bit; i>=0; i-=2) {
|
||||
int bit = (val >> i) & 1;
|
||||
bit_w(buffer, offset++, !(prec || bit));
|
||||
bit_w(buffer, offset++, bit);
|
||||
prec = bit;
|
||||
}
|
||||
}
|
||||
|
||||
void floppy_image_format_t::fixup_crc_amiga(UINT8 *buffer, const gen_crc_info *crc)
|
||||
{
|
||||
UINT16 res = 0;
|
||||
int size = crc->end - crc->start;
|
||||
for(int i=1; i<size; i+=2)
|
||||
if(bit_r(buffer, crc->start + i))
|
||||
res = res ^ (0x8000 >> ((i >> 1) & 15));
|
||||
int offset = crc->write;
|
||||
mfm_w(buffer, offset, 16, 0);
|
||||
mfm_w(buffer, offset, 16, res);
|
||||
}
|
||||
|
||||
void floppy_image_format_t::fixup_crc_ccitt(UINT8 *buffer, const gen_crc_info *crc)
|
||||
{
|
||||
UINT32 res = 0xffff;
|
||||
int size = crc->end - crc->start;
|
||||
for(int i=1; i<size; i+=2) {
|
||||
res <<= 1;
|
||||
if(bit_r(buffer, crc->start + i))
|
||||
res ^= 0x10000;
|
||||
if(res & 0x10000)
|
||||
res ^= 0x11021;
|
||||
}
|
||||
int offset = crc->write;
|
||||
mfm_w(buffer, offset, 16, res);
|
||||
}
|
||||
|
||||
void floppy_image_format_t::fixup_crcs(UINT8 *buffer, gen_crc_info *crcs)
|
||||
{
|
||||
for(int i=0; i != MAX_CRC_COUNT; i++)
|
||||
if(crcs[i].write != -1) {
|
||||
switch(crcs[i].type) {
|
||||
case CRC_AMIGA: fixup_crc_amiga(buffer, crcs+i); break;
|
||||
case CRC_CCITT: fixup_crc_ccitt(buffer, crcs+i); break;
|
||||
}
|
||||
if(crcs[i].fixup_mfm_clock) {
|
||||
int offset = crcs[i].write + crc_cells_size(crcs[i].type);
|
||||
bit_w(buffer, offset, !((offset ? bit_r(buffer, offset-1) : false) || bit_r(buffer, offset+1)));
|
||||
}
|
||||
crcs[i].write = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void floppy_image_format_t::generate_track(const desc_e *desc, UINT8 track, UINT8 head, const desc_s *sect, int sect_count, int track_size, UINT8 *buffer)
|
||||
{
|
||||
memset(buffer, 0, (track_size+7)/8);
|
||||
|
||||
gen_crc_info crcs[MAX_CRC_COUNT];
|
||||
collect_crcs(desc, crcs);
|
||||
|
||||
int offset = 0;
|
||||
int index = 0;
|
||||
int sector_loop_start = 0;
|
||||
int sector_id = 0;
|
||||
int sector_limit = 0;
|
||||
|
||||
while(desc[index].type != END) {
|
||||
// printf("%d.%d.%d (%d) - %d %d\n", desc[index].type, desc[index].p1, desc[index].p2, index, offset, offset/8);
|
||||
switch(desc[index].type) {
|
||||
case MFM:
|
||||
for(int i=0; i<desc[index].p2; i++)
|
||||
mfm_w(buffer, offset, 8, desc[index].p1);
|
||||
break;
|
||||
|
||||
case MFMBITS:
|
||||
mfm_w(buffer, offset, desc[index].p2, desc[index].p1);
|
||||
break;
|
||||
|
||||
case RAW:
|
||||
for(int i=0; i<desc[index].p2; i++)
|
||||
raw_w(buffer, offset, 16, desc[index].p1);
|
||||
break;
|
||||
|
||||
case RAWBITS:
|
||||
raw_w(buffer, offset, desc[index].p2, desc[index].p1);
|
||||
break;
|
||||
|
||||
case TRACK_ID:
|
||||
mfm_w(buffer, offset, 8, track);
|
||||
break;
|
||||
|
||||
case HEAD_ID:
|
||||
mfm_w(buffer, offset, 8, head);
|
||||
break;
|
||||
|
||||
case SECTOR_ID:
|
||||
mfm_w(buffer, offset, 8, sector_id);
|
||||
break;
|
||||
|
||||
case SIZE_ID: {
|
||||
int size = sect[sector_id].size;
|
||||
int id;
|
||||
for(id = 0; size > 128; size >>=1, id++);
|
||||
mfm_w(buffer, offset, 8, id);
|
||||
break;
|
||||
}
|
||||
|
||||
case OFFSET_ID_O:
|
||||
mfm_half_w(buffer, offset, 7, track*2+head);
|
||||
break;
|
||||
|
||||
case OFFSET_ID_E:
|
||||
mfm_half_w(buffer, offset, 6, track*2+head);
|
||||
break;
|
||||
|
||||
case SECTOR_ID_O:
|
||||
mfm_half_w(buffer, offset, 7, sector_id);
|
||||
break;
|
||||
|
||||
case SECTOR_ID_E:
|
||||
mfm_half_w(buffer, offset, 6, sector_id);
|
||||
break;
|
||||
|
||||
case REMAIN_O:
|
||||
mfm_half_w(buffer, offset, 7, desc[index].p1 - sector_id);
|
||||
break;
|
||||
|
||||
case REMAIN_E:
|
||||
mfm_half_w(buffer, offset, 6, desc[index].p1 - sector_id);
|
||||
break;
|
||||
|
||||
case SECTOR_LOOP_START:
|
||||
fixup_crcs(buffer, crcs);
|
||||
sector_loop_start = index;
|
||||
sector_id = desc[index].p1;
|
||||
sector_limit = desc[index].p2;
|
||||
break;
|
||||
|
||||
case SECTOR_LOOP_END:
|
||||
fixup_crcs(buffer, crcs);
|
||||
if(sector_id < sector_limit) {
|
||||
sector_id++;
|
||||
index = sector_loop_start;
|
||||
}
|
||||
break;
|
||||
|
||||
case CRC_AMIGA_START:
|
||||
case CRC_CCITT_START:
|
||||
crcs[desc[index].p1].start = offset;
|
||||
break;
|
||||
|
||||
case CRC_END:
|
||||
crcs[desc[index].p1].end = offset;
|
||||
break;
|
||||
|
||||
case CRC:
|
||||
crcs[desc[index].p1].write = offset;
|
||||
offset += crc_cells_size(crcs[desc[index].p1].type);
|
||||
break;
|
||||
|
||||
case SECTOR_DATA: {
|
||||
const desc_s *csect = sect + (desc[index].p1 >= 0 ? desc[index].p1 : sector_id);
|
||||
for(int i=0; i != csect->size; i++)
|
||||
mfm_w(buffer, offset, 8, csect->data[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
case SECTOR_DATA_O: {
|
||||
const desc_s *csect = sect + (desc[index].p1 >= 0 ? desc[index].p1 : sector_id);
|
||||
for(int i=0; i != csect->size; i++)
|
||||
mfm_half_w(buffer, offset, 7, csect->data[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
case SECTOR_DATA_E: {
|
||||
const desc_s *csect = sect + (desc[index].p1 >= 0 ? desc[index].p1 : sector_id);
|
||||
for(int i=0; i != csect->size; i++)
|
||||
mfm_half_w(buffer, offset, 6, csect->data[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
printf("%d.%d.%d (%d) unhandled\n", desc[index].type, desc[index].p1, desc[index].p2, index);
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
fixup_crcs(buffer, crcs);
|
||||
}
|
||||
|
||||
|
@ -228,10 +228,84 @@ public:
|
||||
virtual int identify(floppy_image *image) = 0;
|
||||
virtual bool load(floppy_image *image) = 0;
|
||||
protected:
|
||||
// Struct designed for easy track data description
|
||||
// Optional, you can always do things by hand, but useful nevertheless
|
||||
// A vector of these structures describes one track.
|
||||
|
||||
struct desc_e {
|
||||
int type, p1, p2;
|
||||
};
|
||||
|
||||
enum {
|
||||
END, // End of description
|
||||
MFM, // One byte in p1 to be mfm-encoded, msb first, repeated p2 times
|
||||
MFMBITS, // A value of p2 bits in p1 to be mfm-encoded, msb first
|
||||
RAW, // One 16 bits word in p1 to be written raw, msb first, repeated p2 times
|
||||
RAWBITS, // A value of p2 bits in p1 to be copied as-is, msb first
|
||||
TRACK_ID, // Track id byte, mfm-encoded
|
||||
HEAD_ID, // Head id byte, mfm-encoded
|
||||
SECTOR_ID, // Sector id byte, mfm-encoded
|
||||
SIZE_ID, // Sector size code on one byte [log2(size/128)], mfm-encoded
|
||||
OFFSET_ID_O, // Offset (track*2+head) byte, odd bits, mfm-encoded
|
||||
OFFSET_ID_E, // Offset (track*2+head) byte, even bits, mfm-encoded
|
||||
SECTOR_ID_O, // Sector id byte, odd bits, mfm-encoded
|
||||
SECTOR_ID_E, // Sector id byte, even bits, mfm-encoded
|
||||
REMAIN_O, // Remaining sector count, odd bits, mfm-encoded, total sector count in p1
|
||||
REMAIN_E, // Remaining sector count, even bits, mfm-encoded, total sector count in p1
|
||||
|
||||
SECTOR_DATA, // Sector data to mfm-encode, which in p1, -1 for the current one per the sector id
|
||||
SECTOR_DATA_O, // Sector data to mfm-encode, odd bits only, which in p1, -1 for the current one per the sector id
|
||||
SECTOR_DATA_E, // Sector data to mfm-encode, even bits only, which in p1, -1 for the current one per the sector id
|
||||
|
||||
CRC_CCITT_START, // Start a CCITT CRC calculation, with the usual x^16 + x^12 + x^5 + 1 (11021) polynomial, p1 = crc id, p2 = init value
|
||||
CRC_AMIGA_START, // Start an amiga checksum calculation, p1 = crc id
|
||||
CRC_END, // End the checksum, p1 = crc id
|
||||
CRC, // Write a checksum in the apporpriate format, p1 = crc id
|
||||
|
||||
SECTOR_LOOP_START, // Start of the per-sector loop, sector number goes from p1 to p2 inclusive
|
||||
SECTOR_LOOP_END, // End of the per-sector loop
|
||||
};
|
||||
|
||||
// Sector data description
|
||||
struct desc_s {
|
||||
int size; // Sector size, int bytes
|
||||
const UINT8 *data; // Sector data
|
||||
};
|
||||
|
||||
|
||||
// Generate one track according to the description vector
|
||||
// "sect" is a vector indexed by sector id
|
||||
// "track_size" is in _cells_, i.e. 100000 for a usual 2us-per-cell track at 300rpm
|
||||
|
||||
void generate_track(const desc_e *desc, UINT8 track, UINT8 head, const desc_s *sect, int sect_count, int track_size, UINT8 *buffer);
|
||||
|
||||
const char *m_name;
|
||||
const char *m_extensions;
|
||||
const char *m_description;
|
||||
const char *m_param_guidelines;
|
||||
|
||||
private:
|
||||
enum { CRC_NONE, CRC_AMIGA, CRC_CCITT };
|
||||
enum { MAX_CRC_COUNT = 64 };
|
||||
struct gen_crc_info {
|
||||
int type, start, end, write;
|
||||
bool fixup_mfm_clock;
|
||||
};
|
||||
|
||||
bool type_no_data(int type) const;
|
||||
bool type_data_mfm(int type, int p1, const gen_crc_info *crcs) const;
|
||||
|
||||
bool bit_r(UINT8 *buffer, int offset);
|
||||
void bit_w(UINT8 *buffer, int offset, bool val);
|
||||
|
||||
int crc_cells_size(int type) const;
|
||||
void fixup_crc_amiga(UINT8 *buffer, const gen_crc_info *crc);
|
||||
void fixup_crc_ccitt(UINT8 *buffer, const gen_crc_info *crc);
|
||||
void fixup_crcs(UINT8 *buffer, gen_crc_info *crcs);
|
||||
void raw_w(UINT8 *buffer, int &offset, int n, UINT32 val);
|
||||
void mfm_w(UINT8 *buffer, int &offset, int n, UINT32 val);
|
||||
void mfm_half_w(UINT8 *buffer, int &offset, int start_bit, UINT32 val);
|
||||
void collect_crcs(const desc_e *desc, gen_crc_info *crcs);
|
||||
};
|
||||
|
||||
|
||||
@ -299,6 +373,7 @@ public:
|
||||
UINT8* get_buffer(UINT16 track, UINT8 side) { return m_native_data[(track << 1) + side]; }
|
||||
UINT16 get_track_size(UINT16 track, UINT8 side) { return m_track_size[(track << 1) + side]; }
|
||||
bool load(int num);
|
||||
|
||||
private:
|
||||
void close_internal(bool close_file);
|
||||
struct io_generic m_io;
|
||||
|
@ -0,0 +1,605 @@
|
||||
/*********************************************************************
|
||||
|
||||
formats/st_dsk.c
|
||||
|
||||
Atari ST generic 9/10/11 sector-per-track formats
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#include "formats/st_dsk.h"
|
||||
|
||||
st_gen_format::st_gen_format(const char *name,const char *extensions,const char *description,const char *param_guidelines) :
|
||||
floppy_image_format_t(name,extensions,description,param_guidelines)
|
||||
{
|
||||
}
|
||||
|
||||
#define SECTOR_42_HEADER(cid) \
|
||||
{ CRC_CCITT_START, cid }, \
|
||||
{ RAW, 0x4489, 3 }, \
|
||||
{ MFM, 0xfe, 1 }, \
|
||||
{ TRACK_ID }, \
|
||||
{ HEAD_ID }, \
|
||||
{ MFM, 0x42, 1 }, \
|
||||
{ MFM, 0x02, 1 }, \
|
||||
{ CRC_END, cid }, \
|
||||
{ CRC, cid }
|
||||
|
||||
#define NORMAL_SECTOR(cid) \
|
||||
{ CRC_CCITT_START, cid }, \
|
||||
{ RAW, 0x4489, 3 }, \
|
||||
{ MFM, 0xfe, 1 }, \
|
||||
{ TRACK_ID }, \
|
||||
{ HEAD_ID }, \
|
||||
{ SECTOR_ID }, \
|
||||
{ SIZE_ID }, \
|
||||
{ CRC_END, cid }, \
|
||||
{ CRC, cid }, \
|
||||
{ MFM, 0x4e, 22 }, \
|
||||
{ MFM, 0x00, 12 }, \
|
||||
{ CRC_CCITT_START, cid+1 }, \
|
||||
{ RAW, 0x4489, 3 }, \
|
||||
{ MFM, 0xfb, 1 }, \
|
||||
{ SECTOR_DATA, -1 }, \
|
||||
{ CRC_END, cid+1 }, \
|
||||
{ CRC, cid+1 }
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_9[] = {
|
||||
{ MFM, 0x4e, 501 },
|
||||
{ MFM, 0x00, 12 },
|
||||
|
||||
SECTOR_42_HEADER(1),
|
||||
|
||||
{ MFM, 0x4e, 22 },
|
||||
{ MFM, 0x00, 12 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 9 },
|
||||
NORMAL_SECTOR(2),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
SECTOR_42_HEADER(4),
|
||||
|
||||
{ MFM, 0x4e, 157 },
|
||||
|
||||
{ END }
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_0[] = {
|
||||
{ MFM, 0x4e, 46 },
|
||||
SECTOR_42_HEADER(1),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 10 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END }
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_1[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 10, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 9 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_2[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 9, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 8 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_3[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 8, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 7 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_4[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 7, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 6 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_5[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 6, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 5 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_6[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 5, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 4 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_7[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 4, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 3 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_8[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 3, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 2 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_10_9[] = {
|
||||
{ MFM, 0x4e, 20 },
|
||||
{ SECTOR_LOOP_START, 2, 10 },
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(1),
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 26 },
|
||||
SECTOR_42_HEADER(3),
|
||||
{ MFM, 0x4e, 5 },
|
||||
|
||||
{ SECTOR_LOOP_START, 1, 1 },
|
||||
{ MFM, 0x00, 12 },
|
||||
NORMAL_SECTOR(4),
|
||||
{ MFM, 0x4e, 40 },
|
||||
{ SECTOR_LOOP_END },
|
||||
|
||||
{ MFM, 0x4e, 49 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e *const st_gen_format::desc_fcp_10[] = {
|
||||
desc_fcp_10_0,
|
||||
desc_fcp_10_1,
|
||||
desc_fcp_10_2,
|
||||
desc_fcp_10_3,
|
||||
desc_fcp_10_4,
|
||||
desc_fcp_10_5,
|
||||
desc_fcp_10_6,
|
||||
desc_fcp_10_7,
|
||||
desc_fcp_10_8,
|
||||
desc_fcp_10_9,
|
||||
};
|
||||
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_0[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_1[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_2[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_3[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_4[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_5[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_6[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_7[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_8[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_9[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
const floppy_image_format_t::desc_e st_gen_format::desc_fcp_11_10[] = {
|
||||
{ MFM, 0x4e, 3 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 2, 2 }, NORMAL_SECTOR( 5), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 8, 8 }, NORMAL_SECTOR( 7), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 3, 3 }, NORMAL_SECTOR( 9), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 9, 9 }, NORMAL_SECTOR(11), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 4, 4 }, NORMAL_SECTOR(13), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 10, 10 }, NORMAL_SECTOR(15), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 5, 5 }, NORMAL_SECTOR(17), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 11, 11 }, NORMAL_SECTOR(19), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 6, 6 }, NORMAL_SECTOR(21), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 1, 1 }, NORMAL_SECTOR( 1), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 2 }, { MFM, 0x00, 2 },
|
||||
{ SECTOR_LOOP_START, 7, 7 }, NORMAL_SECTOR( 3), { SECTOR_LOOP_END },
|
||||
{ MFM, 0x4e, 23 },
|
||||
{ END },
|
||||
};
|
||||
|
||||
|
||||
const floppy_image_format_t::desc_e *const st_gen_format::desc_fcp_11[] = {
|
||||
desc_fcp_11_0,
|
||||
desc_fcp_11_1,
|
||||
desc_fcp_11_2,
|
||||
desc_fcp_11_3,
|
||||
desc_fcp_11_4,
|
||||
desc_fcp_11_5,
|
||||
desc_fcp_11_6,
|
||||
desc_fcp_11_7,
|
||||
desc_fcp_11_8,
|
||||
desc_fcp_11_9,
|
||||
desc_fcp_11_10,
|
||||
};
|
@ -0,0 +1,47 @@
|
||||
/*********************************************************************
|
||||
|
||||
formats/st_dsk.h
|
||||
|
||||
Atari ST generic 9/10/11 sector-per-track formats
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef ST_DSK_H_
|
||||
#define ST_DSK_H_
|
||||
|
||||
#include "flopimg.h"
|
||||
|
||||
class st_gen_format : public floppy_image_format_t
|
||||
{
|
||||
public:
|
||||
st_gen_format(const char *name,const char *extensions,const char *description,const char *param_guidelines);
|
||||
|
||||
static const desc_e desc_fcp_9[];
|
||||
|
||||
static const desc_e desc_fcp_10_0[];
|
||||
static const desc_e desc_fcp_10_1[];
|
||||
static const desc_e desc_fcp_10_2[];
|
||||
static const desc_e desc_fcp_10_3[];
|
||||
static const desc_e desc_fcp_10_4[];
|
||||
static const desc_e desc_fcp_10_5[];
|
||||
static const desc_e desc_fcp_10_6[];
|
||||
static const desc_e desc_fcp_10_7[];
|
||||
static const desc_e desc_fcp_10_8[];
|
||||
static const desc_e desc_fcp_10_9[];
|
||||
static const desc_e *const desc_fcp_10[];
|
||||
|
||||
static const desc_e desc_fcp_11_0[];
|
||||
static const desc_e desc_fcp_11_1[];
|
||||
static const desc_e desc_fcp_11_2[];
|
||||
static const desc_e desc_fcp_11_3[];
|
||||
static const desc_e desc_fcp_11_4[];
|
||||
static const desc_e desc_fcp_11_5[];
|
||||
static const desc_e desc_fcp_11_6[];
|
||||
static const desc_e desc_fcp_11_7[];
|
||||
static const desc_e desc_fcp_11_8[];
|
||||
static const desc_e desc_fcp_11_9[];
|
||||
static const desc_e desc_fcp_11_10[];
|
||||
static const desc_e *const desc_fcp_11[];
|
||||
};
|
||||
|
||||
#endif /*ST_DSK_H_*/
|
@ -134,6 +134,7 @@ FORMATSOBJS = \
|
||||
$(LIBOBJ)/formats/smx_dsk.o \
|
||||
$(LIBOBJ)/formats/sorc_dsk.o \
|
||||
$(LIBOBJ)/formats/sord_cas.o \
|
||||
$(LIBOBJ)/formats/st_dsk.o \
|
||||
$(LIBOBJ)/formats/svi_cas.o \
|
||||
$(LIBOBJ)/formats/svi_dsk.o \
|
||||
$(LIBOBJ)/formats/td0_dsk.o \
|
||||
|
Loading…
Reference in New Issue
Block a user