Previous 15994 Revisions Next

r4262 Friday 13th February, 2009 at 16:15:20 UTC by Robbbert
[SUPER80] Converted to new centronics device.
[src/mess/drivers]super80.c

src/mess/drivers/super80.c
r4261r4262
1010#include "devices/cassette.h"
1111#include "devices/z80bin.h"
1212#include "sound/speaker.h"
13#include "machine/centroni.h"
13#include "machine/ctronics.h"
1414#include "devices/printer.h"
1515
1616static UINT8 super80_mhz=2;   /* state of bit 2 of port F0 */
r4261r4262
454454   The most commonly used I/O range is DC-DE (DC = centronics, DD = serial data, DE = serial control
455455   All the home-brew roms use this, except for super80e which uses BC-BE (which we don't support yet). */
456456
457static void super80_printer_handshake_in(running_machine *machine,int number, int data, int mask)
458{
459   if (mask & CENTRONICS_ACKNOWLEDGE)
460   {
461      if (data & CENTRONICS_ACKNOWLEDGE)
462      {
463      }
464   }
465}
466
467static const CENTRONICS_CONFIG super80_cent_config[1]={
468   {
469      PRINTER_CENTRONICS,
470      super80_printer_handshake_in
471   },
472};
473
474static const device_config *printer_device(running_machine *machine)
475{
476   return devtag_get_device(machine, PRINTER, "printer");
477}
478
479
480457/**************************** I/O PORTS *****************************************************************/
481458
482459static READ8_HANDLER( super80v_11_r )
r4261r4262
489466
490467static READ8_HANDLER( super80_dc_r )
491468{
469   const device_config *printer = devtag_get_device(space->machine, CENTRONICS, "centronics");
492470   UINT8 data=0x7f;
493471
494472   /* bit 7 = printer busy
495473   0 = printer is not busy */
496474
497   if (printer_is_ready(printer_device(space->machine))==0 )
498      data |= 0x80;
475   data |= centronics_busy_r(printer) << 7;
499476
500477   return data;
501478}
r4261r4262
523500static WRITE8_HANDLER( super80_dc_w )
524501{
525502   /* hardware strobe driven from port select, bit 7..0 = data */
526   centronics_write_handshake(space->machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
527   centronics_write_handshake(space->machine, 0, 1, CENTRONICS_STROBE);
528   centronics_write_data(space->machine, 0, data);
529   centronics_write_handshake(space->machine, 0, 0, CENTRONICS_STROBE);
503   const device_config *printer = devtag_get_device(space->machine, CENTRONICS, "centronics");
504   centronics_strobe_w(printer, 1);
505   centronics_data_w(printer, 0, data);
506   centronics_strobe_w(printer, 0);
530507}
531508
532509static UINT8 last_data;
r4261r4262
1000977static MACHINE_RESET( super80 )
1001978{
1002979   super80_z80pio = devtag_get_device(machine, Z80PIO, "z80pio");
1003   centronics_config(machine,0, super80_cent_config);
1004   /* assumption: select is tied low */
1005   centronics_write_handshake(machine,0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
1006980   timer_set(machine, ATTOTIME_IN_USEC(10), NULL, 0, super80_reset);
1007981   memory_set_bank(machine, 1, 1);
1008982}
r4261r4262
10581032   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
10591033
10601034   /* printer */
1061   MDRV_PRINTER_ADD("printer")
1035   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
10621036
10631037   /* quickload */
10641038   MDRV_Z80BIN_QUICKLOAD_ADD(default, 1)
r4261r4262
11181092   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
11191093
11201094   /* printer */
1121   MDRV_PRINTER_ADD("printer")
1095   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
11221096
11231097   /* quickload */
11241098   MDRV_Z80BIN_QUICKLOAD_ADD(default, 1)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team