Previous 15994 Revisions Next

r2928 Friday 4th July, 2008 at 22:33:36 UTC by Nathan Woods
Changed the 8530 SCC chip implementation to use MAME's device system.
[docs]messnew.txt
[src/mess/drivers]apple2gs.c atarist.c ip20.c mac.c x68k.c
[src/mess/includes]mac.h
[src/mess/machine]8530scc.c 8530scc.h apple2gs.c mac.c

src/mess/includes/mac.h
r2927r2928
1010#define MAC_H_
1111
1212#include "sound/custom.h"
13#include "machine/8530scc.h"
1314
1415
1516// video parameters
r2927r2928
2122
2223/*----------- defined in machine/mac.c -----------*/
2324
25extern const scc8530_interface mac_scc8530_interface;
26
2427MACHINE_START( macscsi );
2528MACHINE_RESET( mac );
2629
src/mess/machine/8530scc.c
r2927r2928
1111#include "8530scc.h"
1212
1313
14/***************************************************************************
15    PARAMETERS
16***************************************************************************/
17
1418#define LOG_SCC   0
1519
16static const struct scc8530_interface *scc_intf;
17static int scc_mode;
18static int scc_reg;
19static int scc_status;
2020
21static unsigned char scc_reg_val_a[16];
22static unsigned char scc_reg_val_b[16];
2321
22/***************************************************************************
23    TYPE DEFINITIONS
24***************************************************************************/
2425
25void scc_init(const struct scc8530_interface *intf)
26typedef struct _scc8530_t scc8530_t;
27struct _scc8530_t
2628{
27   scc_intf = intf;
28   scc_mode = 0;
29   scc_reg = 0;
30   scc_status = 0;
29   int mode;
30   int reg;
31   int status;
32
33   UINT8 reg_val_a[16];
34   UINT8 reg_val_b[16];
35};
36
37
38
39/***************************************************************************
40    INLINE FUNCTIONS
41***************************************************************************/
42
43INLINE scc8530_t *get_token(const device_config *device)
44{
45   assert(device->type == SCC8530);
46   return (scc8530_t *) device->token;
3147}
3248
3349
50INLINE scc8530_interface *get_interface(const device_config *device)
51{
52   assert(device->type == SCC8530);
53   return (scc8530_interface *) device->static_config;
54}
3455
35void scc_set_status(int status)
56
57/***************************************************************************
58    IMPLEMENTATION
59***************************************************************************/
60
61/*-------------------------------------------------
62    DEVICE_START( scc8530 )
63-------------------------------------------------*/
64
65static DEVICE_START( scc8530 )
3666{
37   scc_status = status;
67   scc8530_t *scc = get_token(device);
68   memset(scc, 0, sizeof(*scc));
3869}
3970
4071
4172
42static int scc_getareg(void)
73/*-------------------------------------------------
74    scc_set_status
75-------------------------------------------------*/
76
77void scc_set_status(const device_config *device, int status)
4378{
79   scc8530_t *scc = get_token(device);
80   scc->status = status;
81}
82
83
84
85/*-------------------------------------------------
86    scc_acknowledge
87-------------------------------------------------*/
88
89static void scc_acknowledge(const device_config *device)
90{
91   scc8530_interface *intf = get_interface(device);
92   if ((intf != NULL) && (intf->acknowledge != NULL))
93      (*intf->acknowledge)(device);
94}
95
96
97
98/*-------------------------------------------------
99    scc_getareg
100-------------------------------------------------*/
101
102static int scc_getareg(const device_config *device)
103{
104   scc8530_t *scc = get_token(device);
105
44106   /* Not yet implemented */
45   logerror("SCC: port A reg %i read 0x%02x\n",scc_reg,scc_reg_val_a[scc_reg]);
46   return scc_reg_val_a[scc_reg];
107   logerror("SCC: port A reg %i read 0x%02x\n", scc->reg, scc->reg_val_a[scc->reg]);
108   return scc->reg_val_a[scc->reg];
47109}
48110
49111
50112
51static int scc_getbreg(void)
113/*-------------------------------------------------
114    scc_getareg
115-------------------------------------------------*/
116
117static int scc_getbreg(const device_config *device)
52118{
53   logerror("SCC: port B reg %i read 0x%02x\n",scc_reg,scc_reg_val_b[scc_reg]);
119   scc8530_t *scc = get_token(device);
54120
55   if (scc_reg == 2)
121   logerror("SCC: port B reg %i read 0x%02x\n", scc->reg, scc->reg_val_b[scc->reg]);
122
123   if (scc->reg == 2)
56124   {
57      // HACK! but lets the Mac Plus mouse move again.  Needs further investigation.
58      if (scc_intf && scc_intf->acknowledge)
59         scc_intf->acknowledge();
125      /* HACK! but lets the Mac Plus mouse move again.  Needs further investigation. */
126      scc_acknowledge(device);
60127
61      return scc_status;
128      return scc->status;
62129   }
63130
64   return scc_reg_val_b[scc_reg];
131   return scc->reg_val_b[scc->reg];
65132}
66133
67134
68135
69static void scc_putareg(int data)
136/*-------------------------------------------------
137    scc_putareg
138-------------------------------------------------*/
139
140static void scc_putareg(const device_config *device, int data)
70141{
71   if (scc_reg == 0)
142   scc8530_t *scc = get_token(device);
143
144   if (scc->reg == 0)
72145   {
73146      if (data & 0x10)
74      {
75         if (scc_intf && scc_intf->acknowledge)
76            scc_intf->acknowledge();
77      }
147         scc_acknowledge(device);
78148   }
79   scc_reg_val_a[scc_reg] = data;
80   logerror("SCC: port A reg %i write 0x%02x\n",scc_reg,data);
149   scc->reg_val_a[scc->reg] = data;
150   logerror("SCC: port A reg %i write 0x%02x\n", scc->reg, data);
81151}
82152
83153
84154
85static void scc_putbreg(int data)
155/*-------------------------------------------------
156    scc_putbreg
157-------------------------------------------------*/
158
159static void scc_putbreg(const device_config *device, int data)
86160{
87   if (scc_reg == 0)
161   scc8530_t *scc = get_token(device);
162
163   if (scc->reg == 0)
88164   {
89165      if (data & 0x10)
90      {
91         if (scc_intf && scc_intf->acknowledge)
92            scc_intf->acknowledge();
93      }
166         scc_acknowledge(device);
94167   }
95   scc_reg_val_b[scc_reg] = data;
96   logerror("SCC: port B reg %i write 0x%02x\n",scc_reg,data);
168   scc->reg_val_b[scc->reg] = data;
169   logerror("SCC: port B reg %i write 0x%02x\n", scc->reg, data);
97170}
98171
99unsigned char scc_get_reg_a(int reg)
172
173
174/*-------------------------------------------------
175    scc_get_reg_a
176-------------------------------------------------*/
177
178UINT8 scc_get_reg_a(const device_config *device, int reg)
100179{
101   return scc_reg_val_a[reg];
180   scc8530_t *scc = get_token(device);
181   return scc->reg_val_a[reg];
102182}
103183
104unsigned char scc_get_reg_b(int reg)
184
185
186/*-------------------------------------------------
187    scc_get_reg_b
188-------------------------------------------------*/
189
190UINT8 scc_get_reg_b(const device_config *device, int reg)
105191{
106   return scc_reg_val_b[reg];
192   scc8530_t *scc = get_token(device);
193   return scc->reg_val_b[reg];
107194}
108195
109void scc_set_reg_a(int reg, unsigned char data)
196
197
198/*-------------------------------------------------
199    scc_set_reg_a
200-------------------------------------------------*/
201
202void scc_set_reg_a(const device_config *device, int reg, UINT8 data)
110203{
111   scc_reg_val_a[reg] = data;
204   scc8530_t *scc = get_token(device);
205   scc->reg_val_a[reg] = data;
112206}
113207
114void scc_set_reg_b(int reg, unsigned char data)
208
209
210/*-------------------------------------------------
211    scc_set_reg_a
212-------------------------------------------------*/
213
214void scc_set_reg_b(const device_config *device, int reg, UINT8 data)
115215{
116   scc_reg_val_b[reg] = data;
216   scc8530_t *scc = get_token(device);
217   scc->reg_val_b[reg] = data;
117218}
118219
119READ8_HANDLER(scc_r)
220
221
222/*-------------------------------------------------
223    scc_r
224-------------------------------------------------*/
225
226READ8_DEVICE_HANDLER(scc_r)
120227{
228   scc8530_t *scc = get_token(device);
121229   UINT8 result = 0;
122230
123231   offset %= 4;
r2927r2928
129237   {
130238      case 0:
131239         /* Channel B (Printer Port) Control */
132         if (scc_mode == 1)
133            scc_mode = 0;
240         if (scc->mode == 1)
241            scc->mode = 0;
134242         else
135            scc_reg = 0;
243            scc->reg = 0;
136244
137         result = scc_getbreg();
245         result = scc_getbreg(device);
138246         break;
139247
140248      case 1:
141249         /* Channel A (Modem Port) Control */
142         if (scc_mode == 1)
143            scc_mode = 0;
250         if (scc->mode == 1)
251            scc->mode = 0;
144252         else
145            scc_reg = 0;
253            scc->reg = 0;
146254
147         result = scc_getareg();
255         result = scc_getareg(device);
148256         break;
149257
150258      case 2:
r2927r2928
162270
163271
164272
165WRITE8_HANDLER(scc_w)
273/*-------------------------------------------------
274    scc_w
275-------------------------------------------------*/
276
277WRITE8_DEVICE_HANDLER(scc_w)
166278{
279   scc8530_t *scc = get_token(device);
280
167281   offset &= 3;
168282
169283   switch(offset)
170284   {
171285      case 0:
172286         /* Channel B (Printer Port) Control */
173         if (scc_mode == 0)
287         if (scc->mode == 0)
174288         {
175289            if((data & 0xf0) == 0)  // not a reset command
176290            {
177               scc_mode = 1;
178               scc_reg = data & 0x0f;
179               logerror("SCC: Port B Reg select - %i\n",scc_reg);
180//               scc_putbreg(data & 0xf0);
291               scc->mode = 1;
292               scc->reg = data & 0x0f;
293               logerror("SCC: Port B Reg select - %i\n",scc->reg);
294//               scc_putbreg(device, data & 0xf0);
181295            }
182296         }
183297         else
184298         {
185            scc_mode = 0;
186            scc_putbreg(data);
299            scc->mode = 0;
300            scc_putbreg(device, data);
187301         }
188302         break;
189303
190304      case 1:
191305         /* Channel A (Modem Port) Control */
192         if (scc_mode == 0)
306         if (scc->mode == 0)
193307         {
194308            if((data & 0xf0) == 0)  // not a reset command
195309            {
196               scc_mode = 1;
197               scc_reg = data & 0x0f;
198               logerror("SCC: Port A Reg select - %i\n",scc_reg);
199//               scc_putareg(data & 0xf0);
310               scc->mode = 1;
311               scc->reg = data & 0x0f;
312               logerror("SCC: Port A Reg select - %i\n", scc->reg);
313//               scc_putareg(device, data & 0xf0);
200314            }
201315         }
202316         else
203317         {
204            scc_mode = 0;
205            scc_putareg(data);
318            scc->mode = 0;
319            scc_putareg(device, data);
206320         }
207321         break;
208322
r2927r2928
218332   }
219333}
220334
335
336
337/*-------------------------------------------------
338    DEVICE_GET_INFO( scc8530 )
339-------------------------------------------------*/
340
341static DEVICE_SET_INFO( scc8530 )
342{
343   switch (state)
344   {
345      /* no parameters to set */
346   }
347}
348
349
350
351/*-------------------------------------------------
352    DEVICE_GET_INFO( scc8530 )
353-------------------------------------------------*/
354
355DEVICE_GET_INFO( scc8530 )
356{
357   switch (state)
358   {
359      /* --- the following bits of info are returned as 64-bit signed integers --- */
360      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(scc8530_t);            break;
361      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
362      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
363
364      /* --- the following bits of info are returned as pointers to data or functions --- */
365      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(scc8530); break;
366      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(scc8530);   break;
367      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
368      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
369
370      /* --- the following bits of info are returned as NULL-terminated strings --- */
371      case DEVINFO_STR_NAME:                     info->s = "Zilog 8530 SCC";               break;
372      case DEVINFO_STR_FAMILY:                  info->s = "Zilog 8530 SCC";               break;
373      case DEVINFO_STR_VERSION:                  info->s = "1.0";                     break;
374      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                     break;
375      case DEVINFO_STR_CREDITS:                  /* Nothing */                        break;
376   }
377}
src/mess/machine/8530scc.h
r2927r2928
66
77*********************************************************************/
88
9#ifndef _8630SCC_H
10#define _8630SCC_H
9#ifndef __8630SCC_H__
10#define __8630SCC_H__
1111
1212
13struct scc8530_interface
13/***************************************************************************
14    TYPE DEFINITIONS
15***************************************************************************/
16
17#define SCC8530         DEVICE_GET_INFO_NAME(scc8530)
18
19
20
21/***************************************************************************
22    TYPE DEFINITIONS
23***************************************************************************/
24
25typedef struct _scc8530_interface scc8530_interface;
26struct _scc8530_interface
1427{
15   void (*acknowledge)(void);
28   void (*acknowledge)(const device_config *device);
1629};
1730
1831
19void scc_init(const struct scc8530_interface *intf);
20void scc_set_status(int status);
2132
22unsigned char scc_get_reg_a(int reg);
23unsigned char scc_get_reg_b(int reg);
24void scc_set_reg_a(int reg, unsigned char data);
25void scc_set_reg_b(int reg, unsigned char data);
33/***************************************************************************
34    FUNCTION PROTOTYPES
35***************************************************************************/
2636
27READ8_HANDLER(scc_r);
28WRITE8_HANDLER(scc_w);
37void scc_set_status(const device_config *device, int status);
2938
30#endif /* _8630SCC_H */
39UINT8 scc_get_reg_a(const device_config *device, int reg);
40UINT8 scc_get_reg_b(const device_config *device, int reg);
41void scc_set_reg_a(const device_config *device, int reg, UINT8 data);
42void scc_set_reg_b(const device_config *device, int reg, UINT8 data);
43
44DEVICE_GET_INFO(scc8530);
45
46READ8_DEVICE_HANDLER(scc_r);
47WRITE8_DEVICE_HANDLER(scc_w);
48
49#endif /* __8630SCC_H__ */
src/mess/machine/apple2gs.c
r2927r2928
958958static READ8_HANDLER( apple2gs_c0xx_r )
959959{
960960   UINT8 result;
961   const device_config *scc;
961962
962963   offset &= 0xFF;
963964
r2927r2928
10451046      case 0x39:   /* C039 - SCCAREG */
10461047      case 0x3A:   /* C03A - SCCBDATA */
10471048      case 0x3B:   /* C03B - SCCADATA */
1048         result = scc_r(machine, offset & 0x03);
1049         scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
1050         result = scc_r(scc, offset & 0x03);
10491051         break;
10501052
10511053      case 0x3C:   /* C03C - SOUNDCTL */
r2927r2928
10991101
11001102static WRITE8_HANDLER( apple2gs_c0xx_w )
11011103{
1104   const device_config *scc;
1105
11021106   offset &= 0xFF;
11031107
11041108   if (LOG_C0XX)
r2927r2928
11821186      case 0x39:   /* C039 - SCCAREG */
11831187      case 0x3A:   /* C03A - SCCBDATA */
11841188      case 0x3B:   /* C03B - SCCADATA */
1185         scc_w(machine, offset & 0x03, data);
1189         scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
1190         scc_w(scc, offset & 0x03, data);
11861191         break;
11871192
11881193      case 0x3C:   /* C03C - SOUNDCTL */
r2927r2928
17821787   sndglu_dummy_read = 0;
17831788
17841789   /* init the various subsystems */
1785   scc_init(NULL);
17861790   apple2gs_setup_memory(machine);
17871791
17881792   /* save state stuff.  note that the driver takes care of docram. */
src/mess/machine/mac.c
r2927r2928
3939#include <time.h>
4040
4141#include "driver.h"
42#include "deprecat.h"
4342#include "machine/6522via.h"
4443#include "machine/8530scc.h"
4544#include "cpu/m68000/m68000.h"
r2927r2928
717716 * Serial Control Chip
718717 * *************************************************************************/
719718
720static void mac_scc_ack(void)
719static void mac_scc_ack(const device_config *device)
721720{
722   set_scc_interrupt(Machine, 0);
721   set_scc_interrupt(device->machine, 0);
723722}
724723
725724
726725
727726void mac_scc_mouse_irq(running_machine *machine, int x, int y)
728727{
728   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
729729   static int last_was_x = 0;
730730
731731   if (x && y)
732732   {
733733      if (last_was_x)
734         scc_set_status(0x0a);
734         scc_set_status(scc, 0x0a);
735735      else
736         scc_set_status(0x02);
736         scc_set_status(scc, 0x02);
737737
738738      last_was_x ^= 1;
739739   }
740740   else
741741   {
742742      if (x)
743         scc_set_status(0x0a);
743         scc_set_status(scc, 0x0a);
744744      else
745         scc_set_status(0x02);
745         scc_set_status(scc, 0x02);
746746   }
747747
748748   //cpunum_set_input_line(machine, 0, 2, ASSERT_LINE);
r2927r2928
753753
754754READ16_HANDLER ( mac_scc_r )
755755{
756   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
756757   UINT16 result;
757   result = scc_r(machine, offset);
758
759   result = scc_r(scc, offset);
758760   return (result << 8) | result;
759761}
760762
r2927r2928
762764
763765WRITE16_HANDLER ( mac_scc_w )
764766{
765   scc_w(machine, offset, (UINT8) data);
767   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
768   scc_w(scc, offset, (UINT8) data);
766769}
767770
768771
769772
770static const struct scc8530_interface mac_scc8530_interface =
773const scc8530_interface mac_scc8530_interface =
771774{
772775   mac_scc_ack
773776};
r2927r2928
13041307   /* initialize real-time clock */
13051308   rtc_init();
13061309
1307   /* initialize serial */
1308   scc_init(&mac_scc8530_interface);
1309
13101310   /* setup the memory overlay */
13111311   set_memory_overlay(machine, 1);
13121312
src/mess/drivers/apple2gs.c
r2927r2928
5353#include "machine/ap2_lang.h"
5454#include "machine/applefdc.h"
5555#include "machine/mockngbd.h"
56#include "machine/8530scc.h"
5657#include "sound/ay8910.h"
5758
5859static const gfx_layout apple2gs_text_layout =
r2927r2928
180181   MDRV_DEVICE_REMOVE("fdc", APPLEFDC)
181182   MDRV_DEVICE_ADD("fdc", IWM)
182183   MDRV_DEVICE_CONFIG(apple2_fdc_interface)
184
185   /* SCC */
186   MDRV_DEVICE_ADD("scc", SCC8530)
183187MACHINE_DRIVER_END
184188
185189
src/mess/drivers/mac.c
r2927r2928
130130   /* devices */
131131   MDRV_DEVICE_ADD("fdc", IWM)
132132   MDRV_DEVICE_CONFIG(mac_iwm_interface)
133   MDRV_DEVICE_ADD("scc", SCC8530)
134   MDRV_DEVICE_CONFIG(mac_scc8530_interface)
133135MACHINE_DRIVER_END
134136
135137static MACHINE_DRIVER_START( macplus )
src/mess/drivers/x68k.c
r2927r2928
531531   sys.mouse.inputtype++;
532532   if(sys.mouse.inputtype > 2)
533533   {
534      int val = scc_get_reg_b(0);
534      const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
535      int val = scc_get_reg_b(scc, 0);
535536      sys.mouse.inputtype = 0;
536537      sys.mouse.bufferempty = 1;
537538      val &= ~0x01;
538      scc_set_reg_b(0,val);
539      scc_set_reg_b(scc, 0, val);
539540      logerror("SCC: mouse buffer empty\n");
540541   }
541542
r2927r2928
550551*/
551552static READ16_HANDLER( x68k_scc_r )
552553{
554   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
553555   offset %= 4;
554556   switch(offset)
555557   {
556558   case 0:
557      return scc_r(machine, 0);
559      return scc_r(scc, 0);
558560   case 1:
559561      return x68k_read_mouse(machine);
560562   case 2:
561      return scc_r(machine, 1);
563      return scc_r(scc, 1);
562564   case 3:
563      return scc_r(machine, 3);
565      return scc_r(scc, 3);
564566   default:
565567      return 0xff;
566568   }
r2927r2928
568570
569571static WRITE16_HANDLER( x68k_scc_w )
570572{
573   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
571574   static unsigned char prev;
572575   offset %= 4;
573576
574577   switch(offset)
575578   {
576579   case 0:
577      scc_w(machine, 0,(UINT8)data);
578      if((scc_get_reg_b(5) & 0x02) != prev)
580      scc_w(scc, 0,(UINT8)data);
581      if((scc_get_reg_b(scc, 5) & 0x02) != prev)
579582      {
580         if(scc_get_reg_b(5) & 0x02)  // Request to Send
583         if(scc_get_reg_b(scc, 5) & 0x02)  // Request to Send
581584         {
582            int val = scc_get_reg_b(0);
585            int val = scc_get_reg_b(scc, 0);
583586            sys.mouse.bufferempty = 0;
584587            val |= 0x01;
585            scc_set_reg_b(0,val);
588            scc_set_reg_b(scc, 0,val);
586589         }
587590      }
588591      break;
589592   case 1:
590      scc_w(machine, 2,(UINT8)data);
593      scc_w(scc, 2,(UINT8)data);
591594      break;
592595   case 2:
593      scc_w(machine, 1,(UINT8)data);
596      scc_w(scc, 1,(UINT8)data);
594597      break;
595598   case 3:
596      scc_w(machine, 3,(UINT8)data);
599      scc_w(scc, 3,(UINT8)data);
597600      break;
598601   }
599   prev = scc_get_reg_b(5) & 0x02;
602   prev = scc_get_reg_b(scc, 5) & 0x02;
600603}
601604
602605static TIMER_CALLBACK(x68k_scc_ack)
603606{
607   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
604608   if(sys.mouse.bufferempty != 0)  // nothing to do if the mouse data buffer is empty
605609      return;
606610
r2927r2928
608612      return;
609613
610614   // hard-code the IRQ vector for now, until the SCC code is more complete
611   if((scc_get_reg_a(9) & 0x08) || (scc_get_reg_b(9) & 0x08))  // SCC reg WR9 is the same for both channels
615   if((scc_get_reg_a(scc, 9) & 0x08) || (scc_get_reg_b(scc, 9) & 0x08))  // SCC reg WR9 is the same for both channels
612616   {
613      if((scc_get_reg_b(1) & 0x18) != 0)  // if bits 3 and 4 of WR1 are 0, then Rx IRQs are disabled on this channel
617      if((scc_get_reg_b(scc, 1) & 0x18) != 0)  // if bits 3 and 4 of WR1 are 0, then Rx IRQs are disabled on this channel
614618      {
615         if(scc_get_reg_b(5) & 0x02)  // RTS signal
619         if(scc_get_reg_b(scc, 5) & 0x02)  // RTS signal
616620         {
617621            sys.mouse.irqactive = 1;
618622            current_vector[5] = 0x54;
r2927r2928
16011605   x68k_ct_w  // CT1, CT2 from YM2151 port 0x1b
16021606};
16031607
1604static const struct scc8530_interface scc_interface =
1605{
1606   NULL//x68k_scc_ack
1607};
1608
16091608static const struct rp5c15_interface rtc_intf =
16101609{
16111610   x68k_rtc_alarm_irq
r2927r2928
19991998   memset(&sys,0,sizeof(sys));
20001999
20012000   mfp_init();
2002   scc_init(&scc_interface);
20032001   rp5c15_init(machine, &rtc_intf);
20042002
20052003   cpunum_set_irq_callback(0, x68k_int_ack);
r2927r2928
20372035
20382036   MDRV_DEVICE_ADD( "x68k_hdc", X68KHDC )
20392037
2038   MDRV_DEVICE_ADD( "scc", SCC8530 )
2039
20402040    /* video hardware */
20412041   MDRV_SCREEN_ADD("main", RASTER)
20422042   MDRV_SCREEN_REFRESH_RATE(55.45)
src/mess/drivers/atarist.c
r2927r2928
964964   AM_RANGE(0xff8e20, 0xff8e21) AM_READWRITE(megaste_cache_r, megaste_cache_w)
965965   AM_RANGE(0xfffa00, 0xfffa3f) AM_DEVREADWRITE8(MC68901, MC68901_TAG, mc68901_register_r, mc68901_register_w, 0xff)
966966//  AM_RANGE(0xfffa40, 0xfffa5f) AM_READWRITE(megast_fpu_r, megast_fpu_w)
967   AM_RANGE(0xff8c80, 0xff8c87) AM_READWRITE8(scc_r, scc_w, 0xff00)
967   AM_RANGE(0xff8c80, 0xff8c87) AM_DEVREADWRITE8(SCC8530, "scc", scc_r, scc_w, 0xff00)
968968   AM_RANGE(0xfffc00, 0xfffc01) AM_READWRITE8(acia6850_0_stat_r, acia6850_0_ctrl_w, 0xff00)
969969   AM_RANGE(0xfffc02, 0xfffc03) AM_READWRITE8(acia6850_0_data_r, acia6850_0_data_w, 0xff00)
970970   AM_RANGE(0xfffc04, 0xfffc05) AM_READWRITE8(acia6850_1_stat_r, acia6850_1_ctrl_w, 0xff00)
r2927r2928
17261726   MDRV_MACHINE_START(atarist)
17271727
17281728   // device hardware
1729
17301729   MDRV_DEVICE_ADD(MC68901_TAG, MC68901)
17311730   MDRV_DEVICE_CONFIG(mfp_intf)
1731   MDRV_DEVICE_ADD("scc", SCC8530)
17321732
17331733   // video hardware
17341734   MDRV_SCREEN_ADD("main", RASTER)
r2927r2928
17721772   MDRV_MACHINE_START(atariste)
17731773
17741774   // device hardware
1775
17761775   MDRV_DEVICE_ADD(MC68901_TAG, MC68901)
17771776   MDRV_DEVICE_CONFIG(atariste_mfp_intf)
1777   MDRV_DEVICE_ADD("scc", SCC8530)
17781778
17791779   // video hardware
17801780   MDRV_SCREEN_ADD("main", RASTER)
r2927r2928
18251825   MDRV_MACHINE_START(stbook)
18261826
18271827   // device hardware
1828
18291828   MDRV_DEVICE_ADD(MC68901_TAG, MC68901)
18301829   MDRV_DEVICE_CONFIG(stbook_mfp_intf)
1830   MDRV_DEVICE_ADD("scc", SCC8530)
18311831
18321832   // video hardware
18331833   MDRV_SCREEN_ADD("main", LCD)
src/mess/drivers/ip20.c
r2927r2928
110110
111111static READ32_HANDLER( hpc_r )
112112{
113   const device_config *scc;
114
113115   offset <<= 2;
114116   if( offset >= 0x0e00 && offset <= 0x0e7c )
115117   {
r2927r2928
182184   case 0x0d04:
183185      verboselog( 2, "HPC DUART0 Channel B Data Read\n" );
184186//      return 0;
185      return scc_r(machine, 2);
187      scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
188      return scc_r(scc, 2);
186189      break;
187190   case 0x0d08:
188191      verboselog( 2, "HPC DUART0 Channel A Control Read (%08x)\n", mem_mask    );
r2927r2928
192195   case 0x0d0c:
193196      verboselog( 2, "HPC DUART0 Channel A Data Read\n" );
194197//      return 0;
195      return scc_r(machine, 3);
198      scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
199      return scc_r(scc, 3);
196200      break;
197201   case 0x0d10:
198202//      verboselog( 2, "HPC DUART1 Channel B Control Read\n" );
r2927r2928
249253
250254static WRITE32_HANDLER( hpc_w )
251255{
256   const device_config *scc;
257
252258   offset <<= 2;
253259   if( offset >= 0x0e00 && offset <= 0x0e7c )
254260   {
r2927r2928
383389      break;
384390   case 0x0d00:
385391      verboselog( 2, "HPC DUART0 Channel B Control Write: %08x (%08x)\n", data, mem_mask );
386      scc_w(machine, 0, data);
392      scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
393      scc_w(scc, 0, data);
387394      break;
388395   case 0x0d04:
389396      verboselog( 2, "HPC DUART0 Channel B Data Write: %08x (%08x)\n", data, mem_mask );
390      scc_w(machine, 2, data);
397      scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
398      scc_w(scc, 2, data);
391399      break;
392400   case 0x0d08:
393401      verboselog( 2, "HPC DUART0 Channel A Control Write: %08x (%08x)\n", data, mem_mask );
394      scc_w(machine, 1, data);
402      scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
403      scc_w(scc, 1, data);
395404      break;
396405   case 0x0d0c:
397406      verboselog( 2, "HPC DUART0 Channel A Data Write: %08x (%08x)\n", data, mem_mask );
398      scc_w(machine, 3, data);
407      scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
408      scc_w(scc, 3, data);
399409      break;
400410   case 0x0d10:
401411      if( ( data & 0x000000ff ) >= 0x00000020 )
r2927r2928
582592
583593static DRIVER_INIT( ip204415 )
584594{
585   scc_init(NULL);
586595   wd33c93_init(&scsi_intf);
587596   add_exit_callback(machine, ip204415_exit);
588597}
r2927r2928
635644
636645   MDRV_SOUND_ADD( CDDA, 0 )
637646   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
647
648   MDRV_DEVICE_ADD("scc", SCC8530)
638649MACHINE_DRIVER_END
639650
640651ROM_START( ip204415 )
docs/messnew.txt
r2927r2928
165165
166166- Code cleanups.  [Atari Ace]
167167
168- Changed the 8530 SCC chip implementation to use MAME's device system.  [Nate
169  Woods]
168170
169171
172
1701730.125
171174
172175New System Drivers Supported (in no particular order):

Previous 15994 Revisions Next


© 1998-2018 The MESS Team