trunk/src/lib/formats/wd177x_dsk.h
| r19218 | r19219 | |
| 26 | 26 | int per_sector_size[40]; // if sector_base_size is 0 |
| 27 | 27 | int sector_base_id; // 0 or 1 usually, -1 if there's interleave |
| 28 | 28 | int per_sector_id[40]; // if sector_base_id is -1. If both per are used, then sector per_sector_id[i] has size per_sector_size[i] |
| 29 | | int gap_1; // Usually around 544 - number of 4e between index and first IDAM sync |
| 29 | int gap_1; // Usually around 80 - number of 4e between index and first IDAM sync |
| 30 | 30 | int gap_2; // 22 for <=1.44Mb, 41 for 2.88Mb - number of 4e between sector header and data sync |
| 31 | 31 | int gap_3; // Usually 84 - number of 4e between sector crc and next IDAM |
| 32 | 32 | }; |
trunk/src/emu/imagedev/floppy.c
| r19218 | r19219 | |
| 27 | 27 | const device_type FLOPPY_525_QD = &device_creator<floppy_525_qd>; |
| 28 | 28 | const device_type FLOPPY_525_HD = &device_creator<floppy_525_hd>; |
| 29 | 29 | const device_type FLOPPY_8_SSSD = &device_creator<floppy_8_sssd>; |
| 30 | const device_type FLOPPY_8_DSSD = &device_creator<floppy_8_dssd>; |
| 30 | 31 | const device_type FLOPPY_8_SSDD = &device_creator<floppy_8_ssdd>; |
| 31 | 32 | const device_type FLOPPY_8_DSDD = &device_creator<floppy_8_dsdd>; |
| 32 | 33 | |
| r19218 | r19219 | |
| 201 | 202 | cyl = 0; |
| 202 | 203 | ss = 0; |
| 203 | 204 | stp = 1; |
| 204 | | dskchg = 0; |
| 205 | dskchg = exists() ? 1 : 0; |
| 205 | 206 | index_timer = timer_alloc(0); |
| 206 | 207 | image_dirty = false; |
| 207 | 208 | } |
| r19218 | r19219 | |
| 364 | 365 | |
| 365 | 366 | if(new_idx != idx) { |
| 366 | 367 | idx = new_idx; |
| 368 | |
| 367 | 369 | if (!cur_index_pulse_cb.isnull()) |
| 368 | 370 | cur_index_pulse_cb(this, idx); |
| 369 | 371 | } |
| r19218 | r19219 | |
| 1142 | 1144 | } |
| 1143 | 1145 | |
| 1144 | 1146 | floppy_8_sssd::floppy_8_sssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 1145 | | floppy_image_device(mconfig, FLOPPY_8_SSSD, "8\" single density floppy drive", tag, owner, clock) |
| 1147 | floppy_image_device(mconfig, FLOPPY_8_SSSD, "8\" single density single sided floppy drive", tag, owner, clock) |
| 1146 | 1148 | { |
| 1147 | 1149 | } |
| 1148 | 1150 | |
| r19218 | r19219 | |
| 1165 | 1167 | variants[var_count++] = floppy_image::SSSD; |
| 1166 | 1168 | } |
| 1167 | 1169 | |
| 1170 | floppy_8_dssd::floppy_8_dssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 1171 | floppy_image_device(mconfig, FLOPPY_8_SSSD, "8\" single density double sided floppy drive", tag, owner, clock) |
| 1172 | { |
| 1173 | } |
| 1174 | |
| 1175 | floppy_8_dssd::~floppy_8_dssd() |
| 1176 | { |
| 1177 | } |
| 1178 | |
| 1179 | void floppy_8_dssd::setup_characteristics() |
| 1180 | { |
| 1181 | form_factor = floppy_image::FF_8; |
| 1182 | tracks = 77; |
| 1183 | sides = 2; |
| 1184 | motor_always_on = true; |
| 1185 | set_rpm(360); |
| 1186 | } |
| 1187 | |
| 1188 | void floppy_8_dssd::handled_variants(UINT32 *variants, int &var_count) const |
| 1189 | { |
| 1190 | var_count = 0; |
| 1191 | variants[var_count++] = floppy_image::SSSD; |
| 1192 | variants[var_count++] = floppy_image::DSSD; |
| 1193 | } |
| 1194 | |
| 1168 | 1195 | floppy_8_ssdd::floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 1169 | 1196 | floppy_image_device(mconfig, FLOPPY_8_DSDD, "8\" double density single sided floppy drive", tag, owner, clock) |
| 1170 | 1197 | { |
trunk/src/emu/imagedev/floppy.h
| r19218 | r19219 | |
| 352 | 352 | virtual void setup_characteristics(); |
| 353 | 353 | }; |
| 354 | 354 | |
| 355 | class floppy_8_dssd : public floppy_image_device { |
| 356 | public: |
| 357 | floppy_8_dssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 358 | virtual ~floppy_8_dssd(); |
| 359 | virtual void handled_variants(UINT32 *variants, int &var_count) const; |
| 360 | virtual void device_config_complete() { m_shortname = "floppy_8_dssd"; } |
| 361 | virtual const char *image_interface() const { return "floppy_8"; } |
| 362 | protected: |
| 363 | virtual void setup_characteristics(); |
| 364 | }; |
| 365 | |
| 355 | 366 | class floppy_8_ssdd : public floppy_image_device { |
| 356 | 367 | public: |
| 357 | 368 | floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| r19218 | r19219 | |
| 410 | 421 | extern const device_type FLOPPY_525_QD; |
| 411 | 422 | extern const device_type FLOPPY_525_HD; |
| 412 | 423 | extern const device_type FLOPPY_8_SSSD; |
| 424 | extern const device_type FLOPPY_8_DSSD; |
| 413 | 425 | extern const device_type FLOPPY_8_SSDD; |
| 414 | 426 | extern const device_type FLOPPY_8_DSDD; |
| 415 | 427 | |
trunk/src/emu/machine/wd_fdc.c
| r19218 | r19219 | |
| 875 | 875 | |
| 876 | 876 | void wd_fdc_t::cmd_w(UINT8 val) |
| 877 | 877 | { |
| 878 | if (inverted_bus) val ^= 0xff; |
| 879 | |
| 878 | 880 | logerror("wd1772 cmd: %02x\n", val); |
| 879 | 881 | |
| 880 | 882 | if(intrq && !(intrq_cond & I_IMM)) { |
| r19218 | r19219 | |
| 929 | 931 | status &= ~S_NRDY; |
| 930 | 932 | } |
| 931 | 933 | |
| 932 | | return status; |
| 934 | UINT8 val = status; |
| 935 | if (inverted_bus) val ^= 0xff; |
| 936 | |
| 937 | return val; |
| 933 | 938 | } |
| 934 | 939 | |
| 935 | 940 | void wd_fdc_t::do_track_w() |
| r19218 | r19219 | |
| 940 | 945 | |
| 941 | 946 | void wd_fdc_t::track_w(UINT8 val) |
| 942 | 947 | { |
| 948 | if (inverted_bus) val ^= 0xff; |
| 949 | |
| 943 | 950 | // No more than one write in flight |
| 944 | 951 | if(track_buffer != -1) |
| 945 | 952 | return; |
| r19218 | r19219 | |
| 950 | 957 | |
| 951 | 958 | UINT8 wd_fdc_t::track_r() |
| 952 | 959 | { |
| 953 | | return track; |
| 960 | UINT8 val = track; |
| 961 | if (inverted_bus) val ^= 0xff; |
| 962 | |
| 963 | return val; |
| 954 | 964 | } |
| 955 | 965 | |
| 956 | 966 | void wd_fdc_t::do_sector_w() |
| r19218 | r19219 | |
| 961 | 971 | |
| 962 | 972 | void wd_fdc_t::sector_w(UINT8 val) |
| 963 | 973 | { |
| 974 | if (inverted_bus) val ^= 0xff; |
| 975 | |
| 964 | 976 | // No more than one write in flight |
| 965 | 977 | if(sector_buffer != -1) |
| 966 | 978 | return; |
| r19218 | r19219 | |
| 971 | 983 | |
| 972 | 984 | UINT8 wd_fdc_t::sector_r() |
| 973 | 985 | { |
| 974 | | return sector; |
| 986 | UINT8 val = sector; |
| 987 | if (inverted_bus) val ^= 0xff; |
| 988 | |
| 989 | return val; |
| 975 | 990 | } |
| 976 | 991 | |
| 977 | 992 | void wd_fdc_t::data_w(UINT8 val) |
| 978 | 993 | { |
| 994 | if (inverted_bus) val ^= 0xff; |
| 995 | |
| 979 | 996 | data = val; |
| 980 | 997 | drop_drq(); |
| 981 | 998 | } |
| r19218 | r19219 | |
| 983 | 1000 | UINT8 wd_fdc_t::data_r() |
| 984 | 1001 | { |
| 985 | 1002 | drop_drq(); |
| 986 | | return data; |
| 1003 | |
| 1004 | UINT8 val = data; |
| 1005 | if (inverted_bus) val ^= 0xff; |
| 1006 | |
| 1007 | return val; |
| 987 | 1008 | } |
| 988 | 1009 | |
| 989 | 1010 | void wd_fdc_t::gen_w(int reg, UINT8 val) |