src/lib/formats/dsk_dsk.c
| r12862 | r12863 | |
| 255 | 255 | callbacks->get_indexed_sector_info = dsk_get_indexed_sector_info; |
| 256 | 256 | return FLOPPY_ERROR_SUCCESS; |
| 257 | 257 | } |
| 258 | |
| 259 | #include "emu.h" |
| 260 | #include "dsk_dsk.h" |
| 261 | |
| 262 | #define DSK_FORMAT_HEADER "MV - CPC" |
| 263 | #define EXT_FORMAT_HEADER "EXTENDED CPC DSK" |
| 264 | |
| 265 | dsk_format::dsk_format() : floppy_image_format_t() |
| 266 | { |
| 267 | } |
| 268 | |
| 269 | const char *dsk_format::name() const |
| 270 | { |
| 271 | return "dsk"; |
| 272 | } |
| 273 | |
| 274 | const char *dsk_format::description() const |
| 275 | { |
| 276 | return "CPC DSK Format"; |
| 277 | } |
| 278 | |
| 279 | const char *dsk_format::extensions() const |
| 280 | { |
| 281 | return "dsk"; |
| 282 | } |
| 283 | |
| 284 | bool dsk_format::supports_save() const |
| 285 | { |
| 286 | return false; |
| 287 | } |
| 288 | |
| 289 | int dsk_format::identify(io_generic *io) |
| 290 | { |
| 291 | UINT8 header[16]; |
| 292 | |
| 293 | io_generic_read(io, &header, 0, sizeof(header)); |
| 294 | if ( memcmp( header, DSK_FORMAT_HEADER, 8 ) ==0) { |
| 295 | return 100; |
| 296 | } |
| 297 | if ( memcmp( header, EXT_FORMAT_HEADER, 16 ) ==0) { |
| 298 | return 100; |
| 299 | } |
| 300 | return 0; |
| 301 | } |
| 302 | |
| 303 | bool dsk_format::load(io_generic *io, floppy_image *image) |
| 304 | { |
| 305 | return FALSE; |
| 306 | } |
| 307 | |
| 308 | const floppy_format_type FLOPPY_DSK_FORMAT = &floppy_image_format_creator<dsk_format>; |
| 309 | |
src/lib/formats/dsk_dsk.h
| r0 | r12863 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | formats/dsk_dsk.h |
| 4 | |
| 5 | CPC DSK disk images |
| 6 | |
| 7 | *********************************************************************/ |
| 8 | |
| 9 | #ifndef CPCDSK_DSK_H |
| 10 | #define CPCDSK_DSK_H |
| 11 | |
| 12 | #include "flopimg.h" |
| 13 | |
| 14 | class dsk_format : public floppy_image_format_t |
| 15 | { |
| 16 | public: |
| 17 | dsk_format(); |
| 18 | |
| 19 | virtual int identify(io_generic *io); |
| 20 | virtual bool load(io_generic *io, floppy_image *image); |
| 21 | |
| 22 | virtual const char *name() const; |
| 23 | virtual const char *description() const; |
| 24 | virtual const char *extensions() const; |
| 25 | virtual bool supports_save() const; |
| 26 | }; |
| 27 | |
| 28 | extern const floppy_format_type FLOPPY_DSK_FORMAT; |
| 29 | |
| 30 | #endif /* CPCDSK_DSK_H */ |
src/mess/tools/floptool/main.c
| r12862 | r12863 | |
| 21 | 21 | #include "formats/hxcmfm_dsk.h" |
| 22 | 22 | #include "formats/ami_dsk.h" |
| 23 | 23 | #include "formats/st_dsk.h" |
| 24 | #include "formats/dsk_dsk.h" |
| 24 | 25 | |
| 25 | 26 | static floppy_format_type floppy_formats[] = { |
| 26 | 27 | FLOPPY_MFI_FORMAT, |
| r12862 | r12863 | |
| 30 | 31 | |
| 31 | 32 | FLOPPY_ST_FORMAT, |
| 32 | 33 | FLOPPY_MSA_FORMAT, |
| 34 | |
| 35 | FLOPPY_DSK_FORMAT, |
| 33 | 36 | |
| 34 | 37 | NULL |
| 35 | 38 | }; |
| r12862 | r12863 | |
| 70 | 73 | return 1; |
| 71 | 74 | } |
| 72 | 75 | |
| 73 | | for(int i=2; argv[i]; i++) { |
| 76 | for(int i=2; i<argc; i++) { |
| 74 | 77 | char msg[4096]; |
| 75 | 78 | sprintf(msg, "Error opening %s for reading", argv[i]); |
| 76 | 79 | FILE *f = fopen(argv[i], "rb"); |