diff options
author | 2013-11-18 19:33:05 +0000 | |
---|---|---|
committer | 2013-11-18 19:33:05 +0000 | |
commit | 0d99a0d5836479932c1adef21559e85a902abc64 (patch) | |
tree | 3b2023454f763d0d96131212d7e4691392ba36de /src/lib/formats/tiki100_dsk.c | |
parent | 070a83ecff9bb59d477678442e736a71535cf0ec (diff) |
(MESS) tiki100: Floppy WIP. (nw)
Diffstat (limited to 'src/lib/formats/tiki100_dsk.c')
-rw-r--r-- | src/lib/formats/tiki100_dsk.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/lib/formats/tiki100_dsk.c b/src/lib/formats/tiki100_dsk.c index 0ec3f7f95ff..e9721c7704d 100644 --- a/src/lib/formats/tiki100_dsk.c +++ b/src/lib/formats/tiki100_dsk.c @@ -35,7 +35,7 @@ const char *tiki100_format::extensions() const const tiki100_format::format tiki100_format::formats[] = { { // 90K 5 1/4 inch single density single sided floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM, - 4000, 18, 40, 1, 128, {}, 1, {}, 40, 11, 10 + 4000, 18, 40, 1, 128, {}, 1, {}, 16, 11, 8 }, { // 200K 5 1/4 inch double density single sided floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM, @@ -52,4 +52,46 @@ const tiki100_format::format tiki100_format::formats[] = { {} }; +floppy_image_format_t::desc_e* tiki100_format::get_desc_fm(const format &f, int ¤t_size, int &end_gap_index) +{ + static floppy_image_format_t::desc_e desc[23] = { + /* 00 */ { FM, 0xff, f.gap_1 }, + /* 01 */ { SECTOR_LOOP_START, 0, f.sector_count-1 }, + /* 02 */ { FM, 0x00, 4 }, // NOTE here is the difference to wd177x_format + /* 03 */ { CRC_CCITT_FM_START, 1 }, + /* 04 */ { RAW, 0xf57e, 1 }, + /* 05 */ { TRACK_ID_FM }, + /* 06 */ { HEAD_ID_FM }, + /* 07 */ { SECTOR_ID_FM }, + /* 08 */ { SIZE_ID_FM }, + /* 09 */ { CRC_END, 1 }, + /* 10 */ { CRC, 1 }, + /* 11 */ { FM, 0xff, f.gap_2 }, + /* 12 */ { FM, 0x00, 6 }, + /* 13 */ { CRC_CCITT_FM_START, 2 }, + /* 14 */ { RAW, 0xf56f, 1 }, + /* 15 */ { SECTOR_DATA_FM, -1 }, + /* 16 */ { CRC_END, 2 }, + /* 17 */ { CRC, 2 }, + /* 18 */ { FM, 0xff, f.gap_3 }, + /* 19 */ { SECTOR_LOOP_END }, + /* 20 */ { FM, 0xff, 0 }, + /* 21 */ { RAWBITS, 0xffff, 0 }, + /* 22 */ { END } + }; + + current_size = f.gap_1*16; + if(f.sector_base_size) + current_size += f.sector_base_size * f.sector_count * 16; + else { + for(int j=0; j != f.sector_count; j++) + current_size += f.per_sector_size[j] * 16; + } + current_size += (4+1+4+2+f.gap_2+6+1+2+f.gap_3) * f.sector_count * 16; + + end_gap_index = 20; + + return desc; +} + const floppy_format_type FLOPPY_TIKI100_FORMAT = &floppy_image_format_creator<tiki100_format>; |