diff options
author | 2015-11-08 12:56:12 +0100 | |
---|---|---|
committer | 2015-11-08 12:56:12 +0100 | |
commit | 7c19aac60e12d6f5ea301bdb34d7826a01e0b06f (patch) | |
tree | f310d86aa2c6bfc19d115307dedde4eb0cd52dad /src/lib/formats/naslite_dsk.cpp | |
parent | a57b46ae933badd7441ce1644711dbb851e2b504 (diff) |
Rename *.c -> *.cpp in our source (nw)
Diffstat (limited to 'src/lib/formats/naslite_dsk.cpp')
-rw-r--r-- | src/lib/formats/naslite_dsk.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/lib/formats/naslite_dsk.cpp b/src/lib/formats/naslite_dsk.cpp new file mode 100644 index 00000000000..342407a7c95 --- /dev/null +++ b/src/lib/formats/naslite_dsk.cpp @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************* + + formats/naslite_dsk.c + + NASLite 1.72MB with funky interleaving format + +*********************************************************************/ + +#include <assert.h> + +#include "formats/naslite_dsk.h" + +naslite_format::naslite_format() : upd765_format(formats) +{ +} + +const char *naslite_format::name() const +{ + return "NASLite"; +} + +const char *naslite_format::description() const +{ + return "NASLite disk image"; +} + +const char *naslite_format::extensions() const +{ + return "img"; +} + +const naslite_format::format naslite_format::formats[] = { + { + floppy_image::FF_35, floppy_image::DSHD, floppy_image::MFM, + 1000, 21, 82, 2, 512, {}, -1, { 0x01, 0x0c, 0x02, 0x0d, 0x03, 0x0e, 0x04, 0x0f, 0x05, 0x10, 0x06, 0x11, 0x07, 0x12, 0x08, 0x13, 0x09, 0x14, 0x0a, 0x15, 0x0b }, 80, 50, 22, 0xc + }, + {} +}; + +void naslite_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors, int track, int head) const +{ + for(int i=0; i<f.sector_count; i++) { + int cur_offset = 0; + for(int j=0; j<f.sector_count; j++) + if(f.per_sector_id[j] < f.per_sector_id[i]) + cur_offset += f.sector_base_size ? f.sector_base_size : f.per_sector_size[j]; + sectors[i].data = sectdata + cur_offset; + sectors[i].size = f.sector_base_size ? f.sector_base_size : f.per_sector_size[i]; + sectors[i].sector_id = f.per_sector_id[(i + (track * 0x0a) + (head * 0x11)) % f.sector_count]; + } +} + +const floppy_format_type FLOPPY_NASLITE_FORMAT = &floppy_image_format_creator<naslite_format>; |