trunk/src/emu/imagedev/floppy.c
| r19151 | r19152 | |
| 18 | 18 | const device_type FLOPPY_35_DD_NOSD = &device_creator<floppy_35_dd_nosd>; |
| 19 | 19 | const device_type FLOPPY_35_HD = &device_creator<floppy_35_hd>; |
| 20 | 20 | const device_type FLOPPY_35_ED = &device_creator<floppy_35_ed>; |
| 21 | const device_type FLOPPY_525_SSSD_35T = &device_creator<floppy_525_sssd_35t>; |
| 22 | const device_type FLOPPY_525_SSSD = &device_creator<floppy_525_sssd>; |
| 21 | 23 | const device_type FLOPPY_525_SSDD = &device_creator<floppy_525_ssdd>; |
| 22 | 24 | const device_type FLOPPY_525_DD = &device_creator<floppy_525_dd>; |
| 23 | 25 | const device_type FLOPPY_525_QD = &device_creator<floppy_525_qd>; |
| 24 | 26 | const device_type FLOPPY_525_HD = &device_creator<floppy_525_hd>; |
| 25 | 27 | const device_type FLOPPY_8_SSSD = &device_creator<floppy_8_sssd>; |
| 28 | const device_type FLOPPY_8_SSDD = &device_creator<floppy_8_ssdd>; |
| 26 | 29 | const device_type FLOPPY_8_DSDD = &device_creator<floppy_8_dsdd>; |
| 27 | 30 | |
| 28 | 31 | const floppy_format_type floppy_image_device::default_floppy_formats[] = { |
| r19151 | r19152 | |
| 378 | 381 | return index_timer->elapsed().as_double(); |
| 379 | 382 | } |
| 380 | 383 | |
| 384 | bool floppy_image_device::twosid_r() |
| 385 | { |
| 386 | int tracks = 0, heads = 0; |
| 387 | |
| 388 | if (image) image->get_actual_geometry(tracks, heads); |
| 389 | |
| 390 | return heads == 2; |
| 391 | } |
| 392 | |
| 381 | 393 | void floppy_image_device::stp_w(int state) |
| 382 | 394 | { |
| 383 | 395 | if ( stp != state ) { |
| r19151 | r19152 | |
| 928 | 940 | variants[var_count++] = floppy_image::DSED; |
| 929 | 941 | } |
| 930 | 942 | |
| 943 | floppy_525_sssd_35t::floppy_525_sssd_35t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 944 | floppy_image_device(mconfig, FLOPPY_525_SSSD_35T, "5.25\" single-sided single density 35-track floppy drive", tag, owner, clock) |
| 945 | { |
| 946 | } |
| 947 | |
| 948 | floppy_525_sssd_35t::~floppy_525_sssd_35t() |
| 949 | { |
| 950 | } |
| 951 | |
| 952 | void floppy_525_sssd_35t::setup_characteristics() |
| 953 | { |
| 954 | form_factor = floppy_image::FF_525; |
| 955 | tracks = 35; |
| 956 | sides = 1; |
| 957 | set_rpm(300); |
| 958 | } |
| 959 | |
| 960 | void floppy_525_sssd_35t::handled_variants(UINT32 *variants, int &var_count) const |
| 961 | { |
| 962 | var_count = 0; |
| 963 | variants[var_count++] = floppy_image::SSSD; |
| 964 | } |
| 965 | |
| 966 | floppy_525_sssd::floppy_525_sssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 967 | floppy_image_device(mconfig, FLOPPY_525_SSSD, "5.25\" single-sided single density floppy drive", tag, owner, clock) |
| 968 | { |
| 969 | } |
| 970 | |
| 971 | floppy_525_sssd::~floppy_525_sssd() |
| 972 | { |
| 973 | } |
| 974 | |
| 975 | void floppy_525_sssd::setup_characteristics() |
| 976 | { |
| 977 | form_factor = floppy_image::FF_525; |
| 978 | tracks = 42; |
| 979 | sides = 1; |
| 980 | set_rpm(300); |
| 981 | } |
| 982 | |
| 983 | void floppy_525_sssd::handled_variants(UINT32 *variants, int &var_count) const |
| 984 | { |
| 985 | var_count = 0; |
| 986 | variants[var_count++] = floppy_image::SSSD; |
| 987 | } |
| 988 | |
| 931 | 989 | floppy_525_ssdd::floppy_525_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 932 | 990 | floppy_image_device(mconfig, FLOPPY_525_SSDD, "5.25\" single-sided double density floppy drive", tag, owner, clock) |
| 933 | 991 | { |
| r19151 | r19152 | |
| 1056 | 1114 | variants[var_count++] = floppy_image::SSSD; |
| 1057 | 1115 | } |
| 1058 | 1116 | |
| 1117 | floppy_8_ssdd::floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 1118 | floppy_image_device(mconfig, FLOPPY_8_DSDD, "8\" double density single sided floppy drive", tag, owner, clock) |
| 1119 | { |
| 1120 | } |
| 1121 | |
| 1122 | floppy_8_ssdd::~floppy_8_ssdd() |
| 1123 | { |
| 1124 | } |
| 1125 | |
| 1126 | void floppy_8_ssdd::setup_characteristics() |
| 1127 | { |
| 1128 | form_factor = floppy_image::FF_8; |
| 1129 | tracks = 77; |
| 1130 | sides = 1; |
| 1131 | motor_always_on = true; |
| 1132 | set_rpm(360); |
| 1133 | } |
| 1134 | |
| 1135 | void floppy_8_ssdd::handled_variants(UINT32 *variants, int &var_count) const |
| 1136 | { |
| 1137 | var_count = 0; |
| 1138 | variants[var_count++] = floppy_image::SSSD; |
| 1139 | variants[var_count++] = floppy_image::SSDD; |
| 1140 | } |
| 1141 | |
| 1059 | 1142 | floppy_8_dsdd::floppy_8_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 1060 | 1143 | floppy_image_device(mconfig, FLOPPY_8_DSDD, "8\" double density double sided floppy drive", tag, owner, clock) |
| 1061 | 1144 | { |
trunk/src/emu/imagedev/floppy.h
| r19151 | r19152 | |
| 96 | 96 | bool trk00_r() { return cyl != 0 || !image; } |
| 97 | 97 | int idx_r() { return idx; } |
| 98 | 98 | bool ss_r() { return ss; } |
| 99 | bool twosid_r(); |
| 99 | 100 | |
| 100 | 101 | void stp_w(int state); |
| 101 | 102 | void dir_w(int state) { dir = state; } |
| r19151 | r19152 | |
| 252 | 253 | virtual void setup_characteristics(); |
| 253 | 254 | }; |
| 254 | 255 | |
| 256 | class floppy_525_sssd_35t : public floppy_image_device { |
| 257 | public: |
| 258 | floppy_525_sssd_35t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 259 | virtual ~floppy_525_sssd_35t(); |
| 260 | virtual void handled_variants(UINT32 *variants, int &var_count) const; |
| 261 | virtual void device_config_complete() { m_shortname = "floppy_525_sssd_35t"; } |
| 262 | virtual const char *image_interface() const { return "floppy_5_25"; } |
| 263 | protected: |
| 264 | virtual void setup_characteristics(); |
| 265 | }; |
| 266 | |
| 267 | class floppy_525_sssd : public floppy_image_device { |
| 268 | public: |
| 269 | floppy_525_sssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 270 | virtual ~floppy_525_sssd(); |
| 271 | virtual void handled_variants(UINT32 *variants, int &var_count) const; |
| 272 | virtual void device_config_complete() { m_shortname = "floppy_525_sssd"; } |
| 273 | virtual const char *image_interface() const { return "floppy_5_25"; } |
| 274 | protected: |
| 275 | virtual void setup_characteristics(); |
| 276 | }; |
| 277 | |
| 255 | 278 | class floppy_525_ssdd : public floppy_image_device { |
| 256 | 279 | public: |
| 257 | 280 | floppy_525_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| r19151 | r19152 | |
| 307 | 330 | virtual void setup_characteristics(); |
| 308 | 331 | }; |
| 309 | 332 | |
| 333 | class floppy_8_ssdd : public floppy_image_device { |
| 334 | public: |
| 335 | floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 336 | virtual ~floppy_8_ssdd(); |
| 337 | virtual void handled_variants(UINT32 *variants, int &var_count) const; |
| 338 | virtual void device_config_complete() { m_shortname = "floppy_8_ssdd"; } |
| 339 | virtual const char *image_interface() const { return "floppy_8"; } |
| 340 | protected: |
| 341 | virtual void setup_characteristics(); |
| 342 | }; |
| 343 | |
| 310 | 344 | class floppy_8_dsdd : public floppy_image_device { |
| 311 | 345 | public: |
| 312 | 346 | floppy_8_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| r19151 | r19152 | |
| 345 | 379 | extern const device_type FLOPPY_35_DD_NOSD; |
| 346 | 380 | extern const device_type FLOPPY_35_HD; |
| 347 | 381 | extern const device_type FLOPPY_35_ED; |
| 382 | extern const device_type FLOPPY_525_SSSD_35T; |
| 383 | extern const device_type FLOPPY_525_SSSD; |
| 348 | 384 | extern const device_type FLOPPY_525_SSDD; |
| 349 | 385 | extern const device_type FLOPPY_525_DD; |
| 350 | 386 | extern const device_type FLOPPY_525_QD; |
| 351 | 387 | extern const device_type FLOPPY_525_HD; |
| 352 | 388 | extern const device_type FLOPPY_8_SSSD; |
| 389 | extern const device_type FLOPPY_8_SSDD; |
| 353 | 390 | extern const device_type FLOPPY_8_DSDD; |
| 354 | 391 | |
| 355 | 392 | #endif /* FLOPPY_H */ |