Previous 15994 Revisions Next

r14802 Sunday 25th March, 2012 at 22:57:06 UTC by R. Belmont
Cleanup: remove alleged Mockingboard support, which was nothing of the kind (the real thing listens to Cn00, not C0n0, for starters...) (nw)
[src/mess]mess.mak
[src/mess/drivers]apple2.c apple2gs.c
[src/mess/machine]mockngbd.c

src/mess/machine/mockngbd.c
r14801r14802
1/*********************************************************************
2
3    mockngbd.c
4
5    Implementation of the Apple II Mockingboard
6
7    The Mockingboard comes in different flavours:
8
9    * Sound I:     one AY-3-8910 chip for three audio channels
10    * Speech I:    one SC-01 chip
11    * Sound II:    two AY-3-8910 chips for six audio channels
12    * Sound/Speech I:  one AY-3-8910 and one SC-01
13
14    * Mockingboard A:  two AY-3-8913 chips for six audio channels and two open sockets for SSI-263 speech chips
15    * Mockingboard B:  not a soundcard per se, but just two SSI-263 speech chip upgrade for Mockingboard A
16    * Mockingboard C:  two AY-3-8913 and one SSI-263 (essentially a Mockingboard A with the upgrade pre-installed, only one speech chip allowed)
17    * Mockingboard D:  for Apple IIc only, two AY-3-8913 and one SSI-263, connected to the serial port and its own particular driver
18    * Mockingboard M:  bundled with Mindscape's Bank Street Music Writer, with two AY-3-8913 chips and an open socket
19                       for one speech chip. This model included a headphone jack and a jumper to permit sound to be played
20                       through the Apple's built-in speaker.
21    * Mockingboard v1: a clone of the Mockingboard A from ReactiveMicro.com
22
23
24    TODO - When sound cores and the 6522 VIA become devices, and devices
25    can contain other devices, start containing AY8910 and 6522VIA
26    implementations
27
28*********************************************************************/
29
30#include "mockngbd.h"
31#include "sound/ay8910.h"
32
33
34/***************************************************************************
35    PARAMETERS
36***************************************************************************/
37
38#define LOG_MOCKINGBOARD   0
39
40
41/***************************************************************************
42    TYPE DEFINITIONS
43***************************************************************************/
44
45typedef struct _mockingboard_token mockingboard_token;
46struct _mockingboard_token
47{
48   UINT8 flip1;
49   UINT8 flip2;
50   UINT8 latch0;
51   UINT8 latch1;
52};
53
54
55/***************************************************************************
56    INLINE FUNCTIONS
57***************************************************************************/
58
59INLINE mockingboard_token *get_token(device_t *device)
60{
61   assert(device != NULL);
62   assert(device->type() == MOCKINGBOARD);
63   return (mockingboard_token *) downcast<legacy_device_base *>(device)->token();
64}
65
66
67
68/***************************************************************************
69    FUNCTION PROTOTYPES
70***************************************************************************/
71
72/*-------------------------------------------------
73    DEVICE_START(mockingboard) - device start
74    function
75-------------------------------------------------*/
76
77static DEVICE_START(mockingboard)
78{
79}
80
81
82
83/*-------------------------------------------------
84    DEVICE_RESET(mockingboard) - device reset
85    function
86-------------------------------------------------*/
87
88static DEVICE_RESET(mockingboard)
89{
90   mockingboard_token *token = get_token(device);
91   token->flip1 = 0x00;
92   token->flip2 = 0x00;
93   token->latch0 = 0x00;
94   token->latch1 = 0x00;
95
96   /* TODO: fix this */
97   /* What follows is pure filth. It abuses the core like an angry pimp on a bad hair day. */
98
99   /* Since we know that the Mockingboard has no code ROM, we'll copy into the slot ROM space
100       an image of the onboard ROM so that when an IRQ bankswitches to the onboard ROM, we read
101       the proper stuff. Without this, it will choke and try to use the memory handler above, and
102       fail miserably. That should really be fixed. I beg you -- if you are reading this comment,
103       fix this :) */
104//  memcpy (apple2_slotrom(slot), &apple_rom[0x0000 + (slot * 0x100)], 0x100);
105}
106
107
108
109/*-------------------------------------------------
110    mockingboard_r - device read function
111-------------------------------------------------*/
112
113READ8_DEVICE_HANDLER(mockingboard_r)
114{
115//  UINT8 result = 0x00;
116   mockingboard_token *token = get_token(device);
117
118   switch (offset)
119   {
120      /* This is used to ID the board */
121      case 0x04:
122         token->flip1 ^= 0x08;
123//          result = token->flip1;
124         break;
125
126      case 0x84:
127         token->flip2 ^= 0x08;
128//          result = token->flip2;
129         break;
130
131      default:
132         if (LOG_MOCKINGBOARD)
133            logerror("mockingboard_r unmapped, offset: %02x, pc: %s\n", offset, device->machine().describe_context());
134         break;
135   }
136   return 0x00;
137}
138
139
140
141/*-------------------------------------------------
142    mockingboard_w - device write function
143-------------------------------------------------*/
144
145WRITE8_DEVICE_HANDLER(mockingboard_w)
146{
147   device_t *ay8910_1 = device->machine().device("ay8910.1");
148   device_t *ay8910_2 = device->machine().device("ay8910.2");
149   mockingboard_token *token = get_token(device);
150
151   if (LOG_MOCKINGBOARD)
152      logerror("mockingboard_w, $%02x:%02x\n", offset, data);
153
154   /* There is a 6522 in here which interfaces to the 8910s */
155   switch (offset)
156   {
157      case 0x00: /* ORB1 */
158         switch (data)
159         {
160            case 0x00: /* reset */
161               ay8910_1->reset();
162               break;
163            case 0x04: /* make inactive */
164               break;
165            case 0x06: /* write data */
166               ay8910_data_w(ay8910_1, 0, token->latch0);
167               break;
168            case 0x07: /* set register */
169               ay8910_address_w(ay8910_1, 0, token->latch0);
170               break;
171         }
172         break;
173
174      case 0x01: /* ORA1 */
175         token->latch0 = data;
176         break;
177
178      case 0x02: /* DDRB1 */
179      case 0x03: /* DDRA1 */
180         break;
181
182      case 0x80: /* ORB2 */
183         switch (data)
184         {
185            case 0x00: /* reset */
186               ay8910_2->reset();
187               break;
188            case 0x04: /* make inactive */
189               break;
190            case 0x06: /* write data */
191               ay8910_data_w(ay8910_2, 0, token->latch1);
192               break;
193            case 0x07: /* set register */
194               ay8910_address_w(ay8910_2, 0, token->latch1);
195               break;
196         }
197         break;
198
199      case 0x81: /* ORA2 */
200         token->latch1 = data;
201         break;
202
203      case 0x82: /* DDRB2 */
204      case 0x83: /* DDRA2 */
205         break;
206   }
207}
208
209
210
211/*-------------------------------------------------
212    DEVICE_GET_INFO(mockingboard) - device get info
213    function
214-------------------------------------------------*/
215
216DEVICE_GET_INFO(mockingboard)
217{
218   switch (state)
219   {
220      /* --- the following bits of info are returned as 64-bit signed integers --- */
221      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(mockingboard_token);      break;
222      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
223
224      /* --- the following bits of info are returned as pointers to data or functions --- */
225      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(mockingboard);   break;
226      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
227      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(mockingboard);   break;
228
229      /* --- the following bits of info are returned as NULL-terminated strings --- */
230      case DEVINFO_STR_NAME:                     strcpy(info->s, "Apple II Mockingboard");         break;
231      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Apple II Mockingboard");         break;
232      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                     break;
233      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                     break;
234   }
235}
236
237DEFINE_LEGACY_DEVICE(MOCKINGBOARD, mockingboard);
src/mess/drivers/apple2gs.c
r14801r14802
5656#include "machine/ap2_slot.h"
5757#include "machine/ap2_lang.h"
5858#include "machine/applefdc.h"
59#include "machine/mockngbd.h"
6059#include "machine/8530scc.h"
61#include "sound/ay8910.h"
6260#include "sound/speaker.h"
6361#include "machine/ram.h"
6462
r14801r14802
176174   /* nothing in the address map - everything is added dynamically */
177175ADDRESS_MAP_END
178176
179
180static const ay8910_interface apple2_ay8910_interface =
181{
182   AY8910_LEGACY_OUTPUT,
183   AY8910_DEFAULT_LOADS,
184   DEVCB_NULL
185};
186
187177static MACHINE_CONFIG_START( apple2gs, apple2gs_state )
188178   /* basic machine hardware */
189179   MCFG_CPU_ADD("maincpu", G65816, APPLE2GS_14M/5)
r14801r14802
212202   MCFG_SOUND_ADD("a2speaker", SPEAKER_SOUND, 0)
213203   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
214204   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
215   MCFG_SOUND_ADD("ay8913.1", AY8913, 1022727)
216   MCFG_SOUND_CONFIG(apple2_ay8910_interface)
217   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
218   MCFG_SOUND_ADD("ay8913.2", AY8913, 1022727)
219   MCFG_SOUND_CONFIG(apple2_ay8910_interface)
220   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
221205
222206   MCFG_ES5503_ADD("es5503", APPLE2GS_7M, apple2gs_doc_irq, apple2gs_adc_read)
223207   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
r14801r14802
225209
226210   /* slot devices */
227211   MCFG_APPLE2_LANGCARD_ADD("langcard")
228   MCFG_MOCKINGBOARD_ADD("mockingboard")
229212   MCFG_IWM_ADD("fdc", apple2_fdc_interface)
230213
231214   /* slots */
232215   MCFG_APPLE2_SLOT_ADD(0, "langcard", apple2_langcard_r, apple2_langcard_w, 0, 0, 0, 0)
233   MCFG_APPLE2_SLOT_ADD(4, "mockingboard", mockingboard_r, mockingboard_w, 0, 0, 0, 0)
234216   MCFG_APPLE2_SLOT_ADD(6, "fdc", applefdc_r, applefdc_w, 0, 0, 0, 0)
235217
236218   /* SCC */
src/mess/drivers/apple2.c
r14801r14802
194194#include "machine/ap2_slot.h"
195195#include "machine/ap2_lang.h"
196196#include "machine/applefdc.h"
197#include "machine/mockngbd.h"
198//#include "machine/a2z80.h"
199#include "sound/ay8910.h"
200197#include "sound/speaker.h"
201198#include "machine/ram.h"
202199#include "machine/a2cffa.h"
r14801r14802
557554   palette_set_colors(machine, 0, apple2_palette, ARRAY_LENGTH(apple2_palette));
558555}
559556
560static const ay8910_interface apple2_ay8910_interface =
561{
562   AY8910_LEGACY_OUTPUT,
563   AY8910_DEFAULT_LOADS,
564   DEVCB_NULL
565};
566
567557static const floppy_interface apple2_floppy_interface =
568558{
569559   DEVCB_NULL,
r14801r14802
611601   MCFG_SPEAKER_STANDARD_MONO("mono")
612602   MCFG_SOUND_ADD("a2speaker", SPEAKER_SOUND, 0)
613603   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
614   MCFG_SOUND_ADD("ay8913.1", AY8913, 1022727)
615   MCFG_SOUND_CONFIG(apple2_ay8910_interface)
616   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
617   MCFG_SOUND_ADD("ay8913.2", AY8913, 1022727)
618   MCFG_SOUND_CONFIG(apple2_ay8910_interface)
619   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
620604
621605   /* slot devices */
622606   MCFG_APPLE2_LANGCARD_ADD("langcard")
623   MCFG_MOCKINGBOARD_ADD("mockingboard")
624607   MCFG_APPLEFDC_ADD("fdc", apple2_fdc_interface)
625608
626609   /* slots */
627610   MCFG_APPLE2_SLOT_ADD(0, "langcard", apple2_langcard_r, apple2_langcard_w, 0, 0, 0, 0)
628   MCFG_APPLE2_SLOT_ADD(4, "mockingboard", mockingboard_r, mockingboard_w, 0, 0, 0, 0)
629611   MCFG_APPLE2_SLOT_ADD(6, "fdc", applefdc_r, applefdc_w, 0, 0, 0, 0)
630612
631613   MCFG_LEGACY_FLOPPY_APPLE_2_DRIVES_ADD(apple2_floppy_interface,15,16)
src/mess/mess.mak
r14801r14802
643643    $(MESS_MACHINE)/a2bus.o     \
644644   $(MESS_MACHINE)/ap2_slot.o   \
645645   $(MESS_MACHINE)/ap2_lang.o   \
646   $(MESS_MACHINE)/mockngbd.o   \
647646   $(MESS_MACHINE)/a2cffa.o   \
648647   $(MESS_MACHINE)/lisa.o      \
649648   $(MESS_DRIVERS)/lisa.o      \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team