Previous 15994 Revisions Next

r4364 Sunday 1st March, 2009 at 21:10:51 UTC by Nathan Woods
[COCO] Added "unwired" (i.e. - can't connect to anything) support for the RS-232
PAK. This is merely a curiosity for now. (bug #1772)
[docs]messnew.txt
[hash]coco.hsi
[src/mess]mess.mak
[src/mess/devices]coco_232.c* cococart.c cococart.h

hash/coco.hsi
r4363r4364
518518  <hash crc32="7f0edf28" sha1="6ca61e29c136ec8201492ca7f9eb050912f3582d" name="Extended ADOS">
519519    <pcb>coco_fdc</pcb>
520520  </hash>
521  <hash crc32="d990e1f9" name="RS-232 Pak">
522    <pcb>rs232</pcb>
523  </hash>
521524</hashfile>
src/mess/mess.mak
r4363r4364
687687   $(MESS_DEVICES)/cococart.o   \
688688   $(MESS_DEVICES)/coco_fdc.o   \
689689   $(MESS_DEVICES)/coco_pak.o   \
690   $(MESS_DEVICES)/coco_232.o   \
690691   $(MESS_DEVICES)/orch90.o   \
691692
692693$(MESSOBJ)/mc10.a:   \
src/mess/devices/cococart.h
r4363r4364
2525#define COCO_CARTRIDGE_PCB_PAK                  DEVICE_GET_INFO_NAME(coco_cartridge_pcb_pak)
2626#define COCO_CARTRIDGE_PCB_PAK_BANKED16K         DEVICE_GET_INFO_NAME(coco_cartridge_pcb_pak_banked16k)
2727#define COCO_CARTRIDGE_PCB_ORCH90               DEVICE_GET_INFO_NAME(coco_cartridge_pcb_orch90)
28#define COCO_CARTRIDGE_PCB_RS232               DEVICE_GET_INFO_NAME(coco_cartridge_pcb_rs232)
2829#define COCO_CARTRIDGE_PCB_SSC                  DEVICE_GET_INFO_NAME(coco_cartridge_pcb_speechsound)
2930
3031enum
r4363r4364
7980DEVICE_GET_INFO(coco_cartridge_pcb_pak);
8081DEVICE_GET_INFO(coco_cartridge_pcb_pak_banked16k);
8182DEVICE_GET_INFO(coco_cartridge_pcb_orch90);
83DEVICE_GET_INFO(coco_cartridge_pcb_rs232);
8284DEVICE_GET_INFO(coco_cartridge_pcb_speechsound);
8385
8486/* hack to support twiddling the Q line */
src/mess/devices/coco_232.c
r0r4364
1/***************************************************************************
2
3   coco_232.c
4
5   Code for emulating the CoCo RS-232 PAK
6
7***************************************************************************/
8
9#include "driver.h"
10#include "device.h"
11#include "cococart.h"
12#include "machine/6551.h"
13
14
15/***************************************************************************
16    CONSTANTS
17***************************************************************************/
18
19#define UART_TAG      "uart"
20
21
22/***************************************************************************
23    TYPE DEFINITIONS
24***************************************************************************/
25
26typedef struct _coco_rs232_pcb_t coco_rs232_pcb_t;
27struct _coco_rs232_pcb_t
28{
29   const device_config *cococart;
30   const device_config *cart;
31   const device_config *uart;
32};
33
34
35/***************************************************************************
36    INLINE FUNCTIONS
37***************************************************************************/
38
39INLINE coco_rs232_pcb_t *get_token(const device_config *device)
40{
41   assert(device != NULL);
42   assert(device->type == COCO_CARTRIDGE_PCB_RS232);
43   return (coco_rs232_pcb_t *) device->token;
44}
45
46
47/***************************************************************************
48    IMPLEMENTATION
49***************************************************************************/
50
51/*-------------------------------------------------
52    DEVICE_START(coco_rs232)
53-------------------------------------------------*/
54
55static DEVICE_START(coco_rs232)
56{
57   coco_rs232_pcb_t *pak_pcb = get_token(device);
58   astring *tempstring = astring_alloc();
59
60   memset(pak_pcb, 0, sizeof(*pak_pcb));
61   pak_pcb->cococart = device->owner->owner;
62   pak_pcb->cart = device->owner;
63   pak_pcb->uart = devtag_get_device(device->machine, ACIA6551, device_build_tag(tempstring, device, UART_TAG));
64
65   astring_free(tempstring);
66}
67
68
69/*-------------------------------------------------
70    READ8_DEVICE_HANDLER(coco_rs232_ff40_r)
71-------------------------------------------------*/
72
73static READ8_DEVICE_HANDLER(coco_rs232_ff40_r)
74{
75   UINT8 result = 0x00;
76   coco_rs232_pcb_t *pak_pcb = get_token(device);
77
78   if ((offset >= 0x28) && (offset <= 0x2F))
79      result = acia_6551_r(pak_pcb->uart, offset - 0x28);
80   
81   return result;
82}
83
84
85/*-------------------------------------------------
86    WRITE8_DEVICE_HANDLER(coco_rs232_ff40_r)
87-------------------------------------------------*/
88
89static WRITE8_DEVICE_HANDLER(coco_rs232_ff40_w)
90{
91   coco_rs232_pcb_t *pak_pcb = get_token(device);
92
93   if ((offset >= 0x28) && (offset <= 0x2F))
94      acia_6551_w(pak_pcb->uart, offset - 0x28, data);
95}
96
97
98/*-------------------------------------------------
99    DEVICE_GET_INFO(coco_cartridge_pcb_rs232)
100-------------------------------------------------*/
101
102DEVICE_GET_INFO(coco_cartridge_pcb_rs232)
103{
104   static MACHINE_DRIVER_START(coco_rs232)
105      MDRV_ACIA6551_ADD(UART_TAG)
106   MACHINE_DRIVER_END
107
108   switch(state)
109   {
110      /* --- the following bits of info are returned as 64-bit signed integers --- */
111      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(coco_rs232_pcb_t);            break;
112      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
113      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
114
115      /* --- the following bits of info are returned as pointers to data --- */
116      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_DRIVER_NAME(coco_rs232);   break;
117
118      /* --- the following bits of info are returned as pointers to functions --- */
119      case DEVINFO_FCT_SET_INFO:                  /* Nothing */                        break;
120      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(coco_rs232);   break;
121      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
122      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
123      case COCOCARTINFO_FCT_FF40_R:               info->f = (genf *) coco_rs232_ff40_r;      break;
124      case COCOCARTINFO_FCT_FF40_W:               info->f = (genf *) coco_rs232_ff40_w;      break;
125
126      /* --- the following bits of info are returned as NULL-terminated strings --- */
127      case DEVINFO_STR_NAME:                     strcpy(info->s, "CoCo RS-232 PAK");         break;
128      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "CoCo RS-232 PAK");         break;
129      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
130      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
131      case DEVINFO_STR_CREDITS:                  /* Nothing */                        break;
132   }
133}
src/mess/devices/cococart.c
r4363r4364
348348   MDRV_CARTSLOT_PCBTYPE(0, "coco_fdc",   COCO_CARTRIDGE_PCB_FDC_COCO)
349349   MDRV_CARTSLOT_PCBTYPE(1, "banked_16k",   COCO_CARTRIDGE_PCB_PAK_BANKED16K)
350350   MDRV_CARTSLOT_PCBTYPE(2, "orch90",      COCO_CARTRIDGE_PCB_ORCH90)
351   //MDRV_CARTSLOT_PCBTYPE(3, "coco_ssc",   COCO_CARTRIDGE_PCB_SSC)
352   MDRV_CARTSLOT_PCBTYPE(3, "",         COCO_CARTRIDGE_PCB_PAK)
351   MDRV_CARTSLOT_PCBTYPE(3, "rs232",      COCO_CARTRIDGE_PCB_RS232)
352   //MDRV_CARTSLOT_PCBTYPE(4, "coco_ssc",   COCO_CARTRIDGE_PCB_SSC)
353   MDRV_CARTSLOT_PCBTYPE(4, "",         COCO_CARTRIDGE_PCB_PAK)
353354MACHINE_DRIVER_END
354355
355356/*-------------------------------------------------
docs/messnew.txt
r4363r4364
4040
4141- [COCO] Fixed "Cartridge Auto-Start" setting.  (bug #1772) [Nathan Woods]
4242
43- [COCO] Added "unwired" (i.e. - can't connect to anything) support for the
44  RS-232 PAK.  This is merely a curiosity for now.  (bug #1772) [Nathan Woods]
45
4346- [COCO3] Fixed Composite Monochrome bit.  (bug #1767)  [Nathan Woods]
4447
4548- [COMPIS] Updated to use the new centronics interface.  [Dirk Best]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team