Previous 199869 Revisions Next

r19477 Tuesday 11th December, 2012 at 20:43:34 UTC by Curt Coder
(MESS) abc1600: Modernized floppy. (nw)
[src/mess/drivers]abc1600.c
[src/mess/includes]abc1600.h

trunk/src/mess/drivers/abc1600.c
r19476r19477
22
33    Luxor ABC 1600
44
5    Skeleton driver
6*/
7
8/*
9
105    How to create HDD image:
116    ------------------------
12    chdman -createblankhd necd5126a.chd 615 4 17 512
7    chdman createhd -chs 615,4,17 -ss 512 -o necd5126a.chd
138
149    How to format HDD:
1510    ------------------
r19476r19477
4237        sega19 0 task 0
4338        sega 000 segd 00 pga 008 pgd 4058 virtual 02c730 (should be 004730)
4439
45    - floppy
46        - internal floppy is really drive 2, but wd17xx.c doesn't like having NULL drives
4740    - short/long reset (RSTBUT)
4841    - CIO
4942        - optimize timers!
r19476r19477
262255      switch (A10_A9_A8)
263256      {
264257      case FLP:
265         data = wd17xx_r(m_fdc, program, A2_A1);
258         data = m_fdc->gen_r(A2_A1);
266259         break;
267260
268261      case CRT:
r19476r19477
516509      switch (A10_A9_A8)
517510      {
518511      case FLP:
519         wd17xx_w(m_fdc, program, A2_A1, data);
512         m_fdc->gen_w(A2_A1, data);
520513         break;
521514
522515      case CRT:
r19476r19477
11161109   if (m_sysfs)
11171110   {
11181111      // floppy
1119      m_dma0->rdy_w(!wd17xx_drq_r(m_fdc));
1112      m_dma0->rdy_w(!m_fdc->drq_r());
11201113   }
11211114   else
11221115   {
r19476r19477
12781271   if (LOG) logerror("FW0 %02x\n", data);
12791272
12801273   // drive select
1281   if (BIT(data, 0)) wd17xx_set_drive(m_fdc, 0);
1282   if (BIT(data, 1)) wd17xx_set_drive(m_fdc, 1);
1283   if (BIT(data, 2)) wd17xx_set_drive(m_fdc, 2);
1274   floppy_image_device *floppy = NULL;
1275   
1276   if (BIT(data, 0)) floppy = m_floppy0->get_device();
1277   if (BIT(data, 1)) floppy = m_floppy1->get_device();
1278   if (BIT(data, 2)) floppy = m_floppy2->get_device();
1279   
1280   m_fdc->set_floppy(floppy);
12841281
12851282   // floppy motor
1286   floppy_mon_w(m_floppy, !BIT(data, 3));
1283   if (floppy) floppy->mon_w(!BIT(data, 3));
12871284}
12881285
12891286
r19476r19477
13111308   if (LOG) logerror("FW1 %02x\n", data);
13121309
13131310   // FDC master reset
1314   wd17xx_mr_w(m_fdc, BIT(data, 0));
1311   if (!BIT(data, 0)) m_fdc->reset();
13151312
13161313   // density select
1317   wd17xx_dden_w(m_fdc, BIT(data, 1));
1314   m_fdc->dden_w(BIT(data, 1));
13181315}
13191316
13201317
r19476r19477
16131610   data |= !m_sysfs << 6;
16141611
16151612   // floppy interrupt
1616   data |= wd17xx_intrq_r(m_fdc) << 7;
1613   data |= m_fdc->intrq_r() << 7;
16171614
16181615   return data;
16191616}
r19476r19477
17071704//-------------------------------------------------
17081705//  wd17xx_interface fdc_intf
17091706//-------------------------------------------------
1710
1707/*
17111708static LEGACY_FLOPPY_OPTIONS_START( abc1600 )
17121709   LEGACY_FLOPPY_OPTION(abc1600, "dsk", "Luxor ABC 1600", basicdsk_identify_default, basicdsk_construct_default, NULL,
17131710      HEADS([2])
r19476r19477
17161713      SECTOR_LENGTH([256])
17171714      FIRST_SECTOR_ID([1]))
17181715LEGACY_FLOPPY_OPTIONS_END
1716*/
17191717
1720static const floppy_interface abc1600_floppy_interface =
1718static SLOT_INTERFACE_START( abc1600_floppies )
1719   SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
1720SLOT_INTERFACE_END
1721
1722void abc1600_state::fdc_intrq_w(bool state)
17211723{
1722    DEVCB_NULL,
1723    DEVCB_NULL,
1724    DEVCB_NULL,
1725    DEVCB_NULL,
1726    DEVCB_NULL,
1727    FLOPPY_STANDARD_5_25_DSQD,
1728    LEGACY_FLOPPY_OPTIONS_NAME(abc1600),
1729    "floppy_5_25",
1730   NULL
1731};
1724   m_cio->pb7_w(state);
1725}
17321726
1733WRITE_LINE_MEMBER( abc1600_state::drq_w )
1727void abc1600_state::fdc_drq_w(bool state)
17341728{
17351729   update_drdy0();
17361730}
17371731
1738static const wd17xx_interface fdc_intf =
1739{
1740   DEVCB_NULL,
1741   DEVCB_DEVICE_LINE_MEMBER(Z8536B1_TAG, z8536_device, pb7_w),
1742   DEVCB_DRIVER_LINE_MEMBER(abc1600_state, drq_w),
1743   { FLOPPY_0, NULL, NULL, NULL } // TODO should be { NULL, NULL, FLOPPY_2, NULL }
1744};
17451732
1746
17471733//-------------------------------------------------
17481734//  ABC99_INTERFACE( abc99_intf )
17491735//-------------------------------------------------
r19476r19477
18511837   // interrupt callback
18521838   m_maincpu->set_irq_acknowledge_callback(abc1600_int_ack);
18531839
1840   // floppy callbacks
1841   m_fdc->setup_intrq_cb(wd_fdc_t::line_cb(FUNC(abc1600_state::fdc_intrq_w), this));
1842   m_fdc->setup_drq_cb(wd_fdc_t::line_cb(FUNC(abc1600_state::fdc_drq_w), this));
1843
18541844   // allocate memory
18551845   m_segment_ram.allocate(0x400);
18561846   m_page_ram.allocate(0x400);
r19476r19477
19321922   MCFG_Z8536_ADD(Z8536B1_TAG, XTAL_64MHz/16, cio_intf)
19331923   MCFG_NMC9306_ADD(NMC9306_TAG)
19341924   MCFG_E0516_ADD(E050_C16PC_TAG, XTAL_32_768kHz)
1935   MCFG_FD1797_ADD(SAB1797_02P_TAG, fdc_intf)
1936   MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, abc1600_floppy_interface)
1925   MCFG_FD1797x_ADD(SAB1797_02P_TAG, XTAL_64MHz/64)
1926   MCFG_FLOPPY_DRIVE_ADD(SAB1797_02P_TAG":0", abc1600_floppies, NULL,    NULL, floppy_image_device::default_floppy_formats)
1927   MCFG_FLOPPY_DRIVE_ADD(SAB1797_02P_TAG":1", abc1600_floppies, NULL,    NULL, floppy_image_device::default_floppy_formats)
1928   MCFG_FLOPPY_DRIVE_ADD(SAB1797_02P_TAG":2", abc1600_floppies, "525qd", NULL, floppy_image_device::default_floppy_formats)
19371929   MCFG_ABC99_ADD(abc99_intf)
19381930
19391931   MCFG_ABC1600BUS_SLOT_ADD("bus0i", bus0i_intf, abc1600bus_cards, NULL, NULL)
trunk/src/mess/includes/abc1600.h
r19476r19477
66
77#include "emu.h"
88#include "cpu/m68000/m68000.h"
9#include "formats/basicdsk.h"
10#include "imagedev/flopdrv.h"
119#include "machine/ram.h"
1210#include "machine/8530scc.h"
1311#include "machine/abc99.h"
r19476r19477
1513#include "machine/e0516.h"
1614#include "machine/lux4105.h"
1715#include "machine/nmc9306.h"
18#include "machine/wd17xx.h"
16#include "machine/wd_fdc.h"
1917#include "machine/z80dart.h"
2018#include "machine/z80dma.h"
2119#include "machine/z8536.h"
r19476r19477
6967        m_nvram(*this, NMC9306_TAG),
7068        m_crtc(*this, SY6845E_TAG),
7169        m_ram(*this, RAM_TAG),
72        m_floppy(*this, FLOPPY_0),
70        m_floppy0(*this, SAB1797_02P_TAG":0"),
71        m_floppy1(*this, SAB1797_02P_TAG":1"),
72        m_floppy2(*this, SAB1797_02P_TAG":2"),
7373        m_bus0i(*this, BUS0I_TAG),
7474        m_bus0x(*this, BUS0X_TAG),
7575        m_bus1(*this, BUS1_TAG),
r19476r19477
8686   required_device<z80dart_device> m_dart;
8787   required_device<scc8530_t> m_scc;
8888   required_device<z8536_device> m_cio;
89   required_device<fd1797_device> m_fdc;
89   required_device<fd1797_t> m_fdc;
9090   required_device<e0516_device> m_rtc;
9191   required_device<nmc9306_device> m_nvram;
9292   required_device<mc6845_device> m_crtc;
9393   required_device<ram_device> m_ram;
94   required_device<legacy_floppy_image_device> m_floppy;
94   required_device<floppy_connector> m_floppy0;
95   required_device<floppy_connector> m_floppy1;
96   required_device<floppy_connector> m_floppy2;
9597   required_device<abc1600bus_slot_device> m_bus0i;
9698   required_device<abc1600bus_slot_device> m_bus0x;
9799   required_device<abc1600bus_slot_device> m_bus1;
r19476r19477
120122
121123   DECLARE_WRITE8_MEMBER( dmamap_w );
122124   DECLARE_WRITE_LINE_MEMBER( dbrq_w );
123   DECLARE_WRITE_LINE_MEMBER( drq_w );
124125   DECLARE_READ8_MEMBER( dma0_mreq_r );
125126   DECLARE_WRITE8_MEMBER( dma0_mreq_w );
126127   DECLARE_READ8_MEMBER( dma0_iorq_r );
r19476r19477
149150
150151   DECLARE_WRITE_LINE_MEMBER( nmi_w );
151152
153   void fdc_intrq_w(bool state);
154   void fdc_drq_w(bool state);
155
152156   int get_current_task(offs_t offset);
153157   offs_t get_segment_address(offs_t offset);
154158   offs_t get_page_address(offs_t offset, UINT8 segd);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team