Previous 15994 Revisions Next

r4264 Friday 13th February, 2009 at 16:54:47 UTC by Robbbert
[EXIDY] Converted to new centronics device.
[src/mess/drivers]exidy.c

src/mess/drivers/exidy.c
r4263r4264
132132of the tape during playback.
133133
134134The sorcerer has a UART device used by the serial interface and the cassette system.
135So far, it has been tested to work at 300 baud.
136135
136
137137********************************************************************************/
138138
139139#include "driver.h"
r4263r4264
141141#include "sound/speaker.h"
142142#include "sound/wave.h"
143143#include "includes/exidy.h"
144#include "machine/centroni.h"
144#include "machine/ctronics.h"
145145#include "machine/wd17xx.h"
146146#include "devices/basicdsk.h"
147147#include "devices/cassette.h"
r4263r4264
311311   }
312312}
313313
314static void exidy_printer_handshake_in(running_machine *machine,int number, int data, int mask)
315{
316   if (mask & CENTRONICS_ACKNOWLEDGE)
317   {
318      if (data & CENTRONICS_ACKNOWLEDGE)
319      {
320      }
321   }
322}
323314
324static const CENTRONICS_CONFIG exidy_cent_config[1]={
325   {
326      PRINTER_CENTRONICS,
327      exidy_printer_handshake_in
328   },
329};
330
331
332315/* after the first 4 bytes have been read from ROM, switch the ram back in */
333316static TIMER_CALLBACK( exidy_reset )
334317{
r4263r4264
358341
359342   exidy_ay31015 = devtag_get_device(machine, AY31015, "ay_3_1015");
360343
361   centronics_config(machine, 0, exidy_cent_config);
362   /* assumption: select is tied low */
363   centronics_write_handshake(machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
364344   exidy_fe_port_w(space, 0, 0);
365345
366346   timer_set(machine, ATTOTIME_IN_USEC(10), NULL, 0, exidy_reset);
r4263r4264
506486
507487static WRITE8_HANDLER(exidy_ff_port_w)
508488{
489   const device_config *printer = devtag_get_device(space->machine, CENTRONICS, "centronics");
509490   /* reading the config switch */
510491   switch (input_port_read(space->machine, "CONFIG") & 0x06)
511492   {
r4263r4264
515496
516497      case 2: /* Centronics 7-bit printer */
517498         /* bit 7 = strobe, bit 6..0 = data */
518         centronics_write_handshake(space->machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
519         centronics_write_handshake(space->machine, 0, (~data>>7) & 0x01, CENTRONICS_STROBE);
520         centronics_write_data(space->machine, 0, data & 0x7f);
499         centronics_strobe_w(printer, (~data>>7) & 0x01);
500         centronics_data_w(printer, 0, data & 0x7f);
521501         break;
522502
523503      case 4: /* 8-bit parallel output */
524504         /* hardware strobe driven from port select, bit 7..0 = data */
525         centronics_write_handshake(space->machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
526         centronics_write_handshake(space->machine, 0, 1, CENTRONICS_STROBE);
527         centronics_write_data(space->machine, 0, data);
528         centronics_write_handshake(space->machine, 0, 0, CENTRONICS_STROBE);
505         centronics_strobe_w(printer, 1);
506         centronics_data_w(printer, 0, data);
507         centronics_strobe_w(printer, 0);
529508         break;
530509   }
531510}
r4263r4264
574553   return data;
575554}
576555
577static const device_config *printer_device(running_machine *machine)
578{
579   return devtag_get_device(machine, PRINTER, "printer");
580}
581
582556static READ8_HANDLER(exidy_ff_port_r)
583557{
584558   /* The use of the parallel port as a general purpose port is not emulated.
r4263r4264
586560   This uses bit 7. The other bits have been set high (=nothing plugged in).
587561   This fixes those games that use a joystick. */
588562
563   const device_config *printer = devtag_get_device(space->machine, CENTRONICS, "centronics");
589564   UINT8 data=0x7f;
590565
591566   /* bit 7 = printer busy
592567   0 = printer is not busy */
593568
594   if (printer_is_ready(printer_device(space->machine))==0 )
595      data |= 0x80;
569   data |= centronics_busy_r(printer) << 7;
596570
597571   return data;
598572}
r4263r4264
820794   MDRV_AY31015_ADD( "ay_3_1015", exidy_ay31015_config )
821795
822796   /* printer */
823   MDRV_PRINTER_ADD("printer")
797   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
824798
825799   /* quickload */
826800   MDRV_Z80BIN_QUICKLOAD_ADD(exidy, 2)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team