Previous 199869 Revisions Next

r19197 Wednesday 28th November, 2012 at 15:58:15 UTC by Curt Coder
(MESS) e01: Floppy modernization. (nw)
[src/mess/machine]e01.c e01.h

trunk/src/mess/machine/e01.c
r19196r19197
237237//  wd17xx_interface fdc_intf
238238//-------------------------------------------------
239239
240WRITE_LINE_MEMBER( e01_device::fdc_irq_w )
240static SLOT_INTERFACE_START( e01_floppies )
241   SLOT_INTERFACE( "35dd", FLOPPY_35_DD )
242SLOT_INTERFACE_END
243
244void e01_device::fdc_irq_w(bool state)
241245{
242246   m_fdc_irq = state;
243247
244248   update_interrupts();
245249}
246250
247WRITE_LINE_MEMBER( e01_device::fdc_drq_w )
251void e01_device::fdc_drq_w(bool state)
248252{
249253   m_fdc_drq = state;
250254
251255   update_interrupts();
252256}
253257
254static const wd17xx_interface fdc_intf =
255{
256   DEVCB_NULL,
257   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, fdc_irq_w),
258   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, fdc_drq_w),
259   { FLOPPY_0, FLOPPY_1, NULL, NULL }
260};
261
262
263258WRITE_LINE_MEMBER( e01_device::scsi_bsy_w )
264259{
265260   if (state)
r19196r19197
301296   AM_RANGE(0xfc00, 0xfc00) AM_MIRROR(0x00c3) AM_READWRITE(rtc_address_r, rtc_address_w)
302297   AM_RANGE(0xfc04, 0xfc04) AM_MIRROR(0x00c3) AM_READWRITE(rtc_data_r, rtc_data_w)
303298   AM_RANGE(0xfc08, 0xfc08) AM_MIRROR(0x00c0) AM_READ(ram_select_r) AM_WRITE(floppy_w)
304   AM_RANGE(0xfc0c, 0xfc0f) AM_MIRROR(0x00c0) AM_DEVREADWRITE_LEGACY(WD2793_TAG, wd17xx_r, wd17xx_w)
299   AM_RANGE(0xfc0c, 0xfc0f) AM_MIRROR(0x00c0) AM_DEVREADWRITE(WD2793_TAG, wd2793_t, read, write)
305300   AM_RANGE(0xfc10, 0xfc1f) AM_MIRROR(0x00c0) AM_DEVREADWRITE(R6522_TAG, via6522_device, read, write)
306301   AM_RANGE(0xfc20, 0xfc23) AM_MIRROR(0x00c0) AM_DEVREADWRITE_LEGACY(MC6854_TAG, mc6854_r, mc6854_w)
307302   AM_RANGE(0xfc24, 0xfc24) AM_MIRROR(0x00c3) AM_READWRITE(network_irq_disable_r, network_irq_disable_w)
r19196r19197
329324   // devices
330325   MCFG_VIA6522_ADD(R6522_TAG, XTAL_8MHz/4, via_intf)
331326   MCFG_MC6854_ADD(MC6854_TAG, adlc_intf)
332   MCFG_WD2793_ADD(WD2793_TAG, fdc_intf)
333   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(e01_floppy_interface)
327   MCFG_WD2793x_ADD(WD2793_TAG, XTAL_8MHz/4 *8)
328   MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":0", e01_floppies, "35dd", NULL, floppy_image_device::default_floppy_formats)
329   MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":1", e01_floppies, "35dd", NULL, floppy_image_device::default_floppy_formats)
334330   MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, e01_centronics_intf)
335331
336332   MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
r19196r19197
443439     m_rtc(*this, HD146818_TAG),
444440     m_ram(*this, RAM_TAG),
445441     m_scsibus(*this, SCSIBUS_TAG ":host"),
442     m_floppy0(*this, WD2793_TAG":0"),
443     m_floppy1(*this, WD2793_TAG":1"),
446444     m_adlc_ie(0),
447445     m_hdc_ie(0),
448446     m_rtc_irq(CLEAR_LINE),
r19196r19197
465463     m_rtc(*this, HD146818_TAG),
466464     m_ram(*this, RAM_TAG),
467465     m_scsibus(*this, SCSIBUS_TAG ":host"),
466     m_floppy0(*this, WD2793_TAG":0"),
467     m_floppy1(*this, WD2793_TAG":1"),
468468     m_adlc_ie(0),
469469     m_hdc_ie(0),
470470     m_rtc_irq(CLEAR_LINE),
r19196r19197
506506
507507void e01_device::device_start()
508508{
509   // floppy callbacks
510   m_fdc->setup_intrq_cb(wd2793_t::line_cb(FUNC(e01_device::fdc_irq_w), this));
511   m_fdc->setup_drq_cb(wd2793_t::line_cb(FUNC(e01_device::fdc_drq_w), this));
512
509513   // setup memory banking
510514   UINT8 *ram = m_ram->pointer();
511515   UINT8 *rom = memregion(R65C102_TAG)->base();
r19196r19197
599603
600604    */
601605
602   // floppy 1 select
603   if (!BIT(data, 0)) wd17xx_set_drive(m_fdc, 0);
606   // floppy select
607   floppy_image_device *floppy = NULL;
604608
605   // floppy 2 select
606   if (!BIT(data, 1)) wd17xx_set_drive(m_fdc, 1);
609   if (!BIT(data, 0)) floppy = m_floppy0->get_device();
610   if (!BIT(data, 1)) floppy = m_floppy1->get_device();
607611
612   m_fdc->set_floppy(floppy);
613
608614   // floppy side select
609   wd17xx_set_side(m_fdc, BIT(data, 2));
615   if (floppy) floppy->ss_w(BIT(data, 2));
610616
611617   // TODO NVRAM select
612618   //mc146818_stby_w(m_rtc, BIT(data, 3));
613619
614620   // floppy density
615   wd17xx_dden_w(m_fdc, BIT(data, 4));
621   m_fdc->dden_w(BIT(data, 4));
616622
617623   // floppy master reset
618   wd17xx_mr_w(m_fdc, BIT(data, 5));
624   if (!BIT(data, 5)) m_fdc->reset();
619625
620626   // TODO floppy test
621   //wd17xx_test_w(m_fdc, BIT(data, 6));
622627
623628   // mode LED
624629   output_set_value("led_0", BIT(data, 7));
trunk/src/mess/machine/e01.h
r19196r19197
2222#include "machine/mc6854.h"
2323#include "machine/ram.h"
2424#include "machine/scsicb.h"
25#include "machine/wd17xx.h"
25#include "machine/wd_fdc.h"
2626
2727class e01_device : public device_t,
2828               public device_econet_interface
r19196r19197
6363   DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
6464   DECLARE_WRITE_LINE_MEMBER( scsi_bsy_w );
6565   DECLARE_WRITE_LINE_MEMBER( scsi_req_w );
66   void fdc_irq_w(bool state);
67   void fdc_drq_w(bool state);
6668
6769protected:
6870    // device-level overrides
r19196r19197
8082   virtual void econet_clk(int state);
8183
8284   required_device<m65c02_device> m_maincpu;
83   required_device<wd2793_device> m_fdc;
85   required_device<wd2793_t> m_fdc;
8486   required_device<mc6854_device> m_adlc;
8587   required_device<mc146818_device> m_rtc;
8688   required_device<ram_device> m_ram;
8789   required_device<scsicb_device> m_scsibus;
90   required_device<floppy_connector> m_floppy0;
91   required_device<floppy_connector> m_floppy1;
8892
8993   inline void update_interrupts();
9094   inline void network_irq_enable(int enabled);
r19196r19197
97101   int m_via_irq;
98102   int m_hdc_irq;
99103   int m_fdc_irq;
100   int m_fdc_drq;
104   bool m_fdc_drq;
101105   int m_adlc_irq;
102106
103107   int m_clk_en;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team