Previous 199869 Revisions Next

r24570 Tuesday 30th July, 2013 at 07:55:19 UTC by Curt Coder
(MESS) c2040: Cleanup. (nw)
[src/mess/machine]c2040.c c2040.h

trunk/src/mess/machine/c2040.c
r24569r24570
101101
102102
103103//-------------------------------------------------
104//  rom_region - device-specific ROM region
105//-------------------------------------------------
106
107const rom_entry *c2040_device::device_rom_region() const
108{
109   return ROM_NAME( c2040 );
110}
111
112
113//-------------------------------------------------
104114//  ROM( c4040 )
105115//-------------------------------------------------
106116
r24569r24570
126136
127137
128138//-------------------------------------------------
139//  rom_region - device-specific ROM region
140//-------------------------------------------------
141
142const rom_entry *c4040_device::device_rom_region() const
143{
144   return ROM_NAME( c4040 );
145}
146
147
148//-------------------------------------------------
129149//  ROM( c8050 )
130150//-------------------------------------------------
131151
r24569r24570
175195
176196
177197//-------------------------------------------------
198//  rom_region - device-specific ROM region
199//-------------------------------------------------
200
201const rom_entry *c8050_device::device_rom_region() const
202{
203   return ROM_NAME( c8050 );
204}
205
206
207//-------------------------------------------------
178208//  ROM( c8250lp )
179209//-------------------------------------------------
180210
r24569r24570
202232
203233
204234//-------------------------------------------------
235//  rom_region - device-specific ROM region
236//-------------------------------------------------
237
238const rom_entry *c8250lp_device::device_rom_region() const
239{
240   return ROM_NAME( c8250lp );
241}
242
243
244//-------------------------------------------------
205245//  ROM( sfd1001 )
206246//-------------------------------------------------
207247
r24569r24570
223263//  rom_region - device-specific ROM region
224264//-------------------------------------------------
225265
226const rom_entry *c2040_device::device_rom_region() const
266const rom_entry *sfd1001_device::device_rom_region() const
227267{
228   switch (m_variant)
229   {
230   default:
231   case TYPE_2040:
232   case TYPE_3040:
233      return ROM_NAME( c2040 );
234
235   case TYPE_4040:
236      return ROM_NAME( c4040 );
237
238   case TYPE_8050:
239   case TYPE_8250:
240      return ROM_NAME( c8050 );
241
242   case TYPE_8250LP:
243      return ROM_NAME( c8250lp );
244
245   case TYPE_SFD1001:
246      return ROM_NAME( sfd1001 );
247   }
268   return ROM_NAME( sfd1001 );
248269}
249270
250271
r24569r24570
884905   data |= 0x10;
885906
886907   // single/dual sided
887   if (m_variant == c2040_device::TYPE_8050)
908   if (!m_double_sided)
888909   {
889910      data |= 0x40;
890911   }
r24569r24570
910931   */
911932
912933   // drive select
913   if ((m_variant == c2040_device::TYPE_8050) ||
914      (m_variant == c2040_device::TYPE_8250))
934   if (m_image1)
915935   {
916936      m_drive = BIT(data, 0);
917937   }
r24569r24570
926946   }
927947
928948   // side select
929   if ((m_variant == c2040_device::TYPE_8250) ||
930      (m_variant == c2040_device::TYPE_SFD1001))
949   if (m_double_sided)
931950   {
932951      m_side = !BIT(data, 4);
933952   }
r24569r24570
10841103
10851104
10861105//-------------------------------------------------
1106//  machine_config_additions - device-specific
1107//  machine configurations
1108//-------------------------------------------------
1109
1110machine_config_constructor c2040_device::device_mconfig_additions() const
1111{
1112   return MACHINE_CONFIG_NAME( c2040 );
1113}
1114
1115
1116//-------------------------------------------------
10871117//  MACHINE_CONFIG_FRAGMENT( c4040 )
10881118//-------------------------------------------------
10891119
r24569r24570
11071137
11081138
11091139//-------------------------------------------------
1140//  machine_config_additions - device-specific
1141//  machine configurations
1142//-------------------------------------------------
1143
1144machine_config_constructor c4040_device::device_mconfig_additions() const
1145{
1146   return MACHINE_CONFIG_NAME( c4040 );
1147}
1148
1149
1150//-------------------------------------------------
11101151//  MACHINE_CONFIG_FRAGMENT( c8050 )
11111152//-------------------------------------------------
11121153
r24569r24570
11301171
11311172
11321173//-------------------------------------------------
1174//  machine_config_additions - device-specific
1175//  machine configurations
1176//-------------------------------------------------
1177
1178machine_config_constructor c8050_device::device_mconfig_additions() const
1179{
1180   return MACHINE_CONFIG_NAME( c8050 );
1181}
1182
1183
1184//-------------------------------------------------
11331185//  MACHINE_CONFIG_FRAGMENT( c8250 )
11341186//-------------------------------------------------
11351187
r24569r24570
11531205
11541206
11551207//-------------------------------------------------
1208//  machine_config_additions - device-specific
1209//  machine configurations
1210//-------------------------------------------------
1211
1212machine_config_constructor c8250_device::device_mconfig_additions() const
1213{
1214   return MACHINE_CONFIG_NAME( c8250 );
1215}
1216
1217
1218//-------------------------------------------------
11561219//  MACHINE_CONFIG_FRAGMENT( c8250lp )
11571220//-------------------------------------------------
11581221
r24569r24570
11761239
11771240
11781241//-------------------------------------------------
1242//  machine_config_additions - device-specific
1243//  machine configurations
1244//-------------------------------------------------
1245
1246machine_config_constructor c8250lp_device::device_mconfig_additions() const
1247{
1248   return MACHINE_CONFIG_NAME( c8250lp );
1249}
1250
1251
1252//-------------------------------------------------
11791253//  MACHINE_CONFIG_FRAGMENT( sfd1001 )
11801254//-------------------------------------------------
11811255
r24569r24570
12031277//  machine configurations
12041278//-------------------------------------------------
12051279
1206machine_config_constructor c2040_device::device_mconfig_additions() const
1280machine_config_constructor sfd1001_device::device_mconfig_additions() const
12071281{
1208   switch (m_variant)
1209   {
1210   default:
1211   case TYPE_2040:
1212   case TYPE_3040:
1213      return MACHINE_CONFIG_NAME( c2040 );
1214
1215   case TYPE_4040:
1216      return MACHINE_CONFIG_NAME( c4040 );
1217
1218   case TYPE_8050:
1219      return MACHINE_CONFIG_NAME( c8050 );
1220
1221   case TYPE_8250:
1222      return MACHINE_CONFIG_NAME( c8250 );
1223
1224   case TYPE_8250LP:
1225      return MACHINE_CONFIG_NAME( c8250lp );
1226
1227   case TYPE_SFD1001:
1228      return MACHINE_CONFIG_NAME( sfd1001 );
1229   }
1282   return MACHINE_CONFIG_NAME( sfd1001 );
12301283}
12311284
12321285
r24569r24570
14181471//  c2040_device - constructor
14191472//-------------------------------------------------
14201473
1421c2040_device::c2040_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source)
1474c2040_device::c2040_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
14221475   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
14231476      device_ieee488_interface(mconfig, *this),
14241477      m_maincpu(*this, M6502_TAG),
r24569r24570
14421495      m_ready(0),
14431496      m_mode(0),
14441497      m_rw(0),
1445      m_miot_irq(CLEAR_LINE),
1446      m_variant(variant)
1498      m_miot_irq(CLEAR_LINE)
14471499{
14481500   for (int i = 0; i < 2; i++)
14491501   {
r24569r24570
14801532      m_ready(0),
14811533      m_mode(0),
14821534      m_rw(0),
1483      m_miot_irq(CLEAR_LINE),
1484      m_variant(TYPE_2040)
1535      m_miot_irq(CLEAR_LINE)
14851536{
14861537   for (int i = 0; i < 2; i++)
14871538   {
r24569r24570
14991550//-------------------------------------------------
15001551
15011552c3040_device::c3040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1502   : c2040_device(mconfig, C3040, "C3040", tag, owner, clock, TYPE_3040, "c3040", __FILE__) { }
1553   : c2040_device(mconfig, C3040, "C3040", tag, owner, clock, "c3040", __FILE__) { }
15031554
15041555
15051556//-------------------------------------------------
r24569r24570
15071558//-------------------------------------------------
15081559
15091560c4040_device::c4040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1510   : c2040_device(mconfig, C4040, "C4040", tag, owner, clock, TYPE_4040, "c4040", __FILE__) { }
1561   : c2040_device(mconfig, C4040, "C4040", tag, owner, clock, "c4040", __FILE__) { }
15111562
15121563
15131564//-------------------------------------------------
15141565//  c8050_device - constructor
15151566//-------------------------------------------------
15161567
1517c8050_device::c8050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source)
1518   : c2040_device(mconfig, type, name, tag, owner, clock, variant, shortname, source) { }
1568c8050_device::c8050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool double_sided, const char *shortname, const char *source)
1569   : c2040_device(mconfig, type, name, tag, owner, clock, shortname, source),
1570      m_double_sided(double_sided)
1571{
1572}
15191573
15201574c8050_device::c8050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1521   : c2040_device(mconfig, C8050, "C8050", tag, owner, clock, TYPE_8050, "c8050", __FILE__) { }
1575   : c2040_device(mconfig, C8050, "C8050", tag, owner, clock, "c8050", __FILE__),
1576      m_double_sided(false)
1577{
1578}
15221579
15231580
15241581//-------------------------------------------------
r24569r24570
15261583//-------------------------------------------------
15271584
15281585c8250_device::c8250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1529   : c8050_device(mconfig, C8250, "C8250", tag, owner, clock, TYPE_8250, "c8250", __FILE__) { }
1586   : c8050_device(mconfig, C8250, "C8250", tag, owner, clock, true, "c8250", __FILE__) { }
15301587
15311588
15321589//-------------------------------------------------
r24569r24570
15341591//-------------------------------------------------
15351592
15361593c8250lp_device::c8250lp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1537   : c8050_device(mconfig, C8250LP, "C8250LP", tag, owner, clock, TYPE_8250LP, "c8250lp", __FILE__) { }
1594   : c8050_device(mconfig, C8250LP, "C8250LP", tag, owner, clock, true, "c8250lp", __FILE__) { }
15381595
15391596
15401597//-------------------------------------------------
r24569r24570
15421599//-------------------------------------------------
15431600
15441601sfd1001_device::sfd1001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1545   : c8050_device(mconfig, SFD1001, "SFD1001", tag, owner, clock, TYPE_SFD1001, "sfd1001", __FILE__) { }
1602   : c8050_device(mconfig, SFD1001, "SFD1001", tag, owner, clock, true, "sfd1001", __FILE__) { }
15461603
15471604
15481605//-------------------------------------------------
r24569r24570
16741731      m_via->write_ca1(ready);
16751732      m_via->write_cb1(ERROR);
16761733
1677      if ((m_variant == c2040_device::TYPE_8050) ||
1678         (m_variant == c2040_device::TYPE_8250) ||
1679         (m_variant == c2040_device::TYPE_SFD1001))
1680      {
1681         m_fdccpu->set_input_line(M6502_SET_OVERFLOW, ready ? CLEAR_LINE : ASSERT_LINE);
1682      }
1734      this->byte_ready(ready);
16831735   }
16841736}
16851737
1738void c8050_device::byte_ready(int state)
1739{
1740   m_fdccpu->set_input_line(M6502_SET_OVERFLOW, state ? CLEAR_LINE : ASSERT_LINE);
1741}
16861742
1743
1744
16871745//-------------------------------------------------
16881746//  ieee488_atn -
16891747//-------------------------------------------------
trunk/src/mess/machine/c2040.h
r24569r24570
3636                  public device_ieee488_interface
3737{
3838public:
39   enum
40   {
41      TYPE_2040,
42      TYPE_3040,
43      TYPE_4040,
44      TYPE_8050,
45      TYPE_8250,
46      TYPE_8250LP,
47      TYPE_SFD1001
48   };
49
5039   // construction/destruction
51   c2040_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source);
40   c2040_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
5241   c2040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5342
43   // optional information overrides
44   virtual const rom_entry *device_rom_region() const;
45   virtual machine_config_constructor device_mconfig_additions() const;
46
5447   // not really public
5548   static void on_disk0_change(device_image_interface &image);
5649   static void on_disk1_change(device_image_interface &image);
r24569r24570
7265   DECLARE_READ8_MEMBER( miot_pb_r );
7366   DECLARE_WRITE8_MEMBER( miot_pb_w );
7467
75   // optional information overrides
76   virtual const rom_entry *device_rom_region() const;
77   virtual machine_config_constructor device_mconfig_additions() const;
78
7968protected:
8069   // device-level overrides
8170   virtual void device_start();
r24569r24570
8675   virtual void ieee488_atn(int state);
8776   virtual void ieee488_ifc(int state);
8877
78   virtual void byte_ready(int state) { }
8979   inline void update_ieee_signals();
9080   inline void update_gcr_data();
9181   inline void read_current_track(int unit);
r24569r24570
143133
144134   // timers
145135   emu_timer *m_bit_timer;
146
147   int m_variant;
148136};
149137
150138
r24569r24570
165153public:
166154   // construction/destruction
167155   c4040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
156
157   // optional information overrides
158   virtual const rom_entry *device_rom_region() const;
159   virtual machine_config_constructor device_mconfig_additions() const;
168160};
169161
170162
r24569r24570
175167public:
176168   // construction/destruction
177169   c8050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
178   c8050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source);
170   c8050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool double_sided, const char *shortname, const char *source);
179171
172   // optional information overrides
173   virtual const rom_entry *device_rom_region() const;
174   virtual machine_config_constructor device_mconfig_additions() const;
175
180176   DECLARE_READ8_MEMBER( via_pb_r );
181177   DECLARE_WRITE8_MEMBER( via_pb_w );
182178   DECLARE_READ8_MEMBER( miot_pb_r );
183179   DECLARE_WRITE8_MEMBER( miot_pb_w );
180
181protected:
182   virtual void byte_ready(int state);
183
184   bool m_double_sided;
184185};
185186
186187
r24569r24570
191192public:
192193   // construction/destruction
193194   c8250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
195
196   // optional information overrides
197   virtual machine_config_constructor device_mconfig_additions() const;
194198};
195199
196200
r24569r24570
201205public:
202206   // construction/destruction
203207   c8250lp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
208
209   // optional information overrides
210   virtual const rom_entry *device_rom_region() const;
211   virtual machine_config_constructor device_mconfig_additions() const;
204212};
205213
206214
r24569r24570
211219public:
212220   // construction/destruction
213221   sfd1001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
222
223   // optional information overrides
224   virtual const rom_entry *device_rom_region() const;
225   virtual machine_config_constructor device_mconfig_additions() const;
214226};
215227
216228

Previous 199869 Revisions Next


© 1997-2024 The MAME Team