trunk/src/lib/formats/flex_dsk.c
| r243417 | r243418 | |
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "flex_dsk.h" |
| 9 | 9 | |
| 10 | | flex_format::flex_format() : wd177x_format(formats) |
| 10 | flex_format::flex_format() |
| 11 | 11 | { |
| 12 | 12 | } |
| 13 | 13 | |
| r243417 | r243418 | |
| 26 | 26 | return "dsk"; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | bool flex_format::supports_save() const |
| 30 | { |
| 31 | return true; |
| 32 | } |
| 33 | |
| 29 | 34 | int flex_format::identify(io_generic *io, UINT32 form_factor) |
| 30 | 35 | { |
| 31 | 36 | io_generic_read(io, &info, 256 * 2, sizeof(struct sysinfo_sector)); |
| r243417 | r243418 | |
| 97 | 102 | return true; |
| 98 | 103 | } |
| 99 | 104 | |
| 100 | | // Empty since geometry is determined from the disk image itself |
| 101 | | const flex_format::format flex_format::formats[] = { {} }; |
| 102 | | |
| 103 | 105 | const floppy_format_type FLOPPY_FLEX_FORMAT = &floppy_image_format_creator<flex_format>; |
trunk/src/lib/formats/flex_dsk.h
| r243417 | r243418 | |
| 7 | 7 | #ifndef FLEX_DSK_H_ |
| 8 | 8 | #define FLEX_DSK_H_ |
| 9 | 9 | |
| 10 | | #include "wd177x_dsk.h" |
| 10 | #include "flopimg.h" |
| 11 | 11 | |
| 12 | | class flex_format : public wd177x_format { |
| 12 | class flex_format : public floppy_image_format_t { |
| 13 | 13 | public: |
| 14 | 14 | flex_format(); |
| 15 | 15 | |
| r243417 | r243418 | |
| 18 | 18 | virtual const char *extensions() const; |
| 19 | 19 | virtual int identify(io_generic *io, UINT32 form_factor); |
| 20 | 20 | virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); |
| 21 | virtual bool supports_save() const; |
| 22 | |
| 21 | 23 | private: |
| 22 | 24 | struct sysinfo_sector |
| 23 | 25 | { |
| r243417 | r243418 | |
| 37 | 39 | UINT8 last_sec; |
| 38 | 40 | UINT8 unused2[216]; |
| 39 | 41 | } info; |
| 40 | | static const format formats[]; |
| 41 | 42 | }; |
| 42 | 43 | |
| 43 | 44 | extern const floppy_format_type FLOPPY_FLEX_FORMAT; |