Previous 199869 Revisions Next

r34083 Saturday 27th December, 2014 at 11:19:20 UTC by Olivier Galibert
Robert, is that your idea of a joke? (nw)

Revert "(MESS) excalibur : removed unused code (nw)"
Revert "(MESS) excalibur : more unused code (nw)"

This reverts commit 82e58068109f8932732da1cc80761f0ae62e7638.
This reverts commit 3b4803da9a482ffdcbb1394a3e2106b2b70d5f84.
[src/lib]lib.mak
[src/lib/formats]excali64_dsk.c* excali64_dsk.h*
[src/mess/drivers]excali64.c

trunk/src/lib/formats/excali64_dsk.c
r0r242595
1// license:BSD-3-Clause
2// copyright-holders:Olivier Galibert
3/*********************************************************************
4
5    formats/excali64_dsk.c
6
7    Excalibur 64 disk image format
8
9*********************************************************************/
10
11#include "emu.h"
12#include "formats/excali64_dsk.h"
13
14excali64_format::excali64_format() : wd177x_format(formats)
15{
16}
17
18const char *excali64_format::name() const
19{
20   return "excali64";
21}
22
23const char *excali64_format::description() const
24{
25   return "Excalibur 64 disk image";
26}
27
28const char *excali64_format::extensions() const
29{
30   return "raw";
31}
32
33// Unverified gap sizes
34const excali64_format::format excali64_format::formats[] = {
35   {   /*  800K 19cm double density */
36      floppy_image::FF_525,  floppy_image::DSDD, floppy_image::MFM,
37      2000,  5, 80, 2, 1024, {}, 1, {}, 100, 22, 84
38   },
39   {}
40};
41
42const floppy_format_type FLOPPY_EXCALI64_FORMAT = &floppy_image_format_creator<excali64_format>;
trunk/src/lib/formats/excali64_dsk.h
r0r242595
1/*********************************************************************
2
3    formats/excali64_dsk.h
4
5    Excalibur 64 disk image format
6
7*********************************************************************/
8
9#ifndef EXCALI64_DSK_H_
10#define EXCALI64_DSK_H_
11
12#include "wd177x_dsk.h"
13
14class excali64_format : public wd177x_format {
15public:
16   excali64_format();
17
18   virtual const char *name() const;
19   virtual const char *description() const;
20   virtual const char *extensions() const;
21
22private:
23   static const format formats[];
24};
25
26extern const floppy_format_type FLOPPY_EXCALI64_FORMAT;
27
28#endif
trunk/src/lib/lib.mak
r242594r242595
148148   $(LIBOBJ)/formats/ep64_dsk.o    \
149149   $(LIBOBJ)/formats/esq8_dsk.o    \
150150   $(LIBOBJ)/formats/esq16_dsk.o   \
151   $(LIBOBJ)/formats/excali64_dsk.o\
151152   $(LIBOBJ)/formats/fc100_cas.o   \
152153   $(LIBOBJ)/formats/fdi_dsk.o     \
153154   $(LIBOBJ)/formats/fdd_dsk.o     \
trunk/src/mess/drivers/excali64.c
r242594r242595
1919
2020ToDo:
2121- Colours are approximate.
22- Disk controller, using the old wd17xx because new wd crashes on loading a disk.
22- Disk controller, works with old wd17xx but crashes on new wd.
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
r242594r242595
2929
3030****************************************************************************/
3131
32#define NEWFDC 0
33
34
3235#include "emu.h"
3336#include "cpu/z80/z80.h"
3437#include "video/mc6845.h"
3538#include "machine/i8251.h"
3639#include "bus/rs232/rs232.h"
40//#include "machine/clock.h"
3741#include "machine/pit8253.h"
3842#include "machine/i8255.h"
3943#include "bus/centronics/ctronics.h"
r242594r242595
4347#include "machine/z80dma.h"
4448#include "machine/rescap.h"
4549#include "machine/74123.h"
50#if NEWFDC
51#include "machine/wd_fdc.h"
52#include "formats/excali64_dsk.h"
53#else
4654#include "machine/wd17xx.h"
4755#include "imagedev/flopdrv.h"
4856#include "formats/basicdsk.h"
57#endif
4958
5059class excali64_state : public driver_device
5160{
r242594r242595
6170      , m_u12(*this, "u12")
6271      , m_centronics(*this, "centronics")
6372      , m_fdc(*this, "fdc")
73#if NEWFDC
74      , m_floppy0(*this, "fdc:0")
75      , m_floppy1(*this, "fdc:1")
76#endif
6477   { }
6578
6679   DECLARE_PALETTE_INIT(excali64);
r242594r242595
7386   DECLARE_WRITE8_MEMBER(porte4_w);
7487   DECLARE_READ8_MEMBER(porte8_r);
7588   DECLARE_WRITE8_MEMBER(portec_w);
89#if NEWFDC
90   DECLARE_FLOPPY_FORMATS(floppy_formats);
91#endif
7692   DECLARE_WRITE_LINE_MEMBER(cent_busy_w);
7793   DECLARE_WRITE_LINE_MEMBER(busreq_w);
7894   DECLARE_READ8_MEMBER(memory_read_byte);
r242594r242595
103119   required_device<z80dma_device> m_dma;
104120   required_device<ttl74123_device> m_u12;
105121   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
106127   required_device<wd2793_device> m_fdc;
128#endif
107129};
108130
109131static ADDRESS_MAP_START(excali64_mem, AS_PROGRAM, 8, excali64_state)
r242594r242595
129151   AM_RANGE(0xe4, 0xe7) AM_WRITE(porte4_w)
130152   AM_RANGE(0xe8, 0xeb) AM_READ(porte8_r)
131153   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
132157   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_device, read, write)
158#endif
133159ADDRESS_MAP_END
134160
135161
r242594r242595
220246   m_centronics_busy = state;
221247}
222248
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
223258static LEGACY_FLOPPY_OPTIONS_START(excali64)
224259   LEGACY_FLOPPY_OPTION(excali64_ds, "raw", "Excalibur 64 DS disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
225260      HEADS([2])
r242594r242595
235270   LEGACY_FLOPPY_OPTIONS_NAME(excali64),
236271   NULL
237272};
273#endif
238274
239275// pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off.
240276WRITE8_MEMBER( excali64_state::motor_w )
241277{
242278   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
243283   legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(FLOPPY_0);
244284   flop->floppy_mon_w(!m_motor); // motor on
245285   flop = subdevice<legacy_floppy_image_device>(FLOPPY_1);
246286   flop->floppy_mon_w(!m_motor); // motor on
287#endif
247288}
248289
249290READ8_MEMBER( excali64_state::porte8_r )
r242594r242595
253294
254295WRITE8_MEMBER( excali64_state::porte4_w )
255296{
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
256311   if BIT(data, 0)
257312      m_fdc->set_drive(0);
258313
r242594r242595
260315      m_fdc->set_drive(1);
261316
262317   m_fdc->set_side(BIT(data, 4));
318#endif
263319
264320   m_u12->b_w(space,offset, BIT(data, 5)); // motor pulse
265321}
r242594r242595
271327*/
272328WRITE8_MEMBER( excali64_state::portec_w )
273329{
330#if NEWFDC
331   m_fdc->dden_w(BIT(data, 2));
332#else
274333   m_fdc->dden_w(!BIT(data, 2));
334#endif
275335}
276336
277337WRITE_LINE_MEMBER( excali64_state::busreq_w )
r242594r242595
592652
593653   /* Devices */
594654   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
595662   MCFG_DEVICE_ADD("fdc", WD2793, 0)
596663   MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
597664   MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
598665   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(excali64_floppy_interface)
599
666#endif
600667   MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4)
601668   MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w))
602669   MCFG_Z80DMA_IN_MREQ_CB(READ8(excali64_state, memory_read_byte))


Previous 199869 Revisions Next


© 1997-2024 The MAME Team