Previous 199869 Revisions Next

r33982 Saturday 20th December, 2014 at 12:56:49 UTC by Robbbert
(MESS) excalibur : floppies are working (nw)
[src/mess/drivers]excali64.c

trunk/src/mess/drivers/excali64.c
r242493r242494
1212There are 2 versions of the colour prom, which have different palettes.
1313We have the later version.
1414
15Control W then Enter will switch between 40 and 80 characters per line.
15Notes:
16- Control W then Enter will switch between 40 and 80 characters per line.
17- Control V turns cursor on
18- Graphics commands such as LINE, CIRCLE, HGRCLS, HGRSET etc only work with disk basic
1619
1720ToDo:
1821- Colours are approximate.
19- Disk controller
20- Graphics commands such as LINE and CIRCLE produce a syntax error.
21- Some commands such as HGRCLS are missing from the rom. Perhaps we need a later version?
22- Issues with bitmap graphics
23- Disk controller, works with old wd17xx but crashes on new wd.
24- Hardware supports 8 and 5.25 inch floppies, but we only support 5.25 as this
25  is the only software that exists.
2226- The schematic shows the audio counter connected to 2MHz, but this produces
2327  sounds that are too high. Connected to 1MHz for now.
2428- Serial
2529- Parallel / Centronics
26- Need software
30- Need more software
2731- Pasting can sometimes drop a character.
2832
2933****************************************************************************/
r242493r242494
4448#include "sound/wave.h"
4549#include "sound/speaker.h"
4650#include "machine/z80dma.h"
51#include "machine/rescap.h"
52#include "machine/74123.h"
4753#if NEWFDC
4854#include "machine/wd_fdc.h"
4955#include "formats/excali64_dsk.h"
r242493r242494
6470      , m_crtc(*this, "crtc")
6571      , m_io_keyboard(*this, "KEY")
6672      , m_dma(*this, "dma")
73      , m_u12(*this, "u12")
6774      , m_fdc(*this, "fdc")
6875#if NEWFDC
6976      , m_floppy0(*this, "fdc:0")
r242493r242494
9299   MC6845_UPDATE_ROW(update_row);
93100   DECLARE_WRITE_LINE_MEMBER(crtc_de);
94101   DECLARE_WRITE_LINE_MEMBER(crtc_vs);
102   DECLARE_WRITE8_MEMBER(motor_w);
95103   DECLARE_MACHINE_RESET(excali64);
96104   required_device<palette_device> m_palette;
97105   
r242493r242494
103111   UINT8 m_kbdrow;
104112   bool m_crtc_vs;
105113   bool m_crtc_de;
114   bool m_motor;
106115   required_device<cpu_device> m_maincpu;
107116   required_device<cassette_image_device> m_cass;
108117   required_device<mc6845_device> m_crtc;
109118   required_ioport_array<8> m_io_keyboard;
110119   required_device<z80dma_device> m_dma;
120   required_device<ttl74123_device> m_u12;
111121#if NEWFDC
112122   required_device<wd2793_t> m_fdc;
113123   required_device<floppy_connector> m_floppy0;
r242493r242494
256266};
257267#endif
258268
269// pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off.
270WRITE8_MEMBER( excali64_state::motor_w )
271{
272   m_motor = BIT(data, 0);
273#if NEWFDC
274   m_floppy0->get_device()->mon_w(!m_motor);
275#else
276   //const char *floppy_tags[4] = { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 };
277   legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(FLOPPY_0);
278   flop->floppy_mon_w(!m_motor); // motor on
279   //flop->floppy_drive_set_ready_state(1, 0); // this is commented out in flopdrv.c, so does nothing
280#endif
281}
282
259283READ8_MEMBER( excali64_state::porte8_r )
260284{
261   return 0xff;
285   return 0xfc | (UINT8)m_motor;
262286}
263287
264288WRITE8_MEMBER( excali64_state::porte4_w )
265289{
266//printf("%X ",data);
267290#if NEWFDC
268291   floppy_image_device *floppy = NULL;
269292   if (BIT(data, 0)) floppy = m_floppy0->get_device();
r242493r242494
272295   if (floppy)
273296      floppy->ss_w(BIT(data, 4));
274297#else
275   UINT8 i;
276   for (i = 0; i < 4; i++)
277   {
278      if BIT(data, i)
279      {
280         m_fdc->set_drive(i);
281         break;
282      }
283   }
284   //if (data & 0x01) m_fdc->set_drive(0);
285   //if (data & 0x02) m_fdc->set_drive(1);
286   //if (data & 0x04) m_fdc->set_drive(2);
287   //if (data & 0x08) m_fdc->set_drive(3);
288   //if (data & 0x10) m_fdc->set_side((data & 0x10) >> 4);
289   const char *floppy_tags[4] = { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 };
298   //UINT8 i;
299   //for (i = 0; i < 4; i++)
300   //{
301   //   if BIT(data, i)
302   //   {
303   //      m_fdc->set_drive(i);
304   //      break;
305   //   }
306   //}
307   if BIT(data, 0) m_fdc->set_drive(0);
308   //if BIT(data, 1) m_fdc->set_drive(1);
309   //if BIT(data, 2) m_fdc->set_drive(2);
310   //if BIT(data, 3) m_fdc->set_drive(3);
311   m_fdc->set_side(BIT(data, 4));
290312
291313   m_fdc->dden_w(1);//!BIT(data, 6)); // we want double density
292   //if ((data & 0x04) == 0) // reset
293   //m_fdc->reset();
294
295   // bit 3 connected to pin 23 "HRDY" of FDC
296   // TEMP HACK, FDD motor and RDY FDC pin controlled by HLD pin of FDC
297   legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(floppy_tags[i]);
298   flop->floppy_mon_w(0); // motor on
299   flop->floppy_drive_set_ready_state(1, 0);
300314#endif
315   m_u12->b_w(space,offset, BIT(data, 5));
301316}
302317
303318WRITE8_MEMBER( excali64_state::portec_w )
r242493r242494
624639   MCFG_CASSETTE_ADD( "cassette" )
625640#if NEWFDC
626641   MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 16)
642   MCFG_WD_FDC_FORCE_READY
643   MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
627644   MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats)// excali64_state::floppy_formats)
628   MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats)
645   //MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "525dd", floppy_image_device::default_floppy_formats)
629646#else
630647   MCFG_DEVICE_ADD("fdc", WD2793, 0)
631   MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
632   //MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(nascom1_state, nascom2_fdc_intrq_w))
633   //MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(nascom1_state, nascom2_fdc_drq_w))
634   //MCFG_WD17XX_DDEN_CALLBACK(VCC)
635   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(excali64_floppy_interface)
648   MCFG_WD17XX_DEFAULT_DRIVE1_TAGS
649   MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
650   MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, excali64_floppy_interface)
651   //MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(excali64_floppy_interface)
636652#endif
637653   MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4)
638654   MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w))
r242493r242494
640656   MCFG_Z80DMA_OUT_MREQ_CB(WRITE8(excali64_state, memory_write_byte))
641657   MCFG_Z80DMA_IN_IORQ_CB(READ8(excali64_state, io_read_byte))
642658   MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(excali64_state, io_write_byte))
659
660   MCFG_DEVICE_ADD("u12", TTL74123, 0)
661   MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED)    /* the hook up type (no idea what this means */
662   MCFG_TTL74123_RESISTOR_VALUE(RES_K(100))               /* resistor connected between RCext & 5v */
663   MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(100))               /* capacitor connected between Cext and RCext */
664   MCFG_TTL74123_A_PIN_VALUE(0)                  /* A pin - grounded */
665   MCFG_TTL74123_B_PIN_VALUE(1)                  /* B pin - driven by port e4 bit 5 */
666   MCFG_TTL74123_CLEAR_PIN_VALUE(1)                  /* Clear pin - pulled high */
667   MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITE8(excali64_state, motor_w))
643668MACHINE_CONFIG_END
644669
645670/* ROM definition */


Previous 199869 Revisions Next


© 1997-2024 The MAME Team