Previous 15994 Revisions Next

r4287 Thursday 19th February, 2009 at 09:24:29 UTC by Dirk Best
New PC LPT device, removed old implementations of centronics and the LPT, updated remaining drivers to use the new devices
[docs]messnew.txt
[src/mess]mess.mak
[src/mess/drivers]at.c ip22.c pc.c pcw16.c
[src/mess/includes]pclpt.h
[src/mess/machine]amstr_pc.c centroni.c centroni.h ctronics.c pc.c pc_lpt.c* pc_lpt.h* pclpt.c

src/mess/includes/pclpt.h
r4286r4287
1/*****************************************************************************
2 *
3 * includes/pclpt.h
4 *
5 ****************************************************************************/
6
7#ifndef PCLPT_H_
8#define PCLPT_H_
9
10#include "machine/centroni.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16
17/*----------- defined in machine/pclpt.c -----------*/
18
19typedef enum {
20   LPT_UNIDIRECTIONAL
21//  , LPT_BIDIRECTIONAL
22// epp, ecp
23} LPT_TYPE;
24
25typedef struct {
26   int on;
27   LPT_TYPE type;
28   void (*irq)(int nr, int level);
29   // dma for ecp
30} PC_LPT_CONFIG;
31
32void pc_lpt_config(int nr, const PC_LPT_CONFIG *config);
33
34void pc_lpt_set_device(int nr, const CENTRONICS_DEVICE *device);
35
36/* line definitions in centroni.h */
37/* only those lines in mask are modified */
38void pc_lpt_handshake_in(running_machine *machine,int nr, int data, int mask);
39
40READ8_HANDLER ( pc_parallelport0_r );
41READ8_HANDLER ( pc_parallelport1_r );
42READ8_HANDLER ( pc_parallelport2_r );
43WRITE8_HANDLER( pc_parallelport0_w );
44WRITE8_HANDLER( pc_parallelport1_w );
45WRITE8_HANDLER( pc_parallelport2_w );
46
47READ16_HANDLER ( pc16le_parallelport0_r );
48READ16_HANDLER ( pc16le_parallelport1_r );
49READ16_HANDLER ( pc16le_parallelport2_r );
50WRITE16_HANDLER( pc16le_parallelport0_w );
51WRITE16_HANDLER( pc16le_parallelport1_w );
52WRITE16_HANDLER( pc16le_parallelport2_w );
53
54READ32_HANDLER ( pc32le_parallelport0_r );
55READ32_HANDLER ( pc32le_parallelport1_r );
56READ32_HANDLER ( pc32le_parallelport2_r );
57WRITE32_HANDLER( pc32le_parallelport0_w );
58WRITE32_HANDLER( pc32le_parallelport1_w );
59WRITE32_HANDLER( pc32le_parallelport2_w );
60
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* PCLPT_H_ */
src/mess/machine/pclpt.c
r4286r4287
1/*
2  pc parallel port/centronics interface
3
4  started as some ttl's, is now available on several multi io chips
5*/
6
7
8#include "driver.h"
9#include "memconv.h"
10#include "includes/pclpt.h"
11#include "machine/centroni.h"
12
13
14#define LOG(LEVEL,N,M,A)  \
15   do { \
16      if( M ) \
17         logerror("%11.6f: %-24s",attotime_to_double(timer_get_time(machine)),(char*)M ); \
18      logerror A; \
19   } while (0)
20
21
22#define VERBOSE_LPT 1
23
24#define LPT_LOG(n,m,a) LOG(VERBOSE_LPT,n,m,a)
25
26#define STATUS_NOT_BUSY 0x80
27#define STATUS_ACKNOWLEDGE 0x40
28#define STATUS_NO_PAPER 0x20
29#define STATUS_ONLINE 0x10
30#define STATUS_NO_ERROR 8
31
32#define CONTROL_SELECT 8
33#define CONTROL_NO_RESET 4
34#define CONTROL_AUTOLINEFEED 2
35#define CONTROL_STROBE 1
36#define CONTROL_IRQ 0x10
37
38typedef struct {
39   const CENTRONICS_DEVICE *device;
40   const PC_LPT_CONFIG *config;
41   int on;
42   UINT8 data;
43   UINT8 status;
44   UINT8 control;
45} PC_LPT;
46static PC_LPT LPT[3]= {
47   { 0 }
48};
49
50void pc_lpt_config(int nr, const PC_LPT_CONFIG *config)
51{
52   PC_LPT *This=LPT+nr;
53   This->config=config;
54}
55
56void pc_lpt_set_device(int nr, const CENTRONICS_DEVICE *device)
57{
58   PC_LPT *This=LPT+nr;
59   This->device=device;
60}
61
62static void pc_LPT_w(running_machine *machine, int n, int offset, int data)
63{
64   PC_LPT *This=LPT+n;
65   if ( !(input_port_read(machine, "DSW1") & (0x08>>n)) ) return;
66//   if (!This->on) return;
67   switch( offset )
68   {
69      case 0:
70         if (This->device->write_data)
71            This->device->write_data(machine, n, data);
72         This->data = data;
73         LPT_LOG(1,"LPT_data_w",("LPT%d $%02x\n", n, data));
74         break;
75      case 1:
76         LPT_LOG(1,"LPT_status_w",("LPT%d $%02x\n", n, data));
77         break;
78      case 2:
79         This->control = data;
80         LPT_LOG(1,"LPT_control_w",("%d $%02x\n", n, data));
81         if (This->device->handshake_out) {
82            int lines=0;
83            if (data&CONTROL_SELECT) lines|=CENTRONICS_SELECT;
84            if (data&CONTROL_NO_RESET) lines|=CENTRONICS_NO_RESET;
85            if (data&CONTROL_AUTOLINEFEED) lines|=CENTRONICS_AUTOLINEFEED;
86            if (data&CONTROL_STROBE) lines|=CENTRONICS_STROBE;
87            This->device->handshake_out(machine, n, lines, CENTRONICS_SELECT
88                                 |CENTRONICS_NO_RESET
89                                 |CENTRONICS_AUTOLINEFEED
90                                 |CENTRONICS_STROBE);
91         }
92         break;
93    }
94}
95
96static int pc_LPT_r(running_machine *machine, int n, int offset)
97{
98   PC_LPT *This=LPT+n;
99    int data = 0xff;
100   if ( !(input_port_read(machine, "DSW1") & (0x08>>n)) ) return data;
101//   if (!This->on) return data;
102   switch( offset )
103   {
104      case 0:
105         if (This->device->read_data)
106            data=This->device->read_data(machine,n);
107         else
108            data = This->data;
109         LPT_LOG(1,"LPT_data_r",("LPT%d $%02x\n", n, data));
110         break;
111      case 1:
112         if (This->device&&This->device->handshake_in) {
113            int lines=This->device->handshake_in(machine,n);
114            data=0;
115            if (lines&CENTRONICS_NOT_BUSY) data|=STATUS_NOT_BUSY;
116            if (lines&CENTRONICS_ACKNOWLEDGE) data|=STATUS_ACKNOWLEDGE;
117            if (lines&CENTRONICS_NO_PAPER) data|=STATUS_NO_PAPER;
118            if (lines&CENTRONICS_ONLINE) data|=STATUS_ONLINE;
119            if (lines&CENTRONICS_NO_ERROR) data|=STATUS_NO_ERROR;
120         } else {
121            data=0x9c;
122
123#if 0
124            /* set status 'out of paper', '*no* error', 'IRQ has *not* occured' */
125            LPT[n].status = 0x09c;   //0x2c;
126
127#endif
128         }
129         data|=0x4; //?
130
131         LPT_LOG(1,"LPT_status_r",("%d $%02x\n", n, data));
132         break;
133      case 2:
134//         This->control = 0x0c; //?
135         data = This->control;
136         LPT_LOG(1,"LPT_control_r",("%d $%02x\n", n, data));
137         break;
138    }
139   return data;
140}
141
142void pc_lpt_handshake_in(running_machine *machine,int nr, int data, int mask)
143{
144   PC_LPT *This=LPT+nr;
145   int neu=(data&mask)|(This->status&~mask);
146
147   if (!(This->control&CONTROL_IRQ) &&
148      !(This->status&STATUS_ACKNOWLEDGE)&&
149      (neu&CENTRONICS_ACKNOWLEDGE)) {
150      if (This->config->irq)
151         This->config->irq(nr, PULSE_LINE);
152   }
153   This->status=neu;
154}
155
156READ8_HANDLER ( pc_parallelport0_r) { return pc_LPT_r(space->machine, 0, offset); }
157READ8_HANDLER ( pc_parallelport1_r) { return pc_LPT_r(space->machine, 1, offset); }
158READ8_HANDLER ( pc_parallelport2_r) { return pc_LPT_r(space->machine, 2, offset); }
159WRITE8_HANDLER ( pc_parallelport0_w ) { pc_LPT_w(space->machine, 0, offset, data); }
160WRITE8_HANDLER ( pc_parallelport1_w ) { pc_LPT_w(space->machine, 1, offset, data); }
161WRITE8_HANDLER ( pc_parallelport2_w ) { pc_LPT_w(space->machine, 2, offset, data); }
162
163READ16_HANDLER ( pc16le_parallelport0_r ) { return read16le_with_read8_handler(pc_parallelport0_r, space, offset, mem_mask); }
164READ16_HANDLER ( pc16le_parallelport1_r ) { return read16le_with_read8_handler(pc_parallelport1_r, space, offset, mem_mask); }
165READ16_HANDLER ( pc16le_parallelport2_r ) { return read16le_with_read8_handler(pc_parallelport2_r, space, offset, mem_mask); }
166WRITE16_HANDLER( pc16le_parallelport0_w ) { write16le_with_write8_handler(pc_parallelport0_w, space, offset, data, mem_mask); }
167WRITE16_HANDLER( pc16le_parallelport1_w ) { write16le_with_write8_handler(pc_parallelport1_w, space, offset, data, mem_mask); }
168WRITE16_HANDLER( pc16le_parallelport2_w ) { write16le_with_write8_handler(pc_parallelport2_w, space, offset, data, mem_mask); }
169
170READ32_HANDLER ( pc32le_parallelport0_r ) { return read32le_with_read8_handler(pc_parallelport0_r, space, offset, mem_mask); }
171READ32_HANDLER ( pc32le_parallelport1_r ) { return read32le_with_read8_handler(pc_parallelport1_r, space, offset, mem_mask); }
172READ32_HANDLER ( pc32le_parallelport2_r ) { return read32le_with_read8_handler(pc_parallelport2_r, space, offset, mem_mask); }
173WRITE32_HANDLER( pc32le_parallelport0_w ) { write32le_with_write8_handler(pc_parallelport0_w, space, offset, data, mem_mask); }
174WRITE32_HANDLER( pc32le_parallelport1_w ) { write32le_with_write8_handler(pc_parallelport1_w, space, offset, data, mem_mask); }
175WRITE32_HANDLER( pc32le_parallelport2_w ) { write32le_with_write8_handler(pc_parallelport2_w, space, offset, data, mem_mask); }
src/mess/machine/centroni.c
r4286r4287
1/*
2  defines centronics/parallel port printer interface
3
4  provides a centronics printer simulation (sends output to IO_PRINTER)
5*/
6
7#include "driver.h"
8#include "centroni.h"
9#include "devices/printer.h"
10
11typedef struct {
12   const CENTRONICS_CONFIG *config;
13   UINT8 data;
14   UINT8 control;
15   double time_;
16   emu_timer *timer;
17
18   /* These bytes are used in the timer callback. When the timer callback
19   is executed, the control value is updated with the new data. The mask
20   defines the bits that are changing, and the data is the new data */
21   /* The user defined callback in CENTRONICS_CONFIG is called with the
22   change. This allows systems that have interrupts triggered from the centronics
23   interface to function correctly. e.g. Amstrad NC100 */
24   /* mask of data to set in timer callback */
25   UINT8 new_control_mask;
26   /* data to set in timer callback */
27   UINT8 new_control_data;
28} CENTRONICS;
29
30static CENTRONICS cent[3]={
31   { 0,0,0, 0.0 },
32   { 0,0,0, 0.0 },
33   { 0,0,0, 0.0 }
34};
35
36static TIMER_CALLBACK(centronics_timer_callback);
37
38void centronics_config(running_machine *machine,int nr, const CENTRONICS_CONFIG *config)
39{
40   CENTRONICS *This=cent+nr;
41   This->config=config;
42   This->timer = timer_alloc(machine, centronics_timer_callback, NULL);
43}
44
45void centronics_write_data(running_machine *machine,int nr, UINT8 data)
46{
47   CENTRONICS *This=cent+nr;
48   This->data=data;
49}
50
51UINT8 centronics_read_data(running_machine *machine,int nr)
52{
53   CENTRONICS *This=cent+nr;
54   return This->data;
55}
56
57/* execute user callback in CENTRONICS_CONFIG when state of control from printer
58has changed */
59static TIMER_CALLBACK(centronics_timer_callback)
60{
61   int nr = param;
62   CENTRONICS *This = cent + nr;
63
64   /* update control state */
65   This->control &=~This->new_control_mask;
66   This->control |=This->new_control_data;
67
68   /* if callback is specified, call it with the new state of the outputs from the printer */
69   if (This->config->handshake_out)
70      This->config->handshake_out(machine, nr, This->control, This->new_control_mask);
71
72   /* phase 2: schedule ack end */
73   if ( This->control & CENTRONICS_ACKNOWLEDGE )
74   {
75      This->new_control_mask = CENTRONICS_ACKNOWLEDGE;
76      This->new_control_data = 0;
77      timer_adjust_oneshot(This->timer, ATTOTIME_IN_USEC(2), nr);
78   }
79   /* phase 3: end */
80   else if ( This->control & CENTRONICS_NOT_BUSY )
81   {
82      timer_adjust_oneshot(This->timer, attotime_never, nr);
83   }
84   /* phase 1: schedule not busy & ack */
85   else
86   {
87      This->new_control_mask = CENTRONICS_NOT_BUSY | CENTRONICS_ACKNOWLEDGE;
88      This->new_control_data = CENTRONICS_NOT_BUSY | CENTRONICS_ACKNOWLEDGE;
89      timer_adjust_oneshot(This->timer, ATTOTIME_IN_USEC(15), nr);
90   }
91}
92
93static const device_config *printer_device(running_machine *machine, int index)
94{
95   const char *tag;
96   switch(index)
97   {
98      case 0:   
99         tag = "printer";
100         break;
101      case 1:   
102         tag = "printer1";
103         break;
104      case 2:   
105         tag = "printer2";
106         break;
107      case 3:   
108         tag = "printer3";
109         break;
110      default:
111         fatalerror("\nInvalid centronics device: %X",index);
112         break;
113   }
114   return devtag_get_device(machine, PRINTER, tag);
115}
116
117void centronics_write_handshake(running_machine *machine,int nr, int data, int mask)
118{
119   CENTRONICS *This=cent+nr;
120   const device_config *device;
121
122   int neu=(data&mask)|(This->control&(~mask));
123
124   if (neu & CENTRONICS_NO_RESET)
125   {
126     /* strobe down */
127     if ( (This->control&CENTRONICS_STROBE) && !(neu&CENTRONICS_STROBE) )
128     {
129         /* schedule busy */
130         This->new_control_mask = CENTRONICS_NOT_BUSY;
131         This->new_control_data = 0;
132         timer_adjust_oneshot(This->timer, ATTOTIME_IN_USEC(5), nr);
133
134         /* output */
135         device = printer_device(machine, nr);
136         if (device != NULL)
137            printer_output(device, This->data);
138      }
139
140   }
141   This->control=neu;
142}
143
144int centronics_read_handshake(running_machine *machine,int nr)
145{
146   CENTRONICS *This=cent+nr;
147   UINT8 data=0;
148   const device_config *device;
149
150   /* state of busy */
151   data |= (This->control & CENTRONICS_NOT_BUSY);
152
153   if (This->config->type == PRINTER_IBM)
154      data |= CENTRONICS_ONLINE;
155   else
156   {
157      if (This->control & CENTRONICS_SELECT)
158         data |= CENTRONICS_ONLINE;
159   }
160
161   data |= CENTRONICS_NO_ERROR;
162
163   device = printer_device(machine, nr);
164   if ((device == NULL) || !printer_is_ready(device))
165      data |= CENTRONICS_NO_PAPER;
166
167   /* state of acknowledge */
168   data |= (This->control & CENTRONICS_ACKNOWLEDGE);
169
170   return data;
171}
172
173const CENTRONICS_DEVICE CENTRONICS_PRINTER_DEVICE= {
174   NULL,
175   centronics_write_data,
176   centronics_read_handshake,
177   centronics_write_handshake
178};
179
src/mess/machine/centroni.h
r4286r4287
1/*****************************************************************************
2 *
3 * machine/centroni.h
4 *
5 * Defines centronics/parallel port printer interface
6 * Provides a centronics printer simulation (sends output to IO_PRINTER)
7 *
8 ****************************************************************************/
9
10#ifndef CENTRONICS_H_
11#define CENTRONICS_H_
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17
18typedef enum {
19   PRINTER_CENTRONICS,
20   PRINTER_IBM // select line not important
21} PRINTER_TYPE;
22
23typedef struct {
24   UINT8 (*read_data)(running_machine *machine,int nr);
25   void (*write_data)(running_machine *machine,int nr, UINT8 data);
26   int (*handshake_in)(running_machine *machine,int nr);
27   void (*handshake_out)(running_machine *machine,int nr, int data, int mask);
28} CENTRONICS_DEVICE;
29
30
31// from printer
32#define CENTRONICS_NOT_BUSY 0x80
33#define CENTRONICS_ACKNOWLEDGE 0x40
34#define CENTRONICS_NO_PAPER 0x20
35#define CENTRONICS_ONLINE 0x10
36#define CENTRONICS_NO_ERROR 8
37
38// to printer
39#define CENTRONICS_SELECT 8
40#define CENTRONICS_NO_RESET 4
41#define CENTRONICS_AUTOLINEFEED 2
42#define CENTRONICS_STROBE 1
43
44typedef struct {
45   PRINTER_TYPE type;
46   void (*handshake_out)(running_machine *machine,int n, int data, int mask);
47} CENTRONICS_CONFIG;
48
49
50/*----------- defined in machine/centroni.c -----------*/
51
52void centronics_config(running_machine *machine,int nr, const CENTRONICS_CONFIG *config);
53
54void centronics_write_data(running_machine *machine,int nr, UINT8 data);
55void centronics_write_handshake(running_machine *machine,int nr, int data, int mask);
56UINT8 centronics_read_data(running_machine *machine,int nr);
57int centronics_read_handshake(running_machine *machine,int nr);
58
59extern const CENTRONICS_DEVICE CENTRONICS_PRINTER_DEVICE;
60
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* CENTRONI_H_ */
src/mess/machine/amstr_pc.c
r4286r4287
11#include "driver.h"
22
33#include "machine/pit8253.h"
4#include "machine/pc_lpt.h"
45#include "machine/pcshare.h"
56#include "includes/amstr_pc.h"
6#include "includes/pclpt.h"
77#include "includes/pc.h"
88#include "video/pc_vga.h"
99#include "memconv.h"
r4286r4287
199199   return data;
200200}
201201
202 READ8_HANDLER( pc200_port378_r )
202READ8_HANDLER( pc200_port378_r )
203203{
204   int data=pc_parallelport1_r(space, offset);
205   if (offset == 1)
204   const device_config *lpt = devtag_get_device(space->machine, PC_LPT, "lpt_2");
205   UINT8 data = pc_lpt_r(lpt, offset);
206
207   if (offset == 1)
206208      data = (data & ~7) | (input_port_read(space->machine, "DSW0") & 7);
207   if (offset == 2)
209   if (offset == 2)
208210      data = (data & ~0xe0) | (input_port_read(space->machine, "DSW0") & 0xc0);
211
209212   return data;
210213}
211214
212215
213 READ8_HANDLER( pc1640_port378_r )
216READ8_HANDLER( pc1640_port378_r )
214217{
215   int data=pc_parallelport1_r(space, offset);
216   if (offset == 1)
218    const device_config *lpt = devtag_get_device(space->machine, PC_LPT, "lpt_1");
219    UINT8 data = pc_lpt_r(lpt, offset);
220
221   if (offset == 1)
217222      data=(data & ~7) | (input_port_read(space->machine, "DSW0") & 7);
218   if (offset == 2)
223   if (offset == 2)
219224   {
220      switch (pc1640.dipstate)
225      switch (pc1640.dipstate)
221226      {
222227      case 0:
223228         data = (data&~0xe0) | (input_port_read(space->machine, "DSW0") & 0xe0);
src/mess/machine/ctronics.c
r4286r4287
179179      /* data is now ready, output it */
180180      printer_output(centronics->printer, centronics->data);
181181
182      /* timer to return BUSY to low, 5us max */
183      timer_set(machine, ATTOTIME_IN_USEC(5), ptr, FALSE, busy_callback);
182      /* ready to receive more data, return BUSY to low */
183      timer_set(machine, ATTOTIME_IN_USEC(7), ptr, FALSE, busy_callback);
184184   }
185185}
186186
r4286r4287
197197   if (param == TRUE)
198198   {
199199      /* timer to turn ACK low to receive data */
200      timer_set(machine, ATTOTIME_IN_USEC(1), ptr, FALSE, ack_callback);
200      timer_set(machine, ATTOTIME_IN_USEC(10), ptr, FALSE, ack_callback);
201201   }
202202   else
203203   {
204      /* timer to return ACK to high state, 5us max */
204      /* timer to return ACK to high state */
205205      timer_set(machine, ATTOTIME_IN_USEC(5), ptr, TRUE, ack_callback);
206206   }
207207}
r4286r4287
271271   if (centronics->strobe == TRUE && state == FALSE && centronics->busy == FALSE)
272272   {
273273      /* STROBE has gone low, data is ready */
274      timer_set(device->machine, ATTOTIME_IN_USEC(1), centronics, TRUE, busy_callback);
274      timer_set(device->machine, attotime_zero, centronics, TRUE, busy_callback);
275275   }
276276
277277   centronics->strobe = state;
src/mess/machine/pc_lpt.c
r0r4287
1/***************************************************************************
2 
3    IBM-PC printer interface
4 
5***************************************************************************/
6 
7#include "driver.h"
8#include "pc_lpt.h"
9 
10 
11/***************************************************************************
12    FUNCTION PROTOTYPES
13***************************************************************************/
14 
15static WRITE_LINE_DEVICE_HANDLER( pc_lpt_ack_w );
16 
17 
18/***************************************************************************
19    TYPE DEFINITIONS
20***************************************************************************/
21 
22typedef struct _pc_lpt_state pc_lpt_state;
23struct _pc_lpt_state
24{
25   const device_config *centronics;
26 
27   devcb_resolved_write_line out_irq_func;
28 
29   int ack;
30 
31   /* control latch */
32   int strobe;
33   int autofd;
34   int init;
35   int select;
36   int irq_enabled;
37};
38 
39 
40/***************************************************************************
41    CENTRONICS INTERFACE
42***************************************************************************/
43 
44const centronics_interface pc_centronics_config =
45{
46   TRUE,
47   DEVCB_LINE(pc_lpt_ack_w),
48   DEVCB_NULL,
49   DEVCB_NULL
50};
51 
52 
53/*****************************************************************************
54    INLINE FUNCTIONS
55*****************************************************************************/
56 
57INLINE pc_lpt_state *get_safe_token(const device_config *device)
58{
59   assert(device != NULL);
60   assert(device->token != NULL);
61   assert(device->type == PC_LPT);
62 
63   return (pc_lpt_state *)device->token;
64}
65 
66 
67/***************************************************************************
68    DEVICE INTERFACE
69***************************************************************************/
70 
71static DEVICE_START( pc_lpt )
72{
73   pc_lpt_state *lpt = get_safe_token(device);
74   const pc_lpt_interface *intf = device->static_config;
75 
76   /* validate some basic stuff */
77   assert(device->static_config != NULL);
78 
79   /* get centronics device */
80   lpt->centronics = devtag_get_device(device->machine, CENTRONICS, device->tag);
81   assert(lpt->centronics != NULL);
82 
83   /* make sure it's running */
84   if (!lpt->centronics->started)
85   {
86      device_delay_init(device);
87      return;
88   }
89 
90   /* resolve callbacks */
91   devcb_resolve_write_line(&lpt->out_irq_func, &intf->out_irq_func, device);
92 
93   /* register for state saving */
94   state_save_register_device_item(device, 0, lpt->ack);
95}
96 
97static DEVICE_RESET( pc_lpt )
98{
99   pc_lpt_state *lpt = get_safe_token(device);
100 
101   lpt->strobe = TRUE;
102   lpt->autofd = TRUE;
103   lpt->init = FALSE;
104   lpt->select = TRUE;
105   lpt->irq_enabled = FALSE;
106}
107 
108static DEVICE_SET_INFO( pc_lpt )
109{
110   switch (state)
111   {
112      /* no parameters to set */
113   }
114}
115 
116DEVICE_GET_INFO( pc_lpt )
117{
118   switch (state)
119   {
120      /* --- the following bits of info are returned as 64-bit signed integers --- */
121      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(pc_lpt_state);         break;
122      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = 0;                     break;
123      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;      break;
124 
125      /* --- the following bits of info are returned as pointers to data or functions --- */
126      case DEVINFO_FCT_SET_INFO:            info->set_info = DEVICE_SET_INFO_NAME( pc_lpt );   break;
127      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME( pc_lpt );         break;
128      case DEVINFO_FCT_STOP:               /* Nothing */                              break;
129      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME( pc_lpt );         break;
130 
131      /* --- the following bits of info are returned as NULL-terminated strings --- */
132      case DEVINFO_STR_NAME:               strcpy(info->s, "PC-LPT");            break;
133      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Parallel port");      break;
134      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");               break;
135      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);            break;
136      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MESS Team");   break;
137   }
138}
139 
140 
141/***************************************************************************
142    IMPLEMENTATION
143***************************************************************************/
144 
145static WRITE_LINE_DEVICE_HANDLER( pc_lpt_ack_w )
146{
147   const device_config *lpt_device = devtag_get_device(device->machine, PC_LPT, device->tag);
148   pc_lpt_state *lpt = get_safe_token(lpt_device);
149 
150   if (lpt->irq_enabled && lpt->ack == TRUE && state == FALSE)
151   {
152      /* pulse irq when going from high to low */
153      devcb_call_write_line(&lpt->out_irq_func, TRUE);
154      devcb_call_write_line(&lpt->out_irq_func, FALSE);
155   }
156 
157   lpt->ack = state;
158}
159 
160 
161READ8_DEVICE_HANDLER( pc_lpt_data_r )
162{
163   pc_lpt_state *lpt = get_safe_token(device);
164   return centronics_data_r(lpt->centronics, 0);
165}
166 
167 
168WRITE8_DEVICE_HANDLER( pc_lpt_data_w )
169{
170   pc_lpt_state *lpt = get_safe_token(device);
171   centronics_data_w(lpt->centronics, 0, data);
172}
173 
174 
175READ8_DEVICE_HANDLER( pc_lpt_status_r )
176{
177   pc_lpt_state *lpt = get_safe_token(device);
178   UINT8 result = 0;
179 
180   result |= centronics_fault_r(lpt->centronics) << 3;
181   result |= 1 << 4; /* select */
182   result |= !centronics_pe_r(lpt->centronics) << 5;
183   result |= centronics_ack_r(lpt->centronics) << 6;
184   result |= !centronics_busy_r(lpt->centronics) << 7;
185 
186   return result;
187}
188 
189 
190READ8_DEVICE_HANDLER( pc_lpt_control_r )
191{
192   pc_lpt_state *lpt = get_safe_token(device);
193   UINT8 result = 0;
194 
195   /* return latch state */
196   result |= lpt->strobe << 0;
197   result |= lpt->autofd << 1;
198   result |= lpt->init << 2;
199   result |= lpt->select << 3;
200   result |= lpt->irq_enabled << 4;
201 
202   return result;
203}
204 
205 
206WRITE8_DEVICE_HANDLER( pc_lpt_control_w )
207{
208   pc_lpt_state *lpt = get_safe_token(device);
209 
210   logerror("pc_lpt_control_w: 0x%02x\n", data);
211 
212   /* save to latch */
213   lpt->strobe = BIT(data, 0);
214   lpt->autofd = BIT(data, 1);
215   lpt->init = BIT(data, 2);
216   lpt->select = BIT(data, 3);
217   lpt->irq_enabled = BIT(data, 4);
218 
219   /* output to centronics */
220   centronics_strobe_w(lpt->centronics, lpt->strobe);
221   centronics_autofeed_w(lpt->centronics, lpt->autofd);
222   centronics_init_w(lpt->centronics, lpt->init);
223}
224 
225 
226READ8_DEVICE_HANDLER( pc_lpt_r )
227{
228   switch (offset)
229   {
230   case 0: return pc_lpt_data_r(device, 0); break;
231   case 1: return pc_lpt_status_r(device, 0); break;
232   case 2: return pc_lpt_control_r(device, 0); break;
233   }
234 
235   /* if we reach this its an error */
236   logerror("PC-LPT %s: Read from invalid offset %x\n", device->tag, offset);
237 
238   return 0xff;
239}
240 
241 
242WRITE8_DEVICE_HANDLER( pc_lpt_w )
243{
244   switch (offset)
245   {
246   case 0: pc_lpt_data_w(device, 0, data); break;
247   case 1: break;
248   case 2:   pc_lpt_control_w(device, 0, data); break;
249   }
250}
src/mess/machine/pc_lpt.h
r0r4287
1/***************************************************************************
2 
3    IBM-PC printer interface
4 
5***************************************************************************/
6 
7#ifndef __PC_LPT_H__
8#define __PC_LPT_H__
9 
10#include "devcb.h"
11#include "machine/ctronics.h"
12 
13 
14/***************************************************************************
15    CENTRONICS INTERFACE
16***************************************************************************/
17 
18extern const centronics_interface pc_centronics_config;
19 
20 
21/***************************************************************************
22    TYPE DEFINITIONS
23***************************************************************************/
24 
25typedef struct _pc_lpt_interface pc_lpt_interface;
26struct _pc_lpt_interface
27{
28   devcb_write_line out_irq_func;
29};
30 
31 
32/***************************************************************************
33    FUNCTION PROTOTYPES
34***************************************************************************/
35 
36DEVICE_GET_INFO( pc_lpt );
37 
38READ8_DEVICE_HANDLER( pc_lpt_r );
39WRITE8_DEVICE_HANDLER( pc_lpt_w );
40 
41READ8_DEVICE_HANDLER( pc_lpt_data_r );
42WRITE8_DEVICE_HANDLER( pc_lpt_data_w );
43READ8_DEVICE_HANDLER( pc_lpt_status_r );
44READ8_DEVICE_HANDLER( pc_lpt_control_r );
45WRITE8_DEVICE_HANDLER( pc_lpt_control_w );
46 
47 
48/***************************************************************************
49    DEVICE CONFIGURATION MACROS
50***************************************************************************/
51 
52#define PC_LPT DEVICE_GET_INFO_NAME(pc_lpt)
53 
54#define MDRV_PC_LPT_ADD(_tag, _intf) \
55   MDRV_CENTRONICS_ADD(_tag, pc_centronics_config) \
56   MDRV_DEVICE_ADD(_tag, PC_LPT, 0) \
57   MDRV_DEVICE_CONFIG(_intf)
58 
59#define MDRV_PC_LPT_REMOVE(_tag) \
60   MDRV_CENTRONICS_REMOVE(_tag) \
61   MDRV_DEVICE_REMOVE(_tag, PC_LPT)
62 
63 
64#endif /* __PC_LPT__ */
src/mess/machine/pc.c
r4286r4287
3030
3131#include "includes/pc_mouse.h"
3232#include "machine/pckeybrd.h"
33
34#include "includes/pclpt.h"
35#include "machine/centroni.h"
36
33#include "machine/pc_lpt.h"
3734#include "machine/pc_fdc.h"
3835#include "machine/pc_hdc.h"
3936#include "machine/nec765.h"
r4286r4287
246243static UINT8 pc_spkrdata = 0;
247244static UINT8 pc_input = 0;
248245
249UINT8 pc_speaker_get_spk(void)
246UINT8 pc_speaker_get_spk(void)
250247{
251248   return pc_spkrdata & pc_input;
252249}
r4286r4287
276273{
277274   pic8259_set_irq_line(pc_devices.pic8259_master, 0, state);
278275}
279 
280276
277
281278static PIT8253_OUTPUT_CHANGED( ibm5150_pit8253_out1_changed )
282279{
283280   /* Trigger DMA channel #0 */
r4286r4287
397394
398395/**********************************************************
399396 *
400 * LPT interface
401 *
402 **********************************************************/
403
404static const PC_LPT_CONFIG lpt_config[3]=
405{
406   {
407      1,
408      LPT_UNIDIRECTIONAL,
409      NULL
410   },
411   {
412      1,
413      LPT_UNIDIRECTIONAL,
414      NULL
415   },
416   {
417      1,
418      LPT_UNIDIRECTIONAL,
419      NULL
420   }
421};
422
423static const CENTRONICS_CONFIG cent_config[3]=
424{
425   {
426      PRINTER_IBM,
427      pc_lpt_handshake_in
428   },
429   {
430      PRINTER_IBM,
431      pc_lpt_handshake_in
432   },
433   {
434      PRINTER_IBM,
435      pc_lpt_handshake_in
436   }
437};
438
439
440
441/**********************************************************
442 *
443397 * NMI handling
444398 *
445399 **********************************************************/
r4286r4287
11591113 *
11601114 **********************************************************/
11611115
1162void mess_init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int), void (*set_hdc_int_func)(int,int))
1116void mess_init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int), void (*set_hdc_int_func)(int,int))
11631117{
11641118   if ( set_keyb_int_func != NULL )
11651119      init_pc_common(machine, flags, set_keyb_int_func);
r4286r4287
11711125   /* FDC/HDC hardware */
11721126   pc_hdc_setup(machine, set_hdc_int_func);
11731127
1174   pc_lpt_config(0, lpt_config);
1175   centronics_config(machine, 0, cent_config);
1176   pc_lpt_set_device(0, &CENTRONICS_PRINTER_DEVICE);
1177   pc_lpt_config(1, lpt_config+1);
1178   centronics_config(machine, 1, cent_config+1);
1179   pc_lpt_set_device(1, &CENTRONICS_PRINTER_DEVICE);
1180   pc_lpt_config(2, lpt_config+2);
1181   centronics_config(machine, 2, cent_config+2);
1182   pc_lpt_set_device(2, &CENTRONICS_PRINTER_DEVICE);
1183
11841128   /* serial mouse */
11851129   pc_mouse_initialise(machine);
11861130}
r4286r4287
12931237   memory_install_read16_handler( io_space, 0x3d0, 0x3df, 0, 0, pc1512_16le_r );
12941238   memory_install_write16_handler( io_space, 0x3d0, 0x3df, 0, 0, pc1512_16le_w );
12951239
1296   memory_install_read16_handler( io_space, 0x278, 0x27b, 0, 0, pc16le_parallelport2_r );
1297
1298
12991240   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
13001241   mc146818_init(machine, MC146818_IGNORE_CENTURY);
13011242}
src/mess/mess.mak
r4286r4287
522522   $(MESS_MACHINE)/74145.o    \
523523   $(MESS_MACHINE)/ins8250.o \
524524   $(MESS_MACHINE)/pc_mouse.o \
525   $(MESS_MACHINE)/centroni.o \
525   $(MESS_MACHINE)/pc_lpt.o    \
526526   $(MESS_MACHINE)/ctronics.o \
527527   $(MAME_MACHINE)/pckeybrd.o \
528528   $(MESS_MACHINE)/d88.o      \
r4286r4287
538538   $(MESS_DEVICES)/z80bin.o   \
539539   $(MESS_VIDEO)/cdp1864.o      \
540540   $(MESS_VIDEO)/crtc6845.o   \
541   $(MESS_MACHINE)/pclpt.o    \
542541   $(MESS_MACHINE)/z80dart.o   \
543542   $(MESS_VIDEO)/msm6255.o   \
544543   $(MESS_MACHINE)/8530scc.o      \
src/mess/drivers/pcw16.c
r4286r4287
9393#include "includes/pcw16.h"
9494
9595/* Components */
96#include "machine/centroni.h"   /* centronics printer handshake simulation */
97#include "includes/pclpt.h"      /* PC-Parallel Port */
96#include "machine/pc_lpt.h"      /* PC-Parallel Port */
9897#include "machine/pckeybrd.h"   /* PC-AT keyboard */
9998#include "machine/pc_fdc.h"      /* change to superio later */
10099#include "machine/ins8250.h"   /* pc com port */
r4286r4287
105104/* Devices */
106105#include "formats/pc_dsk.h"      /* pc disk images */
107106#include "devices/mflopimg.h"
108#include "devices/printer.h"   /* printer device */
109107
110108
111109// interrupt counter
r4286r4287
12901288   AM_RANGE(0x01f, 0x01f) AM_READWRITE(pcw16_superio_fdc_digital_input_register_r, pcw16_superio_fdc_datarate_w)
12911289   AM_RANGE(0x020, 0x027) AM_DEVREADWRITE(NS16550, "ns16550_1", ins8250_r, ins8250_w)
12921290   AM_RANGE(0x028, 0x02f) AM_DEVREADWRITE(NS16550, "ns16550_2", ins8250_r, ins8250_w)
1293   AM_RANGE(0x038, 0x03a) AM_READWRITE(pc_parallelport0_r, pc_parallelport0_w)
1291   AM_RANGE(0x038, 0x03a) AM_DEVREADWRITE(PC_LPT, "lpt", pc_lpt_r, pc_lpt_w)
12941292   /* anne asic */
12951293   AM_RANGE(0x0e0, 0x0ef) AM_WRITE(pcw16_palette_w)
12961294   AM_RANGE(0x0f0, 0x0f3) AM_READWRITE(pcw16_bankhw_r, pcw16_bankhw_w)
r4286r4287
13331331}
13341332
13351333
1336static const PC_LPT_CONFIG lpt_config =
1337{
1338   1,
1339   LPT_UNIDIRECTIONAL, // more one of these epp/ecp aware ports
1340   NULL
1341};
1342
1343static const CENTRONICS_CONFIG cent_config =
1344{
1345   PRINTER_CENTRONICS,
1346   pc_lpt_handshake_in
1347};
1348
13491334static MACHINE_RESET( pcw16 )
13501335{
13511336   pcw16_system_status = 0;
r4286r4287
13611346
13621347   pc_fdc_init(machine, &pcw16_fdc_interface);
13631348
1364   pc_lpt_config(0, &lpt_config);
1365   centronics_config(machine, 0, &cent_config);
1366   pc_lpt_set_device(0, &CENTRONICS_PRINTER_DEVICE);
1367
13681349   /* initialise mouse */
13691350   pc_mouse_initialise(machine);
13701351   pc_mouse_set_serial_port( devtag_get_device(machine, NS16550, "ns16550_0") );
r4286r4287
13941375INPUT_PORTS_END
13951376
13961377
1378static const pc_lpt_interface pcw16_lpt_config =
1379{
1380   DEVCB_CPU_INPUT_LINE("main", 0)
1381};
13971382
1383
13981384static MACHINE_DRIVER_START( pcw16 )
13991385   /* basic machine hardware */
14001386   MDRV_CPU_ADD("main", Z80, 16000000)
r4286r4287
14281414   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
14291415
14301416   /* printer */
1431   /* MDRV_PRINTER_ADD("printer") */
1417   MDRV_PC_LPT_ADD("lpt", pcw16_lpt_config)
14321418   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_connected_interface)
14331419MACHINE_DRIVER_END
14341420
src/mess/drivers/ip22.c
r4286r4287
4444#include "machine/sgi.h"
4545#include "machine/pckeybrd.h"
4646#include "includes/pc_mouse.h"
47#include "machine/pc_lpt.h"
4748#include "includes/at.h"
4849#include "machine/8042kbdc.h"
4950#include "machine/pit8253.h"
5051#include "includes/ps2.h"
51#include "machine/pcshare.h"         
52#include "includes/pclpt.h"
52#include "machine/pcshare.h"
5353#include "video/newport.h"
5454#include "machine/wd33c93.h"
5555#include "devices/harddriv.h"
r4286r4287
183183
184184static READ32_HANDLER( hpc3_pbus6_r )
185185{
186   const device_config *lpt = devtag_get_device(space->machine, PC_LPT, "lpt_0");
186187   UINT8 ret8;
187188   running_machine *machine = space->machine;
188189
189190   switch( offset )
190191   {
191192   case 0x004/4:
192      ret8 = pc_parallelport0_r(space, 2) ^ 0x0d;
193      ret8 = pc_lpt_control_r(lpt, 0) ^ 0x0d;
193194      verboselog( machine, 0, "Parallel Control Read: %02x\n", ret8 );
194195      return ret8;
195196   case 0x008/4:
196      ret8 = pc_parallelport0_r(space, 1) ^ 0x80;
197      ret8 = pc_lpt_status_r(lpt, 0) ^ 0x80;
197198      verboselog( machine, 0, "Parallel Status Read: %02x\n", ret8 );
198199      return ret8;
199200   case 0x030/4:
r4286r4287
257258
258259static WRITE32_HANDLER( hpc3_pbus6_w )
259260{
261   const device_config *lpt = devtag_get_device(space->machine, PC_LPT, "lpt_0");
260262   char cChar;
261263   running_machine *machine = space->machine;
262264
r4286r4287
264266   {
265267   case 0x004/4:
266268      verboselog( machine, 0, "Parallel Control Write: %08x\n", data );
267      pc_parallelport0_w(space, 2, data ^ 0x0d);
269      pc_lpt_control_w(lpt, 0, data ^ 0x0d);
268270//      nIOC_ParCntl = data;
269271      break;
270272   case 0x030/4:
r4286r4287
10651067static WRITE32_HANDLER( hpc3_pbusdma_w )
10661068{
10671069   UINT32 channel = offset / (0x2000/4);
1068   running_machine *machine = space->machine;   
1070   running_machine *machine = space->machine;
10691071
10701072   switch( offset & 0x07ff )
10711073   {
r4286r4287
14921494}
14931495#endif
14941496
1497static const pc_lpt_interface ip22_lpt_config =
1498{
1499   DEVCB_NULL /* no idea if the lpt irq is connected and where */
1500};
1501
14951502static MACHINE_DRIVER_START( ip225015 )
14961503   MDRV_CPU_ADD( "main", R5000BE, 50000000*3 )
14971504   MDRV_CPU_CONFIG( config )
r4286r4287
15171524   MDRV_VIDEO_START( newport )
15181525   MDRV_VIDEO_UPDATE( newport )
15191526
1527   MDRV_PC_LPT_ADD("lpt_0", ip22_lpt_config)
1528
15201529   MDRV_SPEAKER_STANDARD_MONO("mono")
15211530
15221531   MDRV_SOUND_ADD( "dmadac", DMADAC, 0)
src/mess/drivers/at.c
r4286r4287
1919#include "machine/mc146818.h"
2020#include "machine/pic8259.h"
2121#include "machine/i82439tx.h"
22#include "devices/printer.h"
2322
2423#include "machine/pit8253.h"
2524#include "video/pc_vga.h"
r4286r4287
3433#include "machine/pc_fdc.h"
3534#include "machine/pc_joy.h"
3635#include "machine/pckeybrd.h"
37#include "includes/pclpt.h"
36#include "machine/pc_lpt.h"
3837#include "audio/sblaster.h"
3938#include "includes/pc_mouse.h"
4039
r4286r4287
137136   AM_RANGE(0x01f0, 0x01f7) AM_READWRITE8(at_mfm_0_r,               at_mfm_0_w, 0xffff)
138137   AM_RANGE(0x0200, 0x0207) AM_READWRITE8(pc_JOY_r,                 pc_JOY_w, 0xffff)
139138   AM_RANGE(0x0220, 0x022f) AM_READWRITE8(soundblaster_r,           soundblaster_w, 0xffff)
140   AM_RANGE(0x0278, 0x027f) AM_READWRITE8(pc_parallelport2_r,       pc_parallelport2_w, 0xffff)
139   AM_RANGE(0x0278, 0x027f) AM_DEVREADWRITE8(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w, 0x00ff)
141140   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8(NS16450, "ns16450_3", ins8250_r, ins8250_w, 0xffff)
142141   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8(NS16450, "ns16450_1", ins8250_r, ins8250_w, 0xffff)
143142//   AM_RANGE(0x0320, 0x0323) AM_READWRITE8(pc_HDC1_r,                pc_HDC1_w, 0xffff)
144143//   AM_RANGE(0x0324, 0x0327) AM_READWRITE8(pc_HDC2_r,                pc_HDC2_w, 0xffff)
145   AM_RANGE(0x0378, 0x037f) AM_READWRITE8(pc_parallelport1_r,       pc_parallelport1_w, 0xffff)
144   AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8(PC_LPT, "lpt_1", pc_lpt_r, pc_lpt_w, 0x00ff)
146145#ifdef ADLIB
147146   AM_RANGE(0x0388, 0x0388) AM_DEVREADWRITE8(SOUND, "ym3812", ym3812_status_port_r,ym3812_control_port_w, 0xffff)
148147   AM_RANGE(0x0389, 0x0389) AM_DEVWRITE8(SOUND, "ym3812", ym3812_write_port_w, 0xffff)
149148#endif
150   AM_RANGE(0x03bc, 0x03bf) AM_READWRITE8(pc_parallelport0_r,       pc_parallelport0_w, 0xffff)
149   AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w, 0x00ff)
151150   AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8(NS16450, "ns16450_2", ins8250_r, ins8250_w, 0xffff)
152151   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8(pc_fdc_r,                 pc_fdc_w, 0xffff)
153152   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8(NS16450, "ns16450_0", ins8250_r, ins8250_w, 0xffff)
r4286r4287
163162   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r,            at_page8_w, 0xffffffff)
164163   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8(PIC8259, "pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
165164   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8(DMA8237, "dma8237_2", at_dma8237_1_r, at_dma8237_1_w, 0xffffffff)
166   AM_RANGE(0x0278, 0x027f) AM_READWRITE(pc32le_parallelport2_r,   pc32le_parallelport2_w)
165   AM_RANGE(0x0278, 0x027f) AM_DEVREADWRITE8(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w, 0x000000ff)
167166   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8(NS16450, "ns16450_3", ins8250_r, ins8250_w, 0xffffffff)
168167   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8(NS16450, "ns16450_1", ins8250_r, ins8250_w, 0xffffffff)
169168   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc32le_HDC1_r,         pc32le_HDC1_w)
170169   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc32le_HDC2_r,         pc32le_HDC2_w)
171   AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc32le_parallelport1_r,   pc32le_parallelport1_w)
170   AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8(PC_LPT, "lpt_1", pc_lpt_r, pc_lpt_w, 0x000000ff)
172171   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8(pc_fdc_r,            pc_fdc_w, 0xffffffff)
173   AM_RANGE(0x03bc, 0x03bf) AM_READWRITE(pc32le_parallelport0_r,   pc32le_parallelport0_w)
172   AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w, 0x000000ff)
174173   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8(NS16450, "ns16450_0", ins8250_r, ins8250_w, 0xffffffff)
175174ADDRESS_MAP_END
176175
r4286r4287
185184   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r,            at_page8_w, 0xffffffff)
186185   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8(PIC8259, "pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
187186   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8(DMA8237, "dma8237_2", at_dma8237_1_r, at_dma8237_1_w, 0xffffffff)
188   AM_RANGE(0x0278, 0x027f) AM_READWRITE(pc32le_parallelport2_r,      pc32le_parallelport2_w)
187   AM_RANGE(0x0278, 0x027f) AM_DEVREADWRITE8(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w, 0x000000ff)
189188   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8(NS16450, "ns16450_3", ins8250_r, ins8250_w, 0xffffffff)
190189   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8(NS16450, "ns16450_1", ins8250_r, ins8250_w, 0xffffffff)
191190   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc32le_HDC1_r,            pc32le_HDC1_w)
192191   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc32le_HDC2_r,            pc32le_HDC2_w)
193   AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc32le_parallelport1_r,      pc32le_parallelport1_w)
192   AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8(PC_LPT, "lpt_1", pc_lpt_r, pc_lpt_w, 0x000000ff)
194193   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8(pc_fdc_r,            pc_fdc_w, 0xffffffff)
195   AM_RANGE(0x03bc, 0x03bf) AM_READWRITE(pc32le_parallelport0_r,      pc32le_parallelport0_w)
194   AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w, 0x000000ff)
196195   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8(NS16450, "ns16450_0", ins8250_r, ins8250_w, 0xffffffff)
197196   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE(PCI_BUS, "pcibus", pci_32le_r,            pci_32le_w)
198197ADDRESS_MAP_END
r4286r4287
402401};
403402#endif
404403
404static const pc_lpt_interface at_lpt_config =
405{
406   DEVCB_CPU_INPUT_LINE("main", 0)
407};
405408
409
406410static MACHINE_DRIVER_START( ibm5170 )
407411   /* basic machine hardware */
408412   MDRV_CPU_ADD("main", I80286, 6000000 /*6000000*/)
r4286r4287
454458   MDRV_NVRAM_HANDLER( mc146818 )
455459
456460   /* printers */
457   MDRV_PRINTER_ADD("printer1")
458   MDRV_PRINTER_ADD("printer2")
459   MDRV_PRINTER_ADD("printer3")
461   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
462   MDRV_PC_LPT_ADD("lpt_1", at_lpt_config)
463   MDRV_PC_LPT_ADD("lpt_2", at_lpt_config)
460464
461465   /* harddisk */
462466   MDRV_IMPORT_FROM( pc_hdc )
463   
467
464468   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
465469MACHINE_DRIVER_END
466470
r4286r4287
512516   MDRV_NVRAM_HANDLER( mc146818 )
513517
514518   /* printers */
515   MDRV_PRINTER_ADD("printer1")
516   MDRV_PRINTER_ADD("printer2")
517   MDRV_PRINTER_ADD("printer3")
519   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
520   MDRV_PC_LPT_ADD("lpt_1", at_lpt_config)
521   MDRV_PC_LPT_ADD("lpt_2", at_lpt_config)
518522
519523   /* harddisk */
520524   MDRV_IMPORT_FROM( pc_hdc )
521   
525
522526   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
523527MACHINE_DRIVER_END
524528
r4286r4287
577581   MDRV_NVRAM_HANDLER( mc146818 )
578582
579583   /* printers */
580   MDRV_PRINTER_ADD("printer1")
581   MDRV_PRINTER_ADD("printer2")
582   MDRV_PRINTER_ADD("printer3")
584   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
585   MDRV_PC_LPT_ADD("lpt_1", at_lpt_config)
586   MDRV_PC_LPT_ADD("lpt_2", at_lpt_config)
583587
584588   /* harddisk */
585589   MDRV_IMPORT_FROM( pc_hdc )
586   
590
587591   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
588592MACHINE_DRIVER_END
589593
r4286r4287
644648   MDRV_NVRAM_HANDLER( mc146818 )
645649
646650   /* printers */
647   MDRV_PRINTER_ADD("printer1")
648   MDRV_PRINTER_ADD("printer2")
649   MDRV_PRINTER_ADD("printer3")
651   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
652   MDRV_PC_LPT_ADD("lpt_1", at_lpt_config)
653   MDRV_PC_LPT_ADD("lpt_2", at_lpt_config)
650654
651655   /* harddisk */
652656   MDRV_IMPORT_FROM( pc_hdc )
653   
657
654658   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
655659MACHINE_DRIVER_END
656660
r4286r4287
708712   MDRV_NVRAM_HANDLER( mc146818 )
709713
710714   /* printers */
711   MDRV_PRINTER_ADD("printer1")
712   MDRV_PRINTER_ADD("printer2")
713   MDRV_PRINTER_ADD("printer3")
715   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
716   MDRV_PC_LPT_ADD("lpt_1", at_lpt_config)
717   MDRV_PC_LPT_ADD("lpt_2", at_lpt_config)
714718
715719   /* harddisk */
716720   MDRV_IMPORT_FROM( pc_hdc )
717   
721
718722   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
719723MACHINE_DRIVER_END
720724
src/mess/drivers/pc.c
r4286r4287
131131#include "machine/pc_fdc.h"
132132#include "machine/pc_joy.h"
133133#include "machine/pckeybrd.h"
134#include "includes/pclpt.h"
134#include "machine/pc_lpt.h"
135135#include "audio/sblaster.h"
136136#include "includes/pc_mouse.h"
137137
r4286r4287
144144#include "includes/pc.h"
145145
146146#include "machine/pc_hdc.h"
147#include "devices/printer.h"
148147#include "devices/mflopimg.h"
149148#include "devices/harddriv.h"
150149#include "devices/cassette.h"
r4286r4287
222221   AM_RANGE(0x0210, 0x0217) AM_READWRITE(pc_EXP_r,            pc_EXP_w)
223222#endif
224223   AM_RANGE(0x0240, 0x0257) AM_READWRITE(pc_rtc_r,            pc_rtc_w)
225   AM_RANGE(0x0278, 0x027b) AM_READWRITE(pc_parallelport2_r,   pc_parallelport2_w)
224   AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w)
226225   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE(INS8250, "ins8250_3", ins8250_r, ins8250_w)
227226   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE(INS8250, "ins8250_1", ins8250_r, ins8250_w)
228227   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc_HDC1_r,         pc_HDC1_w)
229228   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc_HDC2_r,         pc_HDC2_w)
230229   AM_RANGE(0x0340, 0x0357) AM_READ(return8_FF) /* anonymous bios should not recogniced realtimeclock */
231   AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc_parallelport1_r,   pc_parallelport1_w)
230   AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE(PC_LPT, "lpt_1", pc_lpt_r, pc_lpt_w)
232231#ifdef ADLIB
233232   AM_RANGE(0x0388, 0x0388) AM_DEVREADWRITE(SOUND, "ym3812", ym3812_status_port_r,ym3812_control_port_w)
234233   AM_RANGE(0x0389, 0x0389) AM_DEVWRITE(SOUND, "ym3812", ym3812_write_port_w)
235234#endif
236   AM_RANGE(0x03bc, 0x03be) AM_READWRITE(pc_parallelport0_r,   pc_parallelport0_w)
235   AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w)
237236   AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE(INS8250, "ins8250_2", ins8250_r, ins8250_w)
238237   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE(pc_fdc_r,            pc_fdc_w)
239238   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE(INS8250, "ins8250_0", ins8250_r, ins8250_w)
r4286r4287
253252   AM_RANGE(0x0210, 0x0217) AM_READWRITE(pc_EXP_r,               pc_EXP_w)
254253#endif
255254   AM_RANGE(0x0240, 0x0257) AM_READWRITE(pc16le_rtc_r,            pc16le_rtc_w)
256   AM_RANGE(0x0278, 0x027b) AM_READWRITE(pc16le_parallelport2_r,   pc16le_parallelport2_w)
255   AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE8(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w, 0x00ff)
257256   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8(INS8250, "ins8250_3", ins8250_r, ins8250_w, 0xffff)
258257   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8(INS8250, "ins8250_1", ins8250_r, ins8250_w, 0xffff)
259258   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc16le_HDC1_r,         pc16le_HDC1_w)
260259   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc16le_HDC2_r,         pc16le_HDC2_w)
261260   AM_RANGE(0x0340, 0x0357) AM_READ(return16_FFFF) /* anonymous bios should not recogniced realtimeclock */
262   AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc16le_parallelport1_r,   pc16le_parallelport1_w)
261   AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8(PC_LPT, "lpt_1", pc_lpt_r, pc_lpt_w, 0x00ff)
263262#ifdef ADLIB
264263   AM_RANGE(0x0388, 0x0388) AM_DEVREADWRITE8(SOUND, "ym3812", ym3812_status_port_r,ym3812_control_port_w, 0xffff)
265264   AM_RANGE(0x0389, 0x0389) AM_DEVWRITE8(SOUND, "ym3812", ym3812_write_port_w, 0xffff)
266265#endif
267   AM_RANGE(0x03bc, 0x03bf) AM_READWRITE(pc16le_parallelport0_r,   pc16le_parallelport0_w)
266   AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w, 0x00ff)
268267   AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8(INS8250, "ins8250_2", ins8250_r, ins8250_w, 0xffff)
269268   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8(pc_fdc_r,            pc_fdc_w, 0xffff)
270269   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8(INS8250, "ins8250_0", ins8250_r, ins8250_w, 0xffff)
r4286r4287
292291   AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r,         pc_page_w)
293292   AM_RANGE(0x0200, 0x0207) AM_READWRITE(pc_JOY_r,            pc_JOY_w)
294293   AM_RANGE(0x0250, 0x025f) AM_READWRITE(europc_jim_r,         europc_jim_w)
295   AM_RANGE(0x0278, 0x027b) AM_READWRITE(pc_parallelport2_r,   pc_parallelport2_w)
294   AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w)
296295   AM_RANGE(0x02e0, 0x02e0) AM_READ     (europc_jim2_r)
297296   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE(INS8250, "ins8250_3", ins8250_r, ins8250_w)
298297   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE(INS8250, "ins8250_1", ins8250_r, ins8250_w)
299298   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc_HDC1_r,         pc_HDC1_w)
300299   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc_HDC2_r,         pc_HDC2_w)
301   AM_RANGE(0x0378, 0x037b) AM_READWRITE(pc_parallelport1_r,   pc_parallelport1_w)
300   AM_RANGE(0x0378, 0x037b) AM_DEVREADWRITE(PC_LPT, "lpt_1", pc_lpt_r, pc_lpt_w)
302301#ifdef ADLIB
303302   AM_RANGE(0x0388, 0x0388) AM_DEVREADWRITE(SOUND, "ym3812", ym3812_status_port_r,ym3812_control_port_w)
304303   AM_RANGE(0x0389, 0x0389) AM_DEVWRITE(SOUND, "ym3812", ym3812_write_port_w)
305304#endif
306//   AM_RANGE(0x03bc, 0x03bf) AM_READWRITE(pc16le_parallelport0_r,   pc16le_parallelport0_w)
305//   AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w)
307306   AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE(INS8250, "ins8250_2", ins8250_r, ins8250_w)
308307   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE(pc_fdc_r,            pc_fdc_w)
309308   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE(INS8250, "ins8250_0", ins8250_r, ins8250_w)
r4286r4287
337336   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc_HDC1_r,            pc_HDC1_w)
338337   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc_HDC2_r,            pc_HDC2_w)
339338   AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc_t1t_p37x_r,         pc_t1t_p37x_w)
340   AM_RANGE(0x03bc, 0x03be) AM_READWRITE(pc_parallelport0_r,      pc_parallelport0_w)
339   AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w)
341340   AM_RANGE(0x03d0, 0x03df) AM_READWRITE(pc_T1T_r,               pc_T1T_w)
342341   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE(pc_fdc_r,               pc_fdc_w)
343342   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE(INS8250, "ins8250_0", ins8250_r, ins8250_w)
r4286r4287
372371   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc_HDC1_r,            pc_HDC1_w)
373372   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc_HDC2_r,            pc_HDC2_w)
374373   AM_RANGE(0x0378, 0x037f) AM_READWRITE(pc_t1t_p37x_r,         pc_t1t_p37x_w)
375   AM_RANGE(0x03bc, 0x03be) AM_READWRITE(pc_parallelport0_r,      pc_parallelport0_w)
374   AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w)
376375   AM_RANGE(0x03d0, 0x03df) AM_READWRITE(pc_T1T_r,               pc_pcjr_w)
377376   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE(INS8250, "ins8250_0", ins8250_r, ins8250_w)
378377ADDRESS_MAP_END
r4286r4287
388387   AM_RANGE(0x007a, 0x007b) AM_READWRITE(pc1640_16le_mouse_y_r,         pc1640_16le_mouse_y_w)
389388   AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r,               pc_page_w, 0xffff)
390389   AM_RANGE(0x0200, 0x0207) AM_READWRITE(pc16le_JOY_r,               pc16le_JOY_w)
391   AM_RANGE(0x0278, 0x027b) AM_READWRITE(pc16le_parallelport2_r,      pc16le_parallelport2_w)
390   AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE8(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w, 0x00ff)
392391   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8(INS8250, "ins8250_3", ins8250_r, ins8250_w, 0xffff)
393392   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8(INS8250, "ins8250_1", ins8250_r, ins8250_w, 0xffff)
394393   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc16le_HDC1_r,            pc16le_HDC1_w)
395394   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc16le_HDC2_r,            pc16le_HDC2_w)
396   AM_RANGE(0x0378, 0x037b) AM_READWRITE(pc200_16le_port378_r,         pc16le_parallelport1_w)
397   AM_RANGE(0x03bc, 0x03bf) AM_READWRITE(pc16le_parallelport0_r,      pc16le_parallelport0_w)
395   AM_RANGE(0x0378, 0x037b) AM_READ(pc200_16le_port378_r) AM_DEVWRITE8(PC_LPT, "lpt_1", pc_lpt_w, 0x00ff)
396   AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w, 0x00ff)
398397   AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8(INS8250, "ins8250_2", ins8250_r, ins8250_w, 0xffff)
399398   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8(pc_fdc_r,               pc_fdc_w, 0xffff)
400399   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8(INS8250, "ins8250_0", ins8250_r, ins8250_w, 0xffff)
r4286r4287
422421   AM_RANGE(0x007a, 0x007b) AM_READWRITE(pc1640_16le_mouse_y_r,   pc1640_16le_mouse_y_w)
423422   AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r,            pc_page_w, 0xffff)
424423   AM_RANGE(0x0200, 0x0207) AM_READWRITE(pc16le_JOY_r,            pc16le_JOY_w)
425   AM_RANGE(0x0278, 0x027b) AM_READWRITE(pc16le_parallelport2_r,      pc16le_parallelport2_w)
424   AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE8(PC_LPT, "lpt_2", pc_lpt_r, pc_lpt_w, 0x00ff)
426425   AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8(INS8250, "ins8250_3", ins8250_r, ins8250_w, 0xffff)
427426   AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8(INS8250, "ins8250_1", ins8250_r, ins8250_w, 0xffff)
428427   AM_RANGE(0x0320, 0x0323) AM_READWRITE(pc16le_HDC1_r,         pc16le_HDC1_w)
429428   AM_RANGE(0x0324, 0x0327) AM_READWRITE(pc16le_HDC2_r,         pc16le_HDC2_w)
430   AM_RANGE(0x0378, 0x037b) AM_READWRITE(pc1640_16le_port378_r,         pc16le_parallelport1_w)
431   AM_RANGE(0x03bc, 0x03bf) AM_READWRITE(pc16le_parallelport0_r,      pc16le_parallelport0_w)
429   AM_RANGE(0x0378, 0x037b) AM_READ(pc1640_16le_port378_r) AM_DEVWRITE8(PC_LPT, "lpt_1", pc_lpt_w, 0x00ff)
430   AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8(PC_LPT, "lpt_0", pc_lpt_r, pc_lpt_w, 0x00ff)
432431   AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8(INS8250, "ins8250_2", ins8250_r, ins8250_w, 0xffff)
433432   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8(pc_fdc_r,            pc_fdc_w, 0xffff)
434433   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8(INS8250, "ins8250_0", ins8250_r, ins8250_w, 0xffff)
r4286r4287
945944   PORT_DIPNAME( 0x08, 0x00, "37a 0x40")
946945   PORT_DIPSETTING(   0x00, "0x00" )
947946   PORT_DIPSETTING(   0x08, "0x08" )
948/* 2008-05 FP: This Dip Switch overlaps the next one.
947/* 2008-05 FP: This Dip Switch overlaps the next one.
949948Since pc200 is anyway NOT_WORKING, I comment out this one */
950949/*   PORT_DIPNAME( 0x10, 0x00, "37a 0x80")
951950   PORT_DIPSETTING(   0x00, "0x00" )
r4286r4287
13051304#endif
13061305
13071306
1307static const pc_lpt_interface pc_lpt_config =
1308{
1309   DEVCB_CPU_INPUT_LINE("main", 0)
1310};
1311
1312
13081313#define MDRV_CPU_PC(mem, port, type, clock, vblankfunc)   \
13091314   MDRV_CPU_ADD("main", type, clock)            \
13101315   MDRV_CPU_PROGRAM_MAP(mem##_map, 0)         \
r4286r4287
13631368   MDRV_IMPORT_FROM( kb_keytronic )
13641369
13651370   /* printer */
1366   MDRV_PRINTER_ADD("printer")
1367   MDRV_PRINTER_ADD("printer2")
1368   MDRV_PRINTER_ADD("printer3")
1371   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1372   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1373   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
13691374
13701375   /* harddisk */
13711376   MDRV_IMPORT_FROM( pc_hdc )
1372   
1377
13731378   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
13741379MACHINE_DRIVER_END
13751380
r4286r4287
14221427   MDRV_IMPORT_FROM( kb_keytronic )
14231428
14241429   /* printer */
1425   MDRV_PRINTER_ADD("printer")
1426   MDRV_PRINTER_ADD("printer2")
1427   MDRV_PRINTER_ADD("printer3")
1430   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1431   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1432   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
14281433
14291434   /* harddisk */
14301435   MDRV_IMPORT_FROM( pc_hdc )
1431   
1436
14321437   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
14331438MACHINE_DRIVER_END
14341439
r4286r4287
14911496   MDRV_IMPORT_FROM( kb_keytronic )
14921497
14931498   /* printer */
1494   MDRV_PRINTER_ADD("printer")
1495   MDRV_PRINTER_ADD("printer2")
1496   MDRV_PRINTER_ADD("printer3")
1499   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1500   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1501   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
14971502
14981503   /* harddisk */
14991504   MDRV_IMPORT_FROM( pc_hdc )
15001505
15011506   MDRV_CASSETTE_ADD( "cassette", ibm5150_cassette_config )
1502   
1503   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)   
1507
1508   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
15041509MACHINE_DRIVER_END
15051510
15061511
r4286r4287
15511556   MDRV_IMPORT_FROM( kb_keytronic )
15521557
15531558   /* printer */
1554   MDRV_PRINTER_ADD("printer")
1555   MDRV_PRINTER_ADD("printer2")
1556   MDRV_PRINTER_ADD("printer3")
1559   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1560   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1561   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
15571562
15581563   /* harddisk */
15591564   MDRV_IMPORT_FROM( pc_hdc )
1560   
1565
15611566   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
15621567MACHINE_DRIVER_END
15631568
r4286r4287
16001605   MDRV_NVRAM_HANDLER( europc_rtc )
16011606
16021607   /* printer */
1603   MDRV_PRINTER_ADD("printer")
1604   MDRV_PRINTER_ADD("printer2")
1605   MDRV_PRINTER_ADD("printer3")
1608   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1609   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1610   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
16061611
16071612   /* harddisk */
16081613   MDRV_IMPORT_FROM( pc_hdc )
1609   
1614
16101615   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
16111616MACHINE_DRIVER_END
16121617
r4286r4287
16561661   MDRV_IMPORT_FROM( kb_keytronic )
16571662
16581663   /* printer */
1659   MDRV_PRINTER_ADD("printer")
1660   MDRV_PRINTER_ADD("printer2")
1661   MDRV_PRINTER_ADD("printer3")
1664   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1665   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1666   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
16621667
16631668   /* harddisk */
16641669   MDRV_IMPORT_FROM( pc_hdc )
1665   
1670
16661671   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
16671672MACHINE_DRIVER_END
16681673
r4286r4287
16981703   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
16991704
17001705   /* printer */
1701   MDRV_PRINTER_ADD("printer")
1702   MDRV_PRINTER_ADD("printer2")
1703   MDRV_PRINTER_ADD("printer3")
1706   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1707   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1708   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
17041709
17051710   /* harddisk */
17061711   MDRV_IMPORT_FROM( pc_hdc )
1707   
1712
17081713   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
17091714MACHINE_DRIVER_END
17101715
r4286r4287
17421747   MDRV_NVRAM_HANDLER( mc146818 )
17431748
17441749   /* printer */
1745   MDRV_PRINTER_ADD("printer")
1746   MDRV_PRINTER_ADD("printer2")
1747   MDRV_PRINTER_ADD("printer3")
1750   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1751   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1752   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
17481753
17491754   /* harddisk */
17501755   MDRV_IMPORT_FROM( pc_hdc )
1751   
1756
17521757   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
17531758MACHINE_DRIVER_END
17541759
r4286r4287
17861791   MDRV_NVRAM_HANDLER( mc146818 )
17871792
17881793   /* printer */
1789   MDRV_PRINTER_ADD("printer")
1790   MDRV_PRINTER_ADD("printer2")
1791   MDRV_PRINTER_ADD("printer3")
1794   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1795   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1796   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
17921797
17931798   /* harddisk */
17941799   MDRV_IMPORT_FROM( pc_hdc )
1795   
1800
17961801   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
17971802MACHINE_DRIVER_END
17981803
r4286r4287
18411846   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
18421847#endif
18431848
1849   /* printer */
1850   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1851   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1852   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
1853
18441854   /* harddisk */
18451855   MDRV_IMPORT_FROM( pc_hdc )
1846   
1856
18471857   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
18481858MACHINE_DRIVER_END
18491859
r4286r4287
18811891   MDRV_NVRAM_HANDLER( tandy1000 )
18821892
18831893   /* printer */
1884   MDRV_PRINTER_ADD("printer")
1885   MDRV_PRINTER_ADD("printer2")
1886   MDRV_PRINTER_ADD("printer3")
1894   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1895   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1896   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
18871897
18881898   /* harddisk */
18891899   MDRV_IMPORT_FROM( pc_hdc )
1890   
1900
18911901   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
18921902MACHINE_DRIVER_END
18931903
r4286r4287
19251935   MDRV_NVRAM_HANDLER( tandy1000 )
19261936
19271937   /* printer */
1928   MDRV_PRINTER_ADD("printer")
1929   MDRV_PRINTER_ADD("printer2")
1930   MDRV_PRINTER_ADD("printer3")
1938   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
1939   MDRV_PC_LPT_ADD("lpt_1", pc_lpt_config)
1940   MDRV_PC_LPT_ADD("lpt_2", pc_lpt_config)
19311941
19321942   /* cassette */
19331943   MDRV_CASSETTE_ADD( "cassette", ibm5150_cassette_config )
1934   
1944
19351945   MDRV_NEC765A_ADD("nec765", pc_fdc_nec765_not_connected_interface)
19361946
19371947   /* cartridge */
r4286r4287
19391949   MDRV_CARTSLOT_EXTENSION_LIST("jrc")
19401950   MDRV_CARTSLOT_NOT_MANDATORY
19411951   MDRV_CARTSLOT_LOAD(pcjr_cartridge)
1942   MDRV_CARTSLOT_ADD("cart2")   
1952   MDRV_CARTSLOT_ADD("cart2")
19431953   MDRV_CARTSLOT_EXTENSION_LIST("jrc")
19441954   MDRV_CARTSLOT_NOT_MANDATORY
19451955   MDRV_CARTSLOT_LOAD(pcjr_cartridge)
r4286r4287
22602270//   ROM_LOAD("600963.u12", 0xc8000, 0x02000, CRC(f3daf85f) SHA1(3bd29538832d3084cbddeec92593988772755283))  /* Tandon/Western Digital Fixed Disk Adapter 600963-001__TYPE_5.U12.2764.bin */
22612271
22622272   /* PC/3270 has a 3270 keyboard controller card, plus a rom on that card to tell the pc how to run it.
2263      * Unlike the much more complex keyboard controller used in the AT/3270, this one only has one rom,
2264        a motorola made "(M)1503828 // XE // 8434A XM // SC81155P" custom (an MCU?; the more complicated
2273      * Unlike the much more complex keyboard controller used in the AT/3270, this one only has one rom,
2274        a motorola made "(M)1503828 // XE // 8434A XM // SC81155P" custom (an MCU?; the more complicated
22652275        3270/AT keyboard card uses this same exact chip), an 8254, and some logic chips.
22662276        Thanks to high resolution pictures provided by John Elliott, I can see that the location of the
22672277                  chips is unlabeled (except for by absolute pin position on the back), and there are no pals or proms.
22682278      * The board is stickered "2683114 // 874999 // 8446 SU" on the front.
22692279      * The board has a single DE-9 connector where the keyboard dongle connects to.
22702280      * The keyboard dongle has two connectors on it: a DIN-5 connector which connects to the Motherboard's
2271        keyboard port, plus an RJ45-lookalike socket which the 3270 keyboard connects to.
2281        keyboard port, plus an RJ45-lookalike socket which the 3270 keyboard connects to.
22722282      * The rom is mapped very strangely to avoid hitting the hard disk controller:
22732283        The first 0x800 bytes appear at C0000-C07FF, and the last 0x1800 bytes appear at 0xCA000-CB7FF
22742284   */
r4286r4287
23602370         "6323260 // TC15G022AP-0018 // JAPAN       8606A" (48 pins, at U45)
23612371
23622372      ** The optional Programmable Symbol Card (with an AMD AM9128-10PC, and six tms4416-15NL DRAMS,
2363         and a fleet of discrete logic chips, but no roms, pals, or proms) is stickered
2373         and a fleet of discrete logic chips, but no roms, pals, or proms) is stickered
23642374         "6347750 // A24866 // 6285 SU" on the front.
23652375      *  The PCB is trace-marked "PROGAMMABLE SYMBOL P/N 6347751 // ASSY. NO. 6347750" on the front,
23662376         and trace-marked "|||CIM0286 ECA2466 // 94V-O" on the back.
r4286r4287
25262536
25272537static SYSTEM_CONFIG_START(pcjr)
25282538   CONFIG_RAM_DEFAULT( 640 * 1024 )
2529   CONFIG_DEVICE(ibmpc_floppy_getinfo)   
2539   CONFIG_DEVICE(ibmpc_floppy_getinfo)
25302540SYSTEM_CONFIG_END
25312541
25322542/***************************************************************************
docs/messnew.txt
r4286r4287
2525
2626- [APPLE1] Fixed character layout.  [rhester72]
2727
28- [AT] Updated to use the new centronics interface.  [Dirk Best]
29
2830- [ATARIST] Updated to use the new centronics interface.  [Dirk Best]
2931
3032- [ATOM] Rewrote printer interface.  [Dirk Best]
r4286r4287
4446
4547- [GAMEPOCK] Fixed 128u3 regression.  (bug #1752) [Wilbert Pol]
4648
49- [IP22] Updated to use the centronics interface.  [Dirk Best]
50
4751- [MTX512] Connected CTC channels 0-2 to clock sources. (bug #781) [Curt Coder]
4852
4953- [NC100/NC200] Updated to use the new centronics interface and fixed
r4286r4287
6872
6973- [X68000] Added better implementation of 1024x1024 graphic layer.  [Barry Rodewald]
7074
75- [XT/PC] Updated to use the new centronics support.  [Dirk Best]
76
7177- [ZX] Fixed access violation when mounting a .O tape file;
7278       Implemented cassette save (only .wav is supported);
7379       Implemented sound; Fixed cassette loading; Added the NTSC/PAL diode;
r4286r4287
116122
117123- New centronics printer interface.  [Dirk Best]
118124
125- New PC-LPT device.  [Dirk Best]
119126
120127
128
1211290.129
122130
123131New System Drivers Supported (in no particular order):

Previous 15994 Revisions Next


© 1998-2018 The MESS Team