Previous 199869 Revisions Next

r34065 Friday 26th December, 2014 at 08:39:21 UTC by Robbbert
(MESS) excalibur : removed unused code (nw)
[src/mess/drivers]excali64.c

trunk/src/mess/drivers/excali64.c
r242576r242577
1919
2020ToDo:
2121- Colours are approximate.
22- Disk controller, works with old wd17xx but crashes on new wd.
22- Disk controller, using the old wd17xx because new wd crashes on loading a disk.
2323- Hardware supports 20cm and 13cm floppies, but we only support 13cm as this
2424  is the only software that exists.
2525- The schematic shows the audio counter connected to 2MHz, but this produces
r242576r242577
2929
3030****************************************************************************/
3131
32#define NEWFDC 0
33
34
3532#include "emu.h"
3633#include "cpu/z80/z80.h"
3734#include "video/mc6845.h"
3835#include "machine/i8251.h"
3936#include "bus/rs232/rs232.h"
40//#include "machine/clock.h"
4137#include "machine/pit8253.h"
4238#include "machine/i8255.h"
4339#include "bus/centronics/ctronics.h"
r242576r242577
4743#include "machine/z80dma.h"
4844#include "machine/rescap.h"
4945#include "machine/74123.h"
50#if NEWFDC
51#include "machine/wd_fdc.h"
52#include "formats/excali64_dsk.h"
53#else
5446#include "machine/wd17xx.h"
5547#include "imagedev/flopdrv.h"
5648#include "formats/basicdsk.h"
57#endif
5849
5950class excali64_state : public driver_device
6051{
r242576r242577
7061      , m_u12(*this, "u12")
7162      , m_centronics(*this, "centronics")
7263      , m_fdc(*this, "fdc")
73#if NEWFDC
74      , m_floppy0(*this, "fdc:0")
75      , m_floppy1(*this, "fdc:1")
76#endif
7764   { }
7865
7966   DECLARE_PALETTE_INIT(excali64);
r242576r242577
8673   DECLARE_WRITE8_MEMBER(porte4_w);
8774   DECLARE_READ8_MEMBER(porte8_r);
8875   DECLARE_WRITE8_MEMBER(portec_w);
89#if NEWFDC
90   DECLARE_FLOPPY_FORMATS(floppy_formats);
91#endif
9276   DECLARE_WRITE_LINE_MEMBER(cent_busy_w);
9377   DECLARE_WRITE_LINE_MEMBER(busreq_w);
9478   DECLARE_READ8_MEMBER(memory_read_byte);
r242576r242577
119103   required_device<z80dma_device> m_dma;
120104   required_device<ttl74123_device> m_u12;
121105   required_device<centronics_device> m_centronics;
122#if NEWFDC
123   required_device<wd2793_t> m_fdc;
124   required_device<floppy_connector> m_floppy0;
125   required_device<floppy_connector> m_floppy1;
126#else
127106   required_device<wd2793_device> m_fdc;
128#endif
129107};
130108
131109static ADDRESS_MAP_START(excali64_mem, AS_PROGRAM, 8, excali64_state)
r242576r242577
151129   AM_RANGE(0xe4, 0xe7) AM_WRITE(porte4_w)
152130   AM_RANGE(0xe8, 0xeb) AM_READ(porte8_r)
153131   AM_RANGE(0xec, 0xef) AM_WRITE(portec_w)
154#if NEWFDC
155   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
156#else
157132   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_device, read, write)
158#endif
159133ADDRESS_MAP_END
160134
161135
r242576r242577
246220   m_centronics_busy = state;
247221}
248222
249#if NEWFDC
250FLOPPY_FORMATS_MEMBER( excali64_state::floppy_formats )
251   FLOPPY_EXCALI64_FORMAT
252FLOPPY_FORMATS_END
253
254static SLOT_INTERFACE_START( excali64_floppies )
255   SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
256SLOT_INTERFACE_END
257#else
258223static LEGACY_FLOPPY_OPTIONS_START(excali64)
259224   LEGACY_FLOPPY_OPTION(excali64_ds, "raw", "Excalibur 64 DS disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
260225      HEADS([2])
r242576r242577
270235   LEGACY_FLOPPY_OPTIONS_NAME(excali64),
271236   NULL
272237};
273#endif
274238
275239// pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off.
276240WRITE8_MEMBER( excali64_state::motor_w )
277241{
278242   m_motor = BIT(data, 0);
279#if NEWFDC
280   m_floppy1->get_device()->mon_w(!m_motor);
281   m_floppy0->get_device()->mon_w(!m_motor);
282#else
283243   legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(FLOPPY_0);
284244   flop->floppy_mon_w(!m_motor); // motor on
285245   flop = subdevice<legacy_floppy_image_device>(FLOPPY_1);
286246   flop->floppy_mon_w(!m_motor); // motor on
287#endif
288247}
289248
290249READ8_MEMBER( excali64_state::porte8_r )
r242576r242577
294253
295254WRITE8_MEMBER( excali64_state::porte4_w )
296255{
297#if NEWFDC
298   floppy_image_device *floppy = NULL;
299   if (BIT(data, 0))
300      floppy = m_floppy0->get_device();
301
302   if (BIT(data, 1))
303      floppy = m_floppy1->get_device();
304
305   if (floppy)
306   {
307      m_fdc->set_floppy(floppy);
308      floppy->ss_w(BIT(data, 4));
309   }
310#else
311256   if BIT(data, 0)
312257      m_fdc->set_drive(0);
313258
r242576r242577
315260      m_fdc->set_drive(1);
316261
317262   m_fdc->set_side(BIT(data, 4));
318#endif
319263
320264   m_u12->b_w(space,offset, BIT(data, 5)); // motor pulse
321265}
r242576r242577
327271*/
328272WRITE8_MEMBER( excali64_state::portec_w )
329273{
330#if NEWFDC
331   m_fdc->dden_w(BIT(data, 2));
332#else
333274   m_fdc->dden_w(!BIT(data, 2));
334#endif
335275}
336276
337277WRITE_LINE_MEMBER( excali64_state::busreq_w )
r242576r242577
652592
653593   /* Devices */
654594   MCFG_CASSETTE_ADD( "cassette" )
655#if NEWFDC
656   MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 16)
657   MCFG_WD_FDC_FORCE_READY
658   MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
659   MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats)// excali64_state::floppy_formats)
660   MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats)
661#else
662595   MCFG_DEVICE_ADD("fdc", WD2793, 0)
663596   MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
664597   MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
665598   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(excali64_floppy_interface)
666#endif
599
667600   MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4)
668601   MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w))
669602   MCFG_Z80DMA_IN_MREQ_CB(READ8(excali64_state, memory_read_byte))


Previous 199869 Revisions Next


© 1997-2024 The MAME Team