Previous 199869 Revisions Next

r19219 Thursday 29th November, 2012 at 18:55:10 UTC by Curt Coder
Added 8" DSSD floppy type, WD177x inverted bus, and fixed DSKCHG signal. (nw)
[src/emu/imagedev]floppy.c floppy.h
[src/emu/machine]wd_fdc.c
[src/lib/formats]wd177x_dsk.h

trunk/src/lib/formats/wd177x_dsk.h
r19218r19219
2626      int per_sector_size[40]; // if sector_base_size is 0
2727      int sector_base_id;      // 0 or 1 usually, -1 if there's interleave
2828      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
3030      int gap_2;               // 22 for <=1.44Mb, 41 for 2.88Mb - number of 4e between sector header and data sync
3131      int gap_3;               // Usually 84 - number of 4e between sector crc and next IDAM
3232   };
trunk/src/emu/imagedev/floppy.c
r19218r19219
2727const device_type FLOPPY_525_QD = &device_creator<floppy_525_qd>;
2828const device_type FLOPPY_525_HD = &device_creator<floppy_525_hd>;
2929const device_type FLOPPY_8_SSSD = &device_creator<floppy_8_sssd>;
30const device_type FLOPPY_8_DSSD = &device_creator<floppy_8_dssd>;
3031const device_type FLOPPY_8_SSDD = &device_creator<floppy_8_ssdd>;
3132const device_type FLOPPY_8_DSDD = &device_creator<floppy_8_dsdd>;
3233
r19218r19219
201202   cyl = 0;
202203   ss  = 0;
203204   stp = 1;
204   dskchg = 0;
205   dskchg = exists() ? 1 : 0;
205206   index_timer = timer_alloc(0);
206207   image_dirty = false;
207208}
r19218r19219
364365
365366   if(new_idx != idx) {
366367      idx = new_idx;
368
367369      if (!cur_index_pulse_cb.isnull())
368370         cur_index_pulse_cb(this, idx);
369371   }
r19218r19219
11421144}
11431145
11441146floppy_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)
11461148{
11471149}
11481150
r19218r19219
11651167   variants[var_count++] = floppy_image::SSSD;
11661168}
11671169
1170floppy_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
1175floppy_8_dssd::~floppy_8_dssd()
1176{
1177}
1178
1179void 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
1188void 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
11681195floppy_8_ssdd::floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
11691196   floppy_image_device(mconfig, FLOPPY_8_DSDD, "8\" double density single sided floppy drive", tag, owner, clock)
11701197{
trunk/src/emu/imagedev/floppy.h
r19218r19219
352352   virtual void setup_characteristics();
353353};
354354
355class floppy_8_dssd : public floppy_image_device {
356public:
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"; }
362protected:
363   virtual void setup_characteristics();
364};
365
355366class floppy_8_ssdd : public floppy_image_device {
356367public:
357368   floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r19218r19219
410421extern const device_type FLOPPY_525_QD;
411422extern const device_type FLOPPY_525_HD;
412423extern const device_type FLOPPY_8_SSSD;
424extern const device_type FLOPPY_8_DSSD;
413425extern const device_type FLOPPY_8_SSDD;
414426extern const device_type FLOPPY_8_DSDD;
415427
trunk/src/emu/machine/wd_fdc.c
r19218r19219
875875
876876void wd_fdc_t::cmd_w(UINT8 val)
877877{
878   if (inverted_bus) val ^= 0xff;
879   
878880   logerror("wd1772 cmd: %02x\n", val);
879881
880882   if(intrq && !(intrq_cond & I_IMM)) {
r19218r19219
929931         status &= ~S_NRDY;
930932   }
931933
932   return status;
934   UINT8 val = status;
935   if (inverted_bus) val ^= 0xff;
936   
937   return val;
933938}
934939
935940void wd_fdc_t::do_track_w()
r19218r19219
940945
941946void wd_fdc_t::track_w(UINT8 val)
942947{
948   if (inverted_bus) val ^= 0xff;
949
943950   // No more than one write in flight
944951   if(track_buffer != -1)
945952      return;
r19218r19219
950957
951958UINT8 wd_fdc_t::track_r()
952959{
953   return track;
960   UINT8 val = track;
961   if (inverted_bus) val ^= 0xff;
962   
963   return val;
954964}
955965
956966void wd_fdc_t::do_sector_w()
r19218r19219
961971
962972void wd_fdc_t::sector_w(UINT8 val)
963973{
974   if (inverted_bus) val ^= 0xff;
975   
964976   // No more than one write in flight
965977   if(sector_buffer != -1)
966978      return;
r19218r19219
971983
972984UINT8 wd_fdc_t::sector_r()
973985{
974   return sector;
986   UINT8 val = sector;
987   if (inverted_bus) val ^= 0xff;
988   
989   return val;
975990}
976991
977992void wd_fdc_t::data_w(UINT8 val)
978993{
994   if (inverted_bus) val ^= 0xff;
995   
979996   data = val;
980997   drop_drq();
981998}
r19218r19219
9831000UINT8 wd_fdc_t::data_r()
9841001{
9851002   drop_drq();
986   return data;
1003
1004   UINT8 val = data;
1005   if (inverted_bus) val ^= 0xff;
1006   
1007   return val;
9871008}
9881009
9891010void wd_fdc_t::gen_w(int reg, UINT8 val)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team