Previous 199869 Revisions Next

r30801 Tuesday 3rd June, 2014 at 11:58:17 UTC by Curt Coder
(MESS) ql: Expansions WIP. (nw)
[hash]ql_cart.xml
[src/emu/bus/ql]sandy_superdisk.c sandy_superdisk.h

trunk/hash/ql_cart.xml
r30800r30801
3838      </part>
3939   </software>
4040
41   <software name="trumpcrd">
42      <description>Trump Card (v2.15)</description>
43      <year>198?</year>
44      <publisher>Miracle Systems</publisher>
45
46      <part name="cart" interface="ql_cart">
47         <feature name="slot" value="trumpcard" />
48
49         <dataarea name="rom" size="0x8000">
50            <rom name="trumpcard-125.rom" size="0x8000" crc="938eaa46" sha1="9b3458cf3a279ed86ba395dc45c8f26939d6c44d" offset="0" />
51         </dataarea>
52      </part>
53   </software>
54
55   <software name="superdsk">
56      <description>Super Disk</description>
57      <year>198?</year>
58      <publisher>Sandy</publisher>
59
60      <part name="cart" interface="ql_cart">
61         <feature name="slot" value="superdisk" />
62
63         <dataarea name="rom" size="0x4000">
64            <rom name="sandysuperdisk.rom" size="0x4000" crc="b52077da" sha1="bf531758145ffd083e01c1cf9c45d0e9264a3b53" offset="0" />
65         </dataarea>
66      </part>
67   </software>
68
6941</softwarelist>
trunk/src/emu/bus/ql/sandy_superdisk.h
r30800r30801
3838   virtual const rom_entry *device_rom_region() const;
3939   virtual machine_config_constructor device_mconfig_additions() const;
4040
41   WRITE_LINE_MEMBER( busy_w );
42
4143   DECLARE_FLOPPY_FORMATS( floppy_formats );
4244
4345protected:
r30800r30801
5052   virtual void write(address_space &space, offs_t offset, UINT8 data);
5153
5254private:
55   void check_interrupt();
56
57   required_device<wd1772_t> m_fdc;
58   required_device<floppy_connector> m_floppy0;
59   required_device<floppy_connector> m_floppy1;
60   required_device<centronics_device> m_centronics;
61   required_device<output_latch_device> m_latch;
5362   required_memory_region m_rom;
54   optional_shared_ptr<UINT8> m_ram;
63
64   int m_busy;
65   int m_fd6;
5566};
5667
5768
trunk/src/emu/bus/ql/sandy_superdisk.c
r30800r30801
1818//**************************************************************************
1919
2020#define WD1772_TAG      "wd1772"
21#define TTL74273_TAG   "ttl74273"
2122#define CENTRONICS_TAG   "centronics"
2223
2324
r30800r30801
6869
6970
7071//-------------------------------------------------
72//  centronics
73//-------------------------------------------------
74
75WRITE_LINE_MEMBER( sandy_super_disk_t::busy_w )
76{
77   m_busy = state;
78   check_interrupt();
79}
80
81
82//-------------------------------------------------
7183//  MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
7284//-------------------------------------------------
7385
7486static MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
7587   MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
76   //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_intrq_w))
77   //MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_drq_w))
7888   MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_super_disk_floppies, "35dd", sandy_super_disk_t::floppy_formats)
7989   MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_super_disk_floppies, NULL, sandy_super_disk_t::floppy_formats)
8090
8191   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer")
92   MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(sandy_super_disk_t, busy_w))
93   MCFG_CENTRONICS_OUTPUT_LATCH_ADD(TTL74273_TAG, CENTRONICS_TAG)
8294MACHINE_CONFIG_END
8395
8496
r30800r30801
105117sandy_super_disk_t::sandy_super_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
106118   device_t(mconfig, SANDY_SUPER_DISK, "Sandy Super Disk", tag, owner, clock, "sandy_super_disk", __FILE__),
107119   device_ql_expansion_card_interface(mconfig, *this),
120   m_fdc(*this, WD1772_TAG),
121   m_floppy0(*this, WD1772_TAG":0"),
122   m_floppy1(*this, WD1772_TAG":1"),
123   m_centronics(*this, CENTRONICS_TAG),
124   m_latch(*this, TTL74273_TAG),
108125   m_rom(*this, "rom"),
109   m_ram(*this, "ram")
126   m_busy(1)
110127{
111128}
112129
r30800r30801
126143
127144void sandy_super_disk_t::device_reset()
128145{
146   m_fdc->reset();
147   m_fdc->set_floppy(NULL);
148   m_fdc->dden_w(0);
149
150   m_latch->write(0);
151   m_centronics->write_strobe(1);
129152}
130153
131154
r30800r30801
135158
136159UINT8 sandy_super_disk_t::read(address_space &space, offs_t offset, UINT8 data)
137160{
161   if ((offset & 0xf0000) == 0xc0000)
162   {
163      if ((offset & 0xffc0) == 0x3fc0)
164      {
165         switch ((offset >> 2) & 0x03)
166         {
167         case 0:
168            data = m_fdc->read(space, offset & 0x03);
169            break;
170         
171         case 3:
172            /*
173
174               bit      description
175
176               0       BUSY
177               1       
178               2       
179               3       
180               4       
181               5       
182               6       
183               7       
184
185            */
186
187            data = m_busy;
188            break;
189         }
190      }
191      else
192      {
193         data = m_rom->base()[offset & 0x3fff];
194      }
195   }
196
138197   return data;
139198}
140199
r30800r30801
145204
146205void sandy_super_disk_t::write(address_space &space, offs_t offset, UINT8 data)
147206{
207   if ((offset & 0xf0000) == 0xc0000)
208   {
209      if ((offset & 0xffc0) == 0x3fc0)
210      {
211         switch ((offset >> 2) & 0x03)
212         {
213         case 0:
214            m_fdc->write(space, offset & 0x03, data);
215            break;
216
217         case 1:
218            {
219            /*
220
221               bit      description
222
223               0       SIDE ONE
224               1       DSEL0
225               2       DSEL1
226               3       M ON0
227               4       /DDEN
228               5       STROBE inverted
229               6       enable printer interrupt
230               7       
231
232            */
233
234            floppy_image_device *floppy = NULL;
235
236            if (BIT(data, 1))
237            {
238               floppy = m_floppy0->get_device();
239            }
240            else if (BIT(data, 2))
241            {
242               floppy = m_floppy1->get_device();
243            }
244
245            m_fdc->set_floppy(floppy);
246
247            if (floppy)
248            {
249               floppy->ss_w(BIT(data, 0));
250               floppy->mon_w(BIT(data, 3));
251            }
252
253            m_fdc->dden_w(BIT(data, 4));
254
255            m_centronics->write_strobe(!BIT(data, 5));
256
257            m_fd6 = BIT(data, 6);
258            check_interrupt();
259            }
260            break;
261
262         case 2:
263            m_latch->write(data);
264            break;
265         }
266      }
267   }
148268}
269
270void sandy_super_disk_t::check_interrupt()
271{
272   int extint = m_fd6 && m_busy;
273
274   m_slot->extintl_w(extint ? ASSERT_LINE : CLEAR_LINE);
275}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team