Previous 15994 Revisions Next

r2354 Thursday 10th April, 2008 at 12:15:02 UTC by Nathan Woods
Converted printers to the new device system
[docs]messnew.txt
[src/mess/devices]printer.c printer.h
[src/mess/drivers]abc80.c abc80x.c amstrad.c at.c atarist.c atom.c bbc.c bw2.c coco.c compis.c einstein.c exidy.c msx.c mtx.c nc.c oric.c pc.c pcw16.c sg1000.c sord.c svi318.c thomson.c tmc2000e.c tmc600.c vtech1.c
[src/mess/machine]atom.c centroni.c compis.c msx.c mtx.c svi318.c vtech1.c

src/mess/devices/printer.c
r2353r2354
1/*
2 * printer.c : simple printer port implementation
3 * "online/offline" and output only.
4 */
1/****************************************************************************
52
3   printer.c
4
5   Code for handling printer devices
6
7****************************************************************************/
8
69#include "driver.h"
710#include "printer.h"
811
912
10int printer_status(const device_config *img, int newstatus)
13
14/*-------------------------------------------------
15   printer_is_ready - checks to see if a printer
16   is ready
17-------------------------------------------------*/
18
19int printer_is_ready(const device_config *printer)
1120{
1221   /* if there is a file attached to it, it's online */
13   return image_exists(img) != 0;
22   return image_exists(printer) != 0;
1423}
1524
1625
1726
18void printer_output(const device_config *img, int data)
27/*-------------------------------------------------
28    printer_output - outputs data to a printer
29-------------------------------------------------*/
30
31void printer_output(const device_config *printer, UINT8 data)
1932{
20   if (image_exists(img))
33   if (image_exists(printer))
2134   {
22      UINT8 d = data;
23      image_fwrite(img, &d, 1);
35      image_fwrite(printer, &data, 1);
2436   }
2537}
2638
2739
2840
29void printer_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
41/*-------------------------------------------------
42    DEVICE_START(printer)
43-------------------------------------------------*/
44
45DEVICE_START(printer)
3046{
47}
48
49
50
51/*-------------------------------------------------
52    DEVICE_GET_INFO(printer)
53-------------------------------------------------*/
54
55DEVICE_GET_INFO(printer)
56{
3157   switch(state)
3258   {
3359      /* --- the following bits of info are returned as 64-bit signed integers --- */
34      case MESS_DEVINFO_INT_TYPE:                     info->i = IO_PRINTER; break;
35      case MESS_DEVINFO_INT_READABLE:                  info->i = 0; break;
36      case MESS_DEVINFO_INT_WRITEABLE:                  info->i = 1; break;
37      case MESS_DEVINFO_INT_CREATABLE:                  info->i = 1; break;
60      case DEVINFO_INT_TOKEN_BYTES:               info->i = 1; break;
61      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0; break;
62      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL; break;
63      case DEVINFO_INT_IMAGE_TYPE:               info->i = IO_PRINTER; break;
64      case DEVINFO_INT_IMAGE_READABLE:            info->i = 0; break;
65      case DEVINFO_INT_IMAGE_WRITEABLE:            info->i = 1; break;
66      case DEVINFO_INT_IMAGE_CREATABLE:            info->i = 1; break;
3867
68      /* --- the following bits of info are returned as pointers to data or functions --- */
69      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(printer); break;
70
3971      /* --- the following bits of info are returned as NULL-terminated strings --- */
40      case MESS_DEVINFO_STR_DEV_FILE:                  strcpy(info->s = device_temp_str(), __FILE__); break;
41      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "prn"); break;
72      case DEVINFO_STR_NAME:                     info->s = "Printer"; break;
73      case DEVINFO_STR_FAMILY:                  info->s = "Printer"; break;
74      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__; break;
75      case DEVINFO_STR_IMAGE_FILE_EXTENSIONS:         info->s = "prn"; break;
4276   }
4377}
src/mess/devices/printer.h
r2353r2354
1/*
2 * functions for the IODevice entry IO_PRINTER
3 *
4 * Currently only a simple port which only supports status
5 * ("online/offline") and output of bytes is supported.
6 */
1/****************************************************************************
72
8#ifndef PRINTER_H
9#define PRINTER_H
3   printer.h
104
11#include "device.h"
5   Code for handling printer devices
6
7****************************************************************************/
8
9#ifndef __PRINTER_H__
10#define __PRINTER_H__
11
1212#include "image.h"
1313
14#ifdef __cplusplus
15extern "C" {
16#endif
1714
18   
19#define MAX_PRINTER   (4)
15/***************************************************************************
16    CONSTANTS
17***************************************************************************/
2018
19/* please remove me eventually! */
20#define MAX_PRINTER   4
2121
22int printer_status(const device_config *img, int newstatus);
23void printer_output(const device_config *img, int data);
2422
25void printer_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
2623
24/***************************************************************************
25    TYPE DEFINITIONS
26***************************************************************************/
2727
28#ifdef __cplusplus
29}
30#endif
28#define PRINTER   DEVICE_GET_INFO_NAME(printer)
3129
32#endif /* PRINTER_H */
30
31
32/***************************************************************************
33    FUNCTION PROTOTYPES
34***************************************************************************/
35
36/* checks to see if a printer is ready */
37int printer_is_ready(const device_config *printer);
38
39/* outputs data to a printer */
40void printer_output(const device_config *printer, UINT8 data);
41
42/* device getinfo function */
43DEVICE_GET_INFO(printer);
44
45#endif /* __PRINTER_H__ */
src/mess/machine/msx.c
r2353r2354
446446   return image_from_devtype_and_index(IO_CASSETTE, 0);
447447}
448448
449static const device_config *printer_image(void)
449static const device_config *printer_image(running_machine *machine)
450450{
451   return image_from_devtype_and_index(IO_PRINTER, 0);
451   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
452452}
453453
454454READ8_HANDLER ( msx_psg_port_a_r )
r2353r2354
555555      {
556556         if ((msx1.prn_strobe & 2) && !(data & 2))
557557         {
558            printer_output(printer_image(), msx1.prn_data);
558            printer_output(printer_image(machine), msx1.prn_data);
559559         }
560560
561561         msx1.prn_strobe = data;
r2353r2354
566566READ8_HANDLER ( msx_printer_r )
567567{
568568   if (offset == 0 && ! (input_port_read_indexed(machine, 8) & 0x80) &&
569         printer_status(printer_image(), 0) )
569         printer_is_ready(printer_image(machine)) )
570570      return 253;
571571
572572   return 0xff;
src/mess/machine/atom.c
r2353r2354
5757   return image_from_devtype_and_index(IO_CASSETTE, 0);
5858}
5959
60static const device_config *printer_image(void)
60static const device_config *printer_image(running_machine *machine)
6161{
62   return image_from_devtype_and_index(IO_PRINTER, 0);
62   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
6363}
6464
6565/* printer status */
r2353r2354
6969
7070   data = atom_printer_data;
7171
72   if (!printer_status(printer_image(),0))
72   if (!printer_is_ready(printer_image(machine)))
7373   {
7474      /* offline */
7575      data |=0x080;
r2353r2354
9999      if (data & 0x01)
100100      {
101101         /* output data to printer */
102         printer_output(printer_image(), atom_printer_data);
102         printer_output(printer_image(machine), atom_printer_data);
103103      }
104104   }
105105
src/mess/machine/centroni.c
r2353r2354
55*/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "centroni.h"
910#include "devices/printer.h"
1011
r2353r2354
114115   This->control=neu;
115116}
116117
118static const device_config *printer_device(running_machine *machine, int index)
119{
120   const char *tag;
121   switch(index)
122   {
123      case 0:   
124         tag = "printer1";
125         break;
126      case 1:   
127         tag = "printer2";
128         break;
129      case 2:   
130         tag = "printer3";
131         break;
132      default:
133         fatalerror("Invalid device");
134         break;
135   }
136   return device_list_find_by_tag(machine->config->devicelist, PRINTER, tag);
137}
138
117139int centronics_read_handshake(int nr)
118140{
119141   CENTRONICS *This=cent+nr;
r2353r2354
132154         data|=CENTRONICS_ONLINE;
133155   }
134156   data |= CENTRONICS_NO_ERROR;
135   if (!printer_status(image_from_devtype_and_index(IO_PRINTER, nr), 0))
157   if (!printer_is_ready(printer_device(Machine, nr)))
136158      data |= CENTRONICS_NO_PAPER;
137159
138160   /* state of acknowledge */
src/mess/machine/mtx.c
r2353r2354
128128 *
129129 *************************************/
130130
131static const device_config *mtx_printer_image(void)
131static const device_config *mtx_printer_image(running_machine *machine)
132132{
133   return image_from_devtype_and_index(IO_PRINTER, 0);
133   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
134134}
135135
136136READ8_HANDLER( mtx_strobe_r )
137137{
138138   if (mtx_prt_strobe == 0)
139      printer_output (mtx_printer_image (), mtx_prt_data);
139      printer_output (mtx_printer_image(machine), mtx_prt_data);
140140
141141   mtx_prt_strobe = 1;
142142
r2353r2354
148148{
149149   mtx_prt_strobe = 0;
150150
151   return MTX_PRT_NOERROR | (printer_status (mtx_printer_image (), 0)
151   return MTX_PRT_NOERROR | (printer_is_ready (mtx_printer_image (machine))
152152         ? MTX_PRT_SELECTED : 0);
153153}
154154
src/mess/machine/vtech1.c
r2353r2354
547547 Printer Handling
548548******************************************************************************/
549549
550static const device_config *printer_device(running_machine *machine)
551{
552   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
553}
554
550555/*
551556The VZ200/300 printer interface uses I/O port address OE Hex for the ASCII
552557character code data and strobe output, and address OOH for the busy/ready-bar
r2353r2354
557562{
558563   int data = 0xff;
559564
560   if (printer_status(image_from_devtype_and_index(IO_PRINTER, 0), 0))
565   if (printer_is_ready(printer_device(machine)))
561566      data &= ~0x01;
562567
563568   return data;
src/mess/machine/svi318.c
r2353r2354
278278   }
279279}
280280
281static const device_config *printer_device(running_machine *machine)
282{
283   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
284}
285
281286static READ8_HANDLER( svi318_printer_r )
282287{
283   if (printer_status(image_from_devtype_and_index(IO_PRINTER, 0), 0) )
288   if (printer_is_ready(printer_device(machine)) )
284289      return 0xfe;
285290
286291   return 0xff;
src/mess/machine/compis.c
r2353r2354
373373/*  PPI 8255                                                               */
374374/*-------------------------------------------------------------------------*/
375375
376static const device_config *printer_device(running_machine *machine)
377{
378   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
379}
380
376381/*-------------------------------------------------------------------------*/
377382/* Bit 0: J7-2 Centronics D0                                            */
378383/* Bit 1: J7-3 Centronics D1                                            */
r2353r2354
405410   data = input_port_read_indexed(machine, 6);
406411
407412   /* Centronics busy */
408   if (!printer_status(image_from_devtype_and_index(IO_PRINTER, 0), 0))
413   if (!printer_is_ready(printer_device(machine)))
409414      data |= 0x20;
410415
411416   return    data;
src/mess/drivers/nc.c
r2353r2354
16901690   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
16911691   MDRV_SOUND_ADD(BEEP, 0)
16921692   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1693
1694   /* printer */
1695   MDRV_DEVICE_ADD("printer", PRINTER)
16931696MACHINE_DRIVER_END
16941697
16951698
r2353r2354
17291732        ROM_LOAD("nc200.rom", 0x010000, 0x080000, CRC(bb8180e7) SHA1(fb5c93b0a3e199202c6a12548d2617f7a09bae47))
17301733ROM_END
17311734
1732static void nc_common_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1733{
1734   /* printer */
1735   switch(state)
1736   {
1737      /* --- the following bits of info are returned as 64-bit signed integers --- */
1738      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
1739
1740      default:                              printer_device_getinfo(devclass, state, info); break;
1741   }
1742}
1743
17441735static void nc_common_cartslot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
17451736{
17461737   /* cartslot */
r2353r2354
17841775}
17851776
17861777SYSTEM_CONFIG_START(nc_common)
1787   CONFIG_DEVICE(nc_common_printer_getinfo)
17881778   CONFIG_DEVICE(nc_common_cartslot_getinfo)
17891779   CONFIG_DEVICE(nc_common_serial_getinfo)
17901780SYSTEM_CONFIG_END
src/mess/drivers/sord.c
r2353r2354
648648   MDRV_SPEAKER_STANDARD_MONO("mono")
649649   MDRV_SOUND_ADD(SN76489A, 3579545)   /* 3.579545 MHz */
650650   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
651
652   /* printer */
653   MDRV_DEVICE_ADD("printer", PRINTER)
651654MACHINE_DRIVER_END
652655
653656
r2353r2354
698701      FIRST_SECTOR_ID([1]))
699702FLOPPY_OPTIONS_END
700703
701static void sordm5_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
702{
703   /* printer */
704   switch(state)
705   {
706      /* --- the following bits of info are returned as 64-bit signed integers --- */
707      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
708
709      default:                              printer_device_getinfo(devclass, state, info); break;
710   }
711}
712
713704static void sordm5_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
714705{
715706   /* cassette */
r2353r2354
727718
728719SYSTEM_CONFIG_START(sordm5)
729720   CONFIG_RAM_DEFAULT(64 * 1024)
730   CONFIG_DEVICE(sordm5_printer_getinfo)
731721   CONFIG_DEVICE(sordm5_cassette_getinfo)
732722   CONFIG_DEVICE(cartslot_device_getinfo)
733723SYSTEM_CONFIG_END
src/mess/drivers/coco.c
r2353r2354
599599
600600   /* sound hardware */
601601   MDRV_IMPORT_FROM( coco_sound )
602
603   /* printer */
604   MDRV_DEVICE_ADD("printer", PRINTER)
602605MACHINE_DRIVER_END
603606
604607static MACHINE_DRIVER_START( dragon64 )
r2353r2354
619622
620623   /* sound hardware */
621624   MDRV_IMPORT_FROM( coco_sound )
625
626   /* printer */
627   MDRV_DEVICE_ADD("printer", PRINTER)
622628MACHINE_DRIVER_END
623629
624630static MACHINE_DRIVER_START( d64plus )
r2353r2354
639645
640646   /* sound hardware */
641647   MDRV_IMPORT_FROM( coco_sound )
648
649   /* printer */
650   MDRV_DEVICE_ADD("printer", PRINTER)
642651MACHINE_DRIVER_END
643652
644653static MACHINE_DRIVER_START( dgnalpha )
r2353r2354
662671   MDRV_SOUND_ADD(AY8912, 1000000)
663672   MDRV_SOUND_CONFIG(ay8912_interface)
664673   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
674
675   /* printer */
676   MDRV_DEVICE_ADD("printer", PRINTER)
665677MACHINE_DRIVER_END
666678
667679static MACHINE_DRIVER_START( tanodr64 )
r2353r2354
682694
683695   /* sound hardware */
684696   MDRV_IMPORT_FROM( coco_sound )
697
698   /* printer */
699   MDRV_DEVICE_ADD("printer", PRINTER)
685700MACHINE_DRIVER_END
686701
687702static MACHINE_DRIVER_START( coco )
r2353r2354
10921107}
10931108
10941109/*************************************
1095*
1096*   Dragon only devices
1097*
1098**************************************/
1099
1100static void dragon_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1101{
1102   /* printer port */
1103   switch(state)
1104   {
1105      /* --- the following bits of info are returned as 64-bit signed integers --- */
1106      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
1107
1108      default:                              printer_device_getinfo(devclass, state, info); break;
1109   }
1110}
1111
1112
1113
1114/*************************************
11151110 *
11161111 *  CoCo sysconfig structures
11171112 *
r2353r2354
11381133   CONFIG_DEVICE( coco_floppy_getinfo )
11391134   CONFIG_DEVICE( coco_cartslot_getinfo )
11401135   CONFIG_DEVICE( coco_snapshot_getinfo )
1141   CONFIG_DEVICE( dragon_printer_getinfo )
11421136SYSTEM_CONFIG_END
11431137
11441138
src/mess/drivers/pcw16.c
r2353r2354
14211421   MDRV_SPEAKER_STANDARD_MONO("mono")
14221422   MDRV_SOUND_ADD(BEEP, 0)
14231423   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1424
1425   /* printer */
1426   /* MDRV_DEVICE_ADD("printer", PRINTER) */
14241427MACHINE_DRIVER_END
14251428
14261429
r2353r2354
14441447   ROM_LOAD("pcw045.sys",0x10000, 524288, CRC(c642f498) SHA1(8a5c05de92e7b2c5acdfb038217503ad363285b5))
14451448ROM_END
14461449
1447#ifdef UNUSED_FUNCTION
1448static void pcw16_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1449{
1450   /* printer */
1451   switch(state)
1452   {
1453      /* --- the following bits of info are returned as 64-bit signed integers --- */
1454      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
1455
1456      default:                              printer_device_getinfo(devclass, state, info); break;
1457   }
1458}
1459#endif
1460
14611450static void pcw16_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
14621451{
14631452   /* floppy */
r2353r2354
14751464
14761465SYSTEM_CONFIG_START(pcw16)
14771466   CONFIG_RAM_DEFAULT(2048 * 1024)
1478   /*CONFIG_DEVICE(pcw16_printer_getinfo)*/
14791467   CONFIG_DEVICE(pcw16_floppy_getinfo)
14801468SYSTEM_CONFIG_END
14811469
src/mess/drivers/msx.c
r2353r2354
755755   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
756756   MDRV_SOUND_ADD(YM2413, 3579545)
757757   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
758
759   /* printer */
760   MDRV_DEVICE_ADD("printer", PRINTER)
758761MACHINE_DRIVER_END
759762
760763
r2353r2354
811814   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
812815
813816   MDRV_NVRAM_HANDLER( msx2 )
817
818   /* printer */
819   MDRV_DEVICE_ADD("printer", PRINTER)
814820MACHINE_DRIVER_END
815821
816822
r2353r2354
21872193   }
21882194}
21892195
2190static void msx_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
2191{
2192   /* printer */
2193   switch(state)
2194   {
2195      /* --- the following bits of info are returned as 64-bit signed integers --- */
2196      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
2197
2198      default:                              printer_device_getinfo(devclass, state, info); break;
2199   }
2200}
2201
22022196SYSTEM_CONFIG_START(msx)
22032197   CONFIG_DEVICE(msx_floppy_getinfo)
22042198   CONFIG_DEVICE(msx_cartslot_getinfo)
22052199   CONFIG_DEVICE(msx_cassette_getinfo)
2206   CONFIG_DEVICE(msx_printer_getinfo)
22072200SYSTEM_CONFIG_END
22082201
22092202MSX_DRIVER_LIST
src/mess/drivers/tmc600.c
r2353r2354
468468
469469   MDRV_SOUND_ADD(CDP1869, CDP1869_DOT_CLK_PAL)
470470   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
471
472   /* printer */
473   MDRV_DEVICE_ADD("printer", PRINTER)
474
471475MACHINE_DRIVER_END
472476
473477/* ROMs */
r2353r2354
535539   }
536540}
537541
538static void tmc600_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
539{
540   /* printer */
541   switch(state)
542   {
543      /* --- the following bits of info are returned as 64-bit signed integers --- */
544      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
545
546      default:                              printer_device_getinfo(devclass, state, info); break;
547   }
548}
549
550542static void tmc600_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
551543{
552544   /* quickload */
r2353r2354
568560   CONFIG_RAM         (24 * 1024)
569561   CONFIG_DEVICE(tmc600_cassette_getinfo)
570562   CONFIG_DEVICE(tmc600_floppy_getinfo)
571   CONFIG_DEVICE(tmc600_printer_getinfo)
572563   CONFIG_DEVICE(tmc600_quickload_getinfo)
573564SYSTEM_CONFIG_END
574565
src/mess/drivers/thomson.c
r2353r2354
245245}
246246
247247
248/* ------------ printer ------------ */
249
250static void thom_printer_getinfo ( const mess_device_class *devclass, UINT32 state, union devinfo *info )
251{
252   switch ( state ) {
253   case MESS_DEVINFO_INT_COUNT:
254      info->i = 1;
255      break;
256   default:
257      printer_device_getinfo( devclass, state, info );
258   }
259}
260
261
262248/* ------------ serial ------------ */
263249
264250static const char *const thom_serial_names[3][3]=
r2353r2354
715701     CONFIG_DEVICE ( to7_cartridge_getinfo )
716702     CONFIG_DEVICE ( to7_cassette_getinfo )
717703     CONFIG_DEVICE ( thom_floppy_getinfo )
718     CONFIG_DEVICE ( thom_printer_getinfo )
719704     CONFIG_DEVICE ( thom_serial_getinfo )
720705SYSTEM_CONFIG_END
721706
r2353r2354
770755     MDRV_SOUND_ADD ( DAC, 0 )
771756     MDRV_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.) /* speech synthesis */
772757
758    /* printer */
759    MDRV_DEVICE_ADD("printer", PRINTER)
760
773761MACHINE_DRIVER_END
774762
775763static MACHINE_DRIVER_START ( t9000 )
r2353r2354
11371125     CONFIG_DEVICE ( mo5_cartridge_getinfo )
11381126     CONFIG_DEVICE ( mo5_cassette_getinfo )
11391127     CONFIG_DEVICE ( thom_floppy_getinfo )
1140     CONFIG_DEVICE ( thom_printer_getinfo )
11411128     CONFIG_DEVICE ( thom_serial_getinfo )
11421129SYSTEM_CONFIG_END
11431130
src/mess/drivers/abc80.c
r2353r2354
482482   MDRV_SOUND_ADD(SN76477, 0)
483483   MDRV_SOUND_CONFIG(sn76477_interface)
484484   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
485
486   // printer device
487   MDRV_DEVICE_ADD("printer", PRINTER)
485488MACHINE_DRIVER_END
486489
487490/* ROMs */
r2353r2354
515518
516519/* System Configuration */
517520
518static void abc80_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
519{
520   /* printer */
521   switch(state)
522   {
523      /* --- the following bits of info are returned as 64-bit signed integers --- */
524      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
525
526      default:                              printer_device_getinfo(devclass, state, info); break;
527   }
528}
529
530521#if 0
531522static void abc80_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
532523{
r2353r2354
565556SYSTEM_CONFIG_START( abc80 )
566557   CONFIG_RAM_DEFAULT(16 * 1024)
567558   CONFIG_RAM        (32 * 1024)
568   CONFIG_DEVICE(abc80_printer_getinfo)
569559//  CONFIG_DEVICE(abc80_cassette_getinfo)
570560   CONFIG_DEVICE(abc80_floppy_getinfo)
571561SYSTEM_CONFIG_END
src/mess/drivers/atarist.c
r2353r2354
17971797   MDRV_SOUND_ADD(YM2149, Y2/16)
17981798   MDRV_SOUND_CONFIG(ym2149_interface)
17991799   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1800
1801   /* printer */
1802   MDRV_DEVICE_ADD("printer", PRINTER)
18001803MACHINE_DRIVER_END
18011804
18021805static MACHINE_DRIVER_START( megast )
r2353r2354
18471850    MDRV_SOUND_ROUTE(0, "right", 0.50)
18481851    MDRV_SOUND_ROUTE(1, "left", 0.50)
18491852*/
1853
1854   /* printer */
1855   MDRV_DEVICE_ADD("printer", PRINTER)
18501856MACHINE_DRIVER_END
18511857
18521858static MACHINE_DRIVER_START( megaste )
r2353r2354
18911897   MDRV_SOUND_ADD(YM3439, U517/8)
18921898   MDRV_SOUND_CONFIG(stbook_ym2149_interface)
18931899   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1900
1901   /* printer */
1902   MDRV_DEVICE_ADD("printer", PRINTER)
18941903MACHINE_DRIVER_END
18951904
18961905/* ROMs */
r2353r2354
20762085   }
20772086}
20782087
2079static void atarist_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
2080{
2081   /* printer */
2082   switch(state)
2083   {
2084      /* --- the following bits of info are returned as 64-bit signed integers --- */
2085      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
2086
2087      default:                              printer_device_getinfo(devclass, state, info); break;
2088   }
2089}
2090
20912088static DEVICE_IMAGE_LOAD( atarist_serial )
20922089{
20932090   /* filename specified */
r2353r2354
21872184   CONFIG_RAM        ( 512 * 1024) //  520ST
21882185   CONFIG_RAM        ( 256 * 1024) //  260ST
21892186   CONFIG_DEVICE(atarist_floppy_getinfo)
2190   CONFIG_DEVICE(atarist_printer_getinfo)
21912187   CONFIG_DEVICE(atarist_serial_getinfo)
21922188   CONFIG_DEVICE(atarist_cartslot_getinfo)
21932189   // MIDI
r2353r2354
21982194   CONFIG_RAM        (2048 * 1024) // Mega ST 2
21992195   CONFIG_RAM        (1024 * 1024) // Mega ST 1
22002196   CONFIG_DEVICE(atarist_floppy_getinfo)
2201   CONFIG_DEVICE(atarist_printer_getinfo)
22022197   CONFIG_DEVICE(atarist_serial_getinfo)
22032198   CONFIG_DEVICE(atarist_cartslot_getinfo)
22042199   // MIDI
r2353r2354
22082203   CONFIG_RAM_DEFAULT(1024 * 1024) // 1040STe
22092204   CONFIG_RAM        ( 512 * 1024) //  520STe
22102205   CONFIG_DEVICE(atarist_floppy_getinfo)
2211   CONFIG_DEVICE(atarist_printer_getinfo)
22122206   CONFIG_DEVICE(atarist_serial_getinfo)
22132207   CONFIG_DEVICE(atarist_cartslot_getinfo)
22142208   // MIDI
r2353r2354
22192213   CONFIG_RAM        (2048 * 1024) // Mega STe 2
22202214   CONFIG_RAM        (1024 * 1024) // Mega STe 1
22212215   CONFIG_DEVICE(atarist_floppy_getinfo)
2222   CONFIG_DEVICE(atarist_printer_getinfo)
22232216   CONFIG_DEVICE(megaste_serial_getinfo)
22242217   CONFIG_DEVICE(atarist_cartslot_getinfo)
22252218   // MIDI
r2353r2354
22302223   CONFIG_RAM_DEFAULT(4096 * 1024)
22312224   CONFIG_RAM        (1024 * 1024)
22322225   CONFIG_DEVICE(atarist_floppy_getinfo)
2233   CONFIG_DEVICE(atarist_printer_getinfo)
22342226   CONFIG_DEVICE(megaste_serial_getinfo)
22352227   CONFIG_DEVICE(atarist_cartslot_getinfo)
22362228   // MIDI
src/mess/drivers/sg1000.c
r2353r2354
598598   MDRV_SPEAKER_STANDARD_MONO("mono")
599599   MDRV_SOUND_ADD(SN76489, XTAL_10_738635MHz/3)
600600   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
601
602   /* printer */
603   MDRV_DEVICE_ADD("printer", PRINTER)
601604MACHINE_DRIVER_END
602605
603606static MACHINE_DRIVER_START( sf7000 )
r2353r2354
620623   MDRV_SPEAKER_STANDARD_MONO("mono")
621624   MDRV_SOUND_ADD(SN76489, XTAL_10_738635MHz/3)
622625   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
626
627   /* printer */
628   MDRV_DEVICE_ADD("printer1", PRINTER)
629   MDRV_DEVICE_ADD("printer2", PRINTER)
623630MACHINE_DRIVER_END
624631
625632/* ROMs */
r2353r2354
778785   }
779786}
780787
781static void sc3000_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
782{
783   switch(state)
784   {
785      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
786
787      default:                              printer_device_getinfo(devclass, state, info); break;
788   }
789}
790
791static void sf7000_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
792{
793   switch(state)
794   {
795      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
796
797      default:                              printer_device_getinfo(devclass, state, info); break;
798   }
799}
800
801788static DEVICE_IMAGE_LOAD( sf7000_floppy )
802789{
803790   if (image_has_been_created(image))
r2353r2354
877864SYSTEM_CONFIG_START( sc3000 )
878865   CONFIG_DEVICE(sc3000_cartslot_getinfo)
879866   CONFIG_DEVICE(sc3000_cassette_getinfo)
880   CONFIG_DEVICE(sc3000_printer_getinfo)
881867SYSTEM_CONFIG_END
882868
883869SYSTEM_CONFIG_START( sf7000 )
884870   CONFIG_RAM_DEFAULT   (64 * 1024)
885871   CONFIG_DEVICE(sc3000_cassette_getinfo)
886   CONFIG_DEVICE(sf7000_printer_getinfo)
887872   CONFIG_DEVICE(sf7000_floppy_getinfo)
888873   CONFIG_DEVICE(sf7000_serial_getinfo)
889874SYSTEM_CONFIG_END
src/mess/drivers/exidy.c
r2353r2354
527527   return data;
528528}
529529
530static const device_config *printer_device(running_machine *machine)
531{
532   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
533}
534
530535static READ8_HANDLER(exidy_ff_port_r)
531536{
532537   /* The use of the parallel port as a general purpose port is not emulated.
r2353r2354
539544   /* bit 7 = printer busy
540545   0 = printer is not busy */
541546
542   if (printer_status(image_from_devtype_and_index(IO_PRINTER, 0), 0)==0 )
547   if (printer_is_ready(printer_device(machine))==0 )
543548      data |= 0x080;
544549
545550   return data;
r2353r2354
743748   MDRV_SPEAKER_STANDARD_MONO("mono")
744749   MDRV_SOUND_ADD(SPEAKER, 0)
745750   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
751
752   /* printer */
753   MDRV_DEVICE_ADD("printer", PRINTER)
746754MACHINE_DRIVER_END
747755
748756static MACHINE_DRIVER_START( exidyd )
r2353r2354
849857   }
850858}
851859
852static void exidy_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
853{
854   /* printer */
855   switch(state)
856   {
857      /* --- the following bits of info are returned as 64-bit signed integers --- */
858      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
859
860      default:                              printer_device_getinfo(devclass, state, info); break;
861   }
862}
863
864860static void exidy_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
865861{
866862   /* floppy */
r2353r2354
892888}
893889
894890SYSTEM_CONFIG_START(exidy)
895   CONFIG_DEVICE(exidy_printer_getinfo)
896891   CONFIG_DEVICE(exidy_floppy_getinfo)
897892   CONFIG_DEVICE(cartslot_device_getinfo)
898893   CONFIG_DEVICE(exidy_cassette_getinfo)      // use of cassette causes a hang
r2353r2354
900895SYSTEM_CONFIG_END
901896
902897SYSTEM_CONFIG_START(exidyd)
903   CONFIG_DEVICE(exidy_printer_getinfo)
904898   CONFIG_DEVICE(cartslot_device_getinfo)
905899   CONFIG_DEVICE(exidy_cassette_getinfo)      // use of cassette causes a hang
906900   CONFIG_DEVICE(exidy_quickload_getinfo)
src/mess/drivers/bw2.c
r2353r2354
726726
727727   MDRV_DEVICE_ADD(MSM6255_TAG, MSM6255)
728728   MDRV_DEVICE_CONFIG(bw2_msm6255_intf)
729
730   /* printer */
731   MDRV_DEVICE_ADD("printer", PRINTER)
729732MACHINE_DRIVER_END
730733
731734/***************************************************************************
r2353r2354
745748   ROM_LOAD("ramcard-10.bin", 0x0000, 0x4000, CRC(68cde1ba) SHA1(a776a27d64f7b857565594beb63aa2cd692dcf04))
746749ROM_END
747750
748static void bw2_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
749{
750   /* printer */
751   switch(state)
752   {
753      /* --- the following bits of info are returned as 64-bit signed integers --- */
754      case MESS_DEVINFO_INT_COUNT:
755         info->i = 1;
756         break;
757
758      default:
759         printer_device_getinfo(devclass, state, info);
760         break;
761   }
762}
763
764751static void bw2_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
765752{
766753   /* floppy */
r2353r2354
828815}
829816
830817SYSTEM_CONFIG_START( bw2 )
831   CONFIG_DEVICE( bw2_printer_getinfo )
832818   CONFIG_DEVICE( bw2_floppy_getinfo )
833819   CONFIG_DEVICE( bw2_serial_getinfo )
834820   CONFIG_RAM_DEFAULT( 64 * 1024 )
src/mess/drivers/oric.c
r2353r2354
468468   MDRV_SOUND_ADD(AY8912, 1000000)
469469   MDRV_SOUND_CONFIG(oric_ay_interface)
470470   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
471
472   /* printer */
473   MDRV_DEVICE_ADD("printer", PRINTER)
471474MACHINE_DRIVER_END
472475
473476
r2353r2354
540543   }
541544}
542545
543static void oric_common_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
544{
545   /* printer */
546   switch(state)
547   {
548      /* --- the following bits of info are returned as 64-bit signed integers --- */
549      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
550
551      default:                              printer_device_getinfo(devclass, state, info); break;
552   }
553}
554
555546SYSTEM_CONFIG_START(oric_common)
556547   CONFIG_DEVICE(oric_common_cassette_getinfo)
557   CONFIG_DEVICE(oric_common_printer_getinfo)
558548SYSTEM_CONFIG_END
559549
560550static void oric1_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
src/mess/drivers/atom.c
r2353r2354
270270   MDRV_SPEAKER_STANDARD_MONO("mono")
271271   MDRV_SOUND_ADD(SPEAKER, 0)
272272   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
273
274   /* printer */
275   MDRV_DEVICE_ADD("printer", PRINTER)
273276MACHINE_DRIVER_END
274277
275278
r2353r2354
338341   }
339342}
340343
341static void atom_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
342{
343   /* printer */
344   switch(state)
345   {
346      /* --- the following bits of info are returned as 64-bit signed integers --- */
347      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
348
349      default:                              printer_device_getinfo(devclass, state, info); break;
350   }
351}
352
353344static void atom_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
354345{
355346   /* quickload */
r2353r2354
368359SYSTEM_CONFIG_START(atom)
369360   CONFIG_DEVICE(atom_cassette_getinfo)
370361   CONFIG_DEVICE(atom_floppy_getinfo)
371   CONFIG_DEVICE(atom_printer_getinfo)
372362   CONFIG_DEVICE(atom_quickload_getinfo)
373363SYSTEM_CONFIG_END
374364
src/mess/drivers/at.c
r2353r2354
489489#endif
490490
491491   MDRV_NVRAM_HANDLER( mc146818 )
492
493   /* printers */
494   MDRV_DEVICE_ADD("printer1", PRINTER)
495   MDRV_DEVICE_ADD("printer2", PRINTER)
496   MDRV_DEVICE_ADD("printer3", PRINTER)
492497MACHINE_DRIVER_END
493498
494499
r2353r2354
529534#endif
530535
531536   MDRV_NVRAM_HANDLER( mc146818 )
537
538   /* printers */
539   MDRV_DEVICE_ADD("printer1", PRINTER)
540   MDRV_DEVICE_ADD("printer2", PRINTER)
541   MDRV_DEVICE_ADD("printer3", PRINTER)
532542MACHINE_DRIVER_END
533543
534544
r2353r2354
574584   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
575585
576586   MDRV_NVRAM_HANDLER( mc146818 )
587
588   /* printers */
589   MDRV_DEVICE_ADD("printer1", PRINTER)
590   MDRV_DEVICE_ADD("printer2", PRINTER)
591   MDRV_DEVICE_ADD("printer3", PRINTER)
577592MACHINE_DRIVER_END
578593
579594
r2353r2354
616631   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
617632
618633   MDRV_NVRAM_HANDLER( mc146818 )
634
635   /* printers */
636   MDRV_DEVICE_ADD("printer1", PRINTER)
637   MDRV_DEVICE_ADD("printer2", PRINTER)
638   MDRV_DEVICE_ADD("printer3", PRINTER)
619639MACHINE_DRIVER_END
620640
621641
r2353r2354
744764    ROM_LOAD("cga.chr",     0x00000, 0x01000, CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd))
745765ROM_END
746766
747static void ibmat_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
748{
749   /* printer */
750   switch(state)
751   {
752      /* --- the following bits of info are returned as 64-bit signed integers --- */
753      case MESS_DEVINFO_INT_COUNT:                     info->i = 3; break;
754
755      default:                              printer_device_getinfo(devclass, state, info); break;
756   }
757}
758
759767static void ibmat_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
760768{
761769   /* floppy */
r2353r2354
785793
786794SYSTEM_CONFIG_START(ibmat)
787795   CONFIG_RAM_DEFAULT( (640+1024) * 1024 )
788   CONFIG_DEVICE(ibmat_printer_getinfo)
789796   CONFIG_DEVICE(ibmat_floppy_getinfo)
790797   CONFIG_DEVICE(ibmat_harddisk_getinfo)
791798SYSTEM_CONFIG_END
src/mess/drivers/abc80x.c
r2353r2354
797797   MDRV_MACHINE_START(abc800)
798798
799799   MDRV_IMPORT_FROM(abc800m_video)
800   MDRV_DEVICE_ADD("printer", PRINTER)
800801MACHINE_DRIVER_END
801802
802803static MACHINE_DRIVER_START( abc800c )
r2353r2354
814815   MDRV_MACHINE_START(abc800)
815816
816817   MDRV_IMPORT_FROM(abc800c_video)
818   MDRV_DEVICE_ADD("printer", PRINTER)
817819MACHINE_DRIVER_END
818820
819821static MACHINE_DRIVER_START( abc802 )
r2353r2354
832834   MDRV_MACHINE_RESET(abc802)
833835
834836   MDRV_IMPORT_FROM(abc802_video)
837   MDRV_DEVICE_ADD("printer", PRINTER)
835838MACHINE_DRIVER_END
836839
837840static MACHINE_DRIVER_START( abc806 )
r2353r2354
850853   MDRV_MACHINE_RESET(abc806)
851854
852855   MDRV_IMPORT_FROM(abc806_video)
856   MDRV_DEVICE_ADD("printer", PRINTER)
853857MACHINE_DRIVER_END
854858
855859/* ROMs */
r2353r2354
10301034   }
10311035}
10321036
1033static void abc800_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1034{
1035   /* printer */
1036   switch(state)
1037   {
1038      /* --- the following bits of info are returned as 64-bit signed integers --- */
1039      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
1040
1041      default:                              printer_device_getinfo(devclass, state, info); break;
1042   }
1043}
1044
10451037static DEVICE_IMAGE_LOAD( abc800_serial )
10461038{
10471039   /* filename specified */
r2353r2354
10841076   CONFIG_RAM_DEFAULT(16 * 1024)
10851077   CONFIG_RAM        (32 * 1024)
10861078   CONFIG_DEVICE(abc800_cassette_getinfo)
1087   CONFIG_DEVICE(abc800_printer_getinfo)
10881079   CONFIG_DEVICE(abc800_floppy_getinfo)
10891080   CONFIG_DEVICE(abc800_serial_getinfo)
10901081SYSTEM_CONFIG_END
r2353r2354
10921083SYSTEM_CONFIG_START( abc802 )
10931084   CONFIG_RAM_DEFAULT(64 * 1024)
10941085   CONFIG_DEVICE(abc800_cassette_getinfo)
1095   CONFIG_DEVICE(abc800_printer_getinfo)
10961086   CONFIG_DEVICE(abc800_floppy_getinfo)
10971087   CONFIG_DEVICE(abc800_serial_getinfo)
10981088SYSTEM_CONFIG_END
r2353r2354
11001090SYSTEM_CONFIG_START( abc806 )
11011091   CONFIG_RAM_DEFAULT(128 * 1024)
11021092   CONFIG_DEVICE(abc800_cassette_getinfo)
1103   CONFIG_DEVICE(abc800_printer_getinfo)
11041093   CONFIG_DEVICE(abc800_floppy_getinfo)
11051094   CONFIG_DEVICE(abc800_serial_getinfo)
11061095SYSTEM_CONFIG_END
src/mess/drivers/tmc2000e.c
r2353r2354
194194   MDRV_SPEAKER_STANDARD_MONO("mono")
195195   MDRV_SOUND_ADD(BEEP, 0)
196196   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
197
198   /* printer */
199   MDRV_DEVICE_ADD("printer", PRINTER)
200
197201MACHINE_DRIVER_END
198202
199203/* ROMs */
r2353r2354
238242   }
239243}
240244
241static void tmc2000e_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
242{
243   /* printer */
244   switch(state)
245   {
246      /* --- the following bits of info are returned as 64-bit signed integers --- */
247      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
248
249      default:                              printer_device_getinfo(devclass, state, info); break;
250   }
251}
252
253245SYSTEM_CONFIG_START( tmc2000e )
254246   CONFIG_RAM_DEFAULT   ( 8 * 1024)
255247   CONFIG_RAM         (40 * 1024)
256248   CONFIG_DEVICE(tmc2000e_cassette_getinfo)
257249   CONFIG_DEVICE(tmc2000e_floppy_getinfo)
258   CONFIG_DEVICE(tmc2000e_printer_getinfo)
259250SYSTEM_CONFIG_END
260251
261252/* Driver Initialization */
src/mess/drivers/mtx.c
r2353r2354
249249   MDRV_SPEAKER_STANDARD_MONO("mono")
250250   MDRV_SOUND_ADD(SN76489A, MTX_SYSTEM_CLOCK)
251251   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
252
253   /* printer */
254   MDRV_DEVICE_ADD("printer", PRINTER)
252255MACHINE_DRIVER_END
253256
254257
r2353r2354
286289 *
287290 *************************************/
288291
289static void mtx_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
290{
291   switch(state)
292   {
293      /* --- the following bits of info are returned as 64-bit signed integers --- */
294      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
295
296      default:                              printer_device_getinfo(devclass, state, info); break;
297   }
298}
299
300
301292static void mtx_snapshot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
302293{
303294   switch(state)
r2353r2354
318309
319310SYSTEM_CONFIG_START( mtx_common )
320311   CONFIG_DEVICE(mtx_snapshot_getinfo)
321   CONFIG_DEVICE(mtx_printer_getinfo)
322312   CONFIG_RAM(160 * 1024)
323313   CONFIG_RAM(192 * 1024)
324314   CONFIG_RAM(224 * 1024)
src/mess/drivers/einstein.c
r2353r2354
17391739   MDRV_SOUND_ADD(AY8910, 2000000)
17401740   MDRV_SOUND_CONFIG(einstein_ay_interface)
17411741   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
1742
1743   /* printer */
1744   MDRV_DEVICE_ADD("printer", PRINTER)
17421745MACHINE_DRIVER_END
17431746
17441747
r2353r2354
17781781   ROM_LOAD("charrom.rom",0x012000, 0x0800, NO_DUMP)
17791782ROM_END
17801783
1781static void einstein_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1782{
1783   /* printer */
1784   switch(state)
1785   {
1786      /* --- the following bits of info are returned as 64-bit signed integers --- */
1787      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
1788
1789      default:                              printer_device_getinfo(devclass, state, info); break;
1790   }
1791}
1792
17931784static void einstein_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
17941785{
17951786   /* floppy */
r2353r2354
18041795
18051796SYSTEM_CONFIG_START(einstein)
18061797   CONFIG_RAM_DEFAULT(65536)
1807   CONFIG_DEVICE(einstein_printer_getinfo)
18081798   CONFIG_DEVICE(einstein_floppy_getinfo)
18091799SYSTEM_CONFIG_END
18101800
src/mess/drivers/vtech1.c
r2353r2354
324324   MDRV_SOUND_ADD(SPEAKER, 0)
325325   MDRV_SOUND_CONFIG(speaker_interface)
326326   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
327
328   /* printer */
329   MDRV_DEVICE_ADD("printer", PRINTER)
327330MACHINE_DRIVER_END
328331
329332static MACHINE_DRIVER_START(laser200)
r2353r2354
459462   }
460463}
461464
462static void vtech1_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
463{
464   /* printer */
465   switch(state)
466   {
467      /* --- the following bits of info are returned as 64-bit signed integers --- */
468      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
469
470      default:                              printer_device_getinfo(devclass, state, info); break;
471   }
472}
473
474465static void vtech1_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
475466{
476467   /* cassette */
r2353r2354
537528   easily modified to work on another model. */
538529
539530SYSTEM_CONFIG_START(vtech1)
540    CONFIG_DEVICE(vtech1_printer_getinfo)
541531    CONFIG_DEVICE(cartslot_device_getinfo)
542532    CONFIG_DEVICE(vtech1_cassette_getinfo)
543533    CONFIG_DEVICE(vtech1_snapshot_getinfo)
src/mess/drivers/amstrad.c
r2353r2354
213213static void multiface_stop(running_machine *machine);
214214static int multiface_hardware_enabled(void);
215215static void multiface_reset(void);
216
217static const device_config *printer_device(running_machine *machine)
218{
219   return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer");
220}
221
222
223
216224/* ---------------------------------------
217225   - 27.05.2004 - PSG function selection -
218226   ---------------------------------------
r2353r2354
332340/* Set b6 with Parallel/Printer port ready */
333341   if(amstrad_system_type != SYSTEM_GX4000)
334342   {
335      if (printer_status(image_from_devtype_and_index(IO_PRINTER, 0), 0)==0 ) {
343      if (printer_is_ready(printer_device(machine))==0 ) {
336344         data |= (1<<6);
337345      }
338346   }
r2353r2354
29302938   MDRV_SOUND_ADD_TAG("ay", AY8912, 1000000)
29312939   MDRV_SOUND_CONFIG(ay8912_interface)
29322940   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
2941
2942   /* printer */
2943   MDRV_DEVICE_ADD("printer", PRINTER)
29332944MACHINE_DRIVER_END
29342945
29352946
r2353r2354
29732984
29742985   MDRV_PALETTE_LENGTH(4096+48)  // extended 12-bit palette, and standard 32 colour palette
29752986   MDRV_PALETTE_INIT(amstrad_plus)
2987
2988   /* printer not present in the gx4000 */
2989   MDRV_DEVICE_REMOVE("printer", PRINTER)
29762990MACHINE_DRIVER_END
29772991
29782992static MACHINE_DRIVER_START( aleste )
r2353r2354
31223136}
31233137
31243138
3125static void cpc6128_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
3126{
3127   /* printer */
3128   switch(state)
3129   {
3130      /* --- the following bits of info are returned as 64-bit signed integers --- */
3131      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
3132
3133      default:                              printer_device_getinfo(devclass, state, info); break;
3134   }
3135}
3136
3137
31383139static void cpcplus_cartslot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
31393140{
31403141   /* cartslot */
r2353r2354
31903191   CONFIG_RAM_DEFAULT(128 * 1024)
31913192   CONFIG_DEVICE(cpc6128_floppy_getinfo)
31923193   CONFIG_DEVICE(cpc6128_cassette_getinfo)
3193   CONFIG_DEVICE(cpc6128_printer_getinfo)
31943194SYSTEM_CONFIG_END
31953195
31963196
r2353r2354
32113211SYSTEM_CONFIG_START( aleste )
32123212   CONFIG_DEVICE(aleste_floppy_getinfo)
32133213   CONFIG_DEVICE(cpc6128_cassette_getinfo)
3214   CONFIG_DEVICE(cpc6128_printer_getinfo)
32153214   CONFIG_RAM_DEFAULT(2048 * 1024)  // has 2048k RAM
32163215SYSTEM_CONFIG_END
32173216
src/mess/drivers/svi318.c
r2353r2354
388388   MDRV_SOUND_ADD(AY8910, 1789773)
389389   MDRV_SOUND_CONFIG(ay8910_interface)
390390   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
391
392   /* printer */
393   MDRV_DEVICE_ADD("printer", PRINTER)
391394MACHINE_DRIVER_END
392395
393396static MACHINE_DRIVER_START( svi328n_806 )
r2353r2354
465468   ROMX_LOAD ("svi806se.rom", 0x0000, 0x1000, CRC(daea8956) SHA1(3f16d5513ad35692488ae7d864f660e76c6e8ed3), ROM_BIOS(2))
466469ROM_END
467470
468static void svi318_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
469{
470   /* printer */
471   switch(state)
472   {
473      /* --- the following bits of info are returned as 64-bit signed integers --- */
474      case MESS_DEVINFO_INT_COUNT:
475         info->i = 1;
476         break;
477
478      default:
479         printer_device_getinfo(devclass, state, info);
480         break;
481   }
482}
483
484471static void svi318_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
485472{
486473   /* cassette */
r2353r2354
561548}
562549
563550SYSTEM_CONFIG_START( svi318_common )
564   CONFIG_DEVICE(svi318_printer_getinfo)
565551   CONFIG_DEVICE(svi318_cassette_getinfo)
566552   CONFIG_DEVICE(svi318_cartslot_getinfo)
567553   CONFIG_DEVICE(svi318_floppy_getinfo)
src/mess/drivers/pc.c
r2353r2354
12011201   MDRV_SOUND_ADD(SAA1099, 4772720)
12021202   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
12031203#endif
1204
1205   /* printer */
1206   MDRV_DEVICE_ADD("printer", PRINTER)
12041207MACHINE_DRIVER_END
12051208
12061209
r2353r2354
12391242   MDRV_SOUND_ADD(SAA1099, 4772720)
12401243   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
12411244#endif
1245
1246   /* printer */
1247   MDRV_DEVICE_ADD("printer", PRINTER)
12421248MACHINE_DRIVER_END
12431249
12441250static MACHINE_DRIVER_START( pccga )
r2353r2354
12731279   MDRV_SOUND_ADD(SAA1099, 4772720)
12741280   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
12751281#endif
1282
1283   /* printer */
1284   MDRV_DEVICE_ADD("printer", PRINTER)
12761285MACHINE_DRIVER_END
12771286
12781287
r2353r2354
13041313#endif
13051314
13061315   MDRV_NVRAM_HANDLER( europc_rtc )
1316
1317   /* printer */
1318   MDRV_DEVICE_ADD("printer", PRINTER)
13071319MACHINE_DRIVER_END
13081320
13091321
r2353r2354
13391351   MDRV_SOUND_ADD(SAA1099, 4772720)
13401352   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
13411353#endif
1354
1355   /* printer */
1356   MDRV_DEVICE_ADD("printer", PRINTER)
13421357MACHINE_DRIVER_END
13431358
13441359
r2353r2354
13631378   MDRV_SOUND_ADD(CUSTOM, 0)
13641379   MDRV_SOUND_CONFIG(pc_sound_interface)
13651380   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1381
1382   /* printer */
1383   MDRV_DEVICE_ADD("printer", PRINTER)
13661384MACHINE_DRIVER_END
13671385
13681386
r2353r2354
13891407   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
13901408
13911409   MDRV_NVRAM_HANDLER( mc146818 )
1410
1411   /* printer */
1412   MDRV_DEVICE_ADD("printer", PRINTER)
13921413MACHINE_DRIVER_END
13931414
13941415
r2353r2354
14181439   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
14191440
14201441   MDRV_NVRAM_HANDLER( mc146818 )
1442
1443   /* printer */
1444   MDRV_DEVICE_ADD("printer", PRINTER)
14211445MACHINE_DRIVER_END
14221446
14231447
r2353r2354
14841508   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
14851509
14861510   MDRV_NVRAM_HANDLER( tandy1000 )
1511
1512   /* printer */
1513   MDRV_DEVICE_ADD("printer", PRINTER)
14871514MACHINE_DRIVER_END
14881515
14891516
r2353r2354
18901917   }
18911918}
18921919
1893static void ibmpc_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1894{
1895   /* printer */
1896   switch(state)
1897   {
1898      /* --- the following bits of info are returned as 64-bit signed integers --- */
1899      case MESS_DEVINFO_INT_COUNT:                     info->i = 3; break;
1900
1901      default:                              printer_device_getinfo(devclass, state, info); break;
1902   }
1903}
1904
19051920static void ibmpc_harddisk_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
19061921{
19071922   /* harddisk */
r2353r2354
19161931
19171932SYSTEM_CONFIG_START(ibmpc)
19181933   CONFIG_RAM_DEFAULT( 640 * 1024 )
1919   CONFIG_DEVICE(ibmpc_printer_getinfo)
19201934   CONFIG_DEVICE(ibmpc_cassette_getinfo)
19211935   CONFIG_DEVICE(ibmpc_floppy_getinfo)
19221936   CONFIG_DEVICE(ibmpc_harddisk_getinfo)
src/mess/drivers/bbc.c
r2353r2354
807807   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
808808
809809   MDRV_NVRAM_HANDLER( mc146818 )
810
811   /* printer */
812   MDRV_DEVICE_ADD("printer", PRINTER)
810813MACHINE_DRIVER_END
811814
812815static void bbc_cartslot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
r2353r2354
859862   }
860863}
861864
862static void bbc_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
863{
864   /* printer */
865   switch(state)
866   {
867      /* --- the following bits of info are returned as 64-bit signed integers --- */
868      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
869
870      default:                              printer_device_getinfo(devclass, state, info); break;
871   }
872}
873
874865SYSTEM_CONFIG_START(bbca)
875866   CONFIG_DEVICE(bbc_cassette_getinfo)
876   CONFIG_DEVICE(bbc_printer_getinfo)
877867SYSTEM_CONFIG_END
878868
879869
r2353r2354
881871   CONFIG_DEVICE(bbc_cartslot_getinfo)
882872   CONFIG_DEVICE(bbc_floppy_getinfo)
883873   CONFIG_DEVICE(bbc_cassette_getinfo)
884   CONFIG_DEVICE(bbc_printer_getinfo)
885874SYSTEM_CONFIG_END
886875
887876
src/mess/drivers/compis.c
r2353r2354
238238   MDRV_VIDEO_START(compis_gdc)
239239   MDRV_VIDEO_UPDATE(compis_gdc)
240240
241   /* printer */
242   MDRV_DEVICE_ADD("printer", PRINTER)
241243MACHINE_DRIVER_END
242244
243245/***************************************************************************
r2353r2354
251253     ROM_LOAD ("compis.rom", 0xf0000, 0x10000, CRC(89877688) SHA1(7daa1762f24e05472eafc025879da90fe61d0225))
252254ROM_END
253255
254static void compis_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
255{
256   /* printer */
257   switch(state)
258   {
259      /* --- the following bits of info are returned as 64-bit signed integers --- */
260      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
261
262      default:                              printer_device_getinfo(devclass, state, info); break;
263   }
264}
265
266256static void compis_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
267257{
268258   /* floppy */
r2353r2354
279269}
280270
281271SYSTEM_CONFIG_START(compis)
282   CONFIG_DEVICE(compis_printer_getinfo)
283272   CONFIG_DEVICE(compis_floppy_getinfo)
284273SYSTEM_CONFIG_END
285274
docs/messnew.txt
r2353r2354
7171
7272- Major changes to transition MESS's device system onto MAME's device system.
7373  [Nate Woods]
74 
75- Converted printers to the new device system.  [Nate Woods]
7476
7577
7678

Previous 15994 Revisions Next


© 1998-2018 The MESS Team