Previous 15994 Revisions Next

r3293 Friday 19th September, 2008 at 14:02:29 UTC by Curt Coder
[VIP] Added VP-590 color board, VP-595 Simple Sound Board, and a single VP-580 Auxiliary Keyboard emulation. Added tape led blinking, fixed memory sizes. Added CDP1863 programmable frequency generator
emulation.
[src/mess]mess.mak messdriv.c
[src/mess/audio]cdp1863.c* cdp1863.h*
[src/mess/drivers]vip.c
[src/mess/includes]vip.h

src/mess/audio/cdp1863.c
r0r3293
1/*
2 
3   TODO:
4 
5   - what happens if you connect both clocks?
6   - convert to sound device when possible
7 
8*/
9 
10#include "driver.h"
11#include "sndintrf.h"
12#include "streams.h"
13#include "cpu/cdp1802/cdp1802.h"
14#include "audio/cdp1863.h"
15 
16#define CDP1863_DEFAULT_LATCH   0x35
17 
18typedef struct _cdp1863_t cdp1863_t;
19struct _cdp1863_t
20{
21   const cdp1863_interface *intf;   /* interface */
22 
23   sound_stream *stream;         /* sound output */
24 
25   /* sound state */
26   int oe;                     /* output enable */
27   int latch;                  /* sound latch */
28   INT16 signal;               /* current signal */
29   int incr;                  /* initial wave state */
30};
31 
32INLINE cdp1863_t *get_safe_token(const device_config *device)
33{
34   assert(device != NULL);
35   assert(device->token != NULL);
36 
37   return (cdp1863_t *)device->token;
38}
39 
40/* Load Tone Latch */
41 
42WRITE8_DEVICE_HANDLER( cdp1863_str_w )
43{
44   cdp1863_t *cdp1863 = get_safe_token(device);
45   double frequency;
46 
47   cdp1863->latch = data;
48 
49   if (cdp1863->intf->clock1 > 0)
50   {
51      /* CLK1 is pre-divided by 4 */
52      frequency = cdp1863->intf->clock1 / 4 / (data + 1) / 2;
53   }
54   else
55   {
56      /* CLK2 is pre-divided by 8 */
57      frequency = cdp1863->intf->clock2 / 8 / (data + 1) / 2;
58   }
59 
60   beep_set_frequency(0, frequency);
61}
62 
63/* Output Enable */
64 
65void cdp1863_oe_w(const device_config *device, int level)
66{
67   cdp1863_t *cdp1863 = get_safe_token(device);
68 
69   cdp1863->oe = level;
70 
71   beep_set_state(0, level);
72}
73 
74#ifdef UNUSED_FUNCTION
75static void cdp1863_sound_update(const device_config *device, stream_sample_t **inputs, stream_sample_t **_buffer, int length)
76{
77   cdp1863_t *cdp1863 = get_safe_token(device);
78 
79   INT16 signal = cdp1863->signal;
80   stream_sample_t *buffer = _buffer[0];
81 
82   memset(buffer, 0, length * sizeof(*buffer));
83 
84   if (cdp1863->oe)
85   {
86      double frequency;
87      int rate = device->machine->sample_rate / 2;
88 
89      /* get progress through wave */
90      int incr = cdp1863->incr;
91 
92      if (cdp1863->intf->clock1 > 0)
93      {
94         /* CLK1 is pre-divided by 4 */
95         frequency = cdp1863->intf->clock1 / 4 / (cdp1863->latch + 1) / 2;
96      }
97      else
98      {
99         /* CLK2 is pre-divided by 8 */
100         frequency = cdp1863->intf->clock2 / 8 / (cdp1863->latch + 1) / 2;
101      }
102 
103      if (signal < 0)
104      {
105         signal = -0x7fff;
106      }
107      else
108      {
109         signal = 0x7fff;
110      }
111 
112      while( length-- > 0 )
113      {
114         *buffer++ = signal;
115         incr -= frequency;
116         while( incr < 0 )
117         {
118            incr += rate;
119            signal = -signal;
120         }
121      }
122 
123      /* store progress through wave */
124      cdp1863->incr = incr;
125      cdp1863->signal = signal;
126   }
127}
128#endif
129 
130/* Device Interface */
131 
132static DEVICE_START( cdp1863 )
133{
134   cdp1863_t *cdp1863 = get_safe_token(device);
135   char unique_tag[30];
136 
137   /* validate arguments */
138   assert(device != NULL);
139   assert(device->tag != NULL);
140   assert(strlen(device->tag) < 20);
141 
142   cdp1863->intf = device->static_config;
143 
144   assert(cdp1863->intf != NULL);
145   assert((cdp1863->intf->clock1 > 0) || (cdp1863->intf->clock2 > 0));
146 
147   cdp1863->oe = 1;
148 
149   /* register for state saving */
150   state_save_combine_module_and_tag(unique_tag, "CDP1863", device->tag);
151 
152   state_save_register_item(unique_tag, 0, cdp1863->oe);
153   state_save_register_item(unique_tag, 0, cdp1863->latch);
154   state_save_register_item(unique_tag, 0, cdp1863->signal);
155   state_save_register_item(unique_tag, 0, cdp1863->incr);
156 
157   return DEVICE_START_OK;
158}
159 
160static DEVICE_RESET( cdp1863 )
161{
162   cdp1863_t *cdp1863 = get_safe_token(device);
163 
164   cdp1863->latch = CDP1863_DEFAULT_LATCH;
165}
166 
167static DEVICE_SET_INFO( cdp1863 )
168{
169   switch (state)
170   {
171      /* no parameters to set */
172   }
173}
174 
175DEVICE_GET_INFO( cdp1863 )
176{
177   switch (state)
178   {
179      /* --- the following bits of info are returned as 64-bit signed integers --- */
180      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(cdp1863_t);            break;
181      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
182      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
183 
184      /* --- the following bits of info are returned as pointers to data or functions --- */
185      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(cdp1863); break;
186      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(cdp1863);   break;
187      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
188      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(cdp1863);   break;
189 
190      /* --- the following bits of info are returned as NULL-terminated strings --- */
191      case DEVINFO_STR_NAME:                     info->s = "RCA CDP1863";               break;
192      case DEVINFO_STR_FAMILY:                  info->s = "RCA CDP1800";               break;
193      case DEVINFO_STR_VERSION:                  info->s = "1.0";                     break;
194      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                     break;
195      case DEVINFO_STR_CREDITS:                  info->s = "Copyright MESS Team";         break;
196   }
197}
src/mess/audio/cdp1863.h
r0r3293
1/*
2 
3           CDP1863 CMOS 8-Bit Programmable Frequency Generator
4 
5                        ________________
6            _RESET    1   ---|      \/      |---  16  Vdd
7              CLK 2    2   ---|            |---  15  OE
8             CLK 1    3   ---|            |---  14  OUT
9               STR    4   ---|   CDP1863C   |---  13  DI7
10               DI0    5   ---|            |---  12  DI6
11               DI1    6   ---|            |---  11  DI5
12               DI2    7   ---|            |---  10  DI4
13               Vss    8   ---|________________|---  9   DI3
14 
15*/
16 
17#ifndef __CDP1863__
18#define __CDP1863__
19 
20#include "sound/beep.h"
21 
22#define CDP1863      DEVICE_GET_INFO_NAME(cdp1863)
23 
24/* interface */
25typedef struct _cdp1863_interface cdp1863_interface;
26struct _cdp1863_interface
27{
28   int clock1;               /* the clock 1 (pin 3) of the chip */
29   int clock2;               /* the clock 2 (pin 2) of the chip */
30};
31#define CDP1863_INTERFACE(name) const cdp1863_interface (name)=
32 
33/* device interface */
34DEVICE_GET_INFO( cdp1863 );
35 
36/* load tone latch */
37WRITE8_DEVICE_HANDLER( cdp1863_str_w );
38 
39/* output enable */
40void cdp1863_oe_w(const device_config *device, int level);
41 
42#endif
src/mess/includes/vip.h
r3292r3293
66#define CDP1802_TAG "u1"
77#define CDP1861_TAG "u2"
88#define CDP1862_TAG "cdp1862"
9#define CDP1863_TAG "cdp1863"
910 
1011#define VP590_COLOR_RAM_SIZE   0x100
1112 
r3292r3293
1516#define VIP_VIDEO_CDP1861   0
1617#define VIP_VIDEO_CDP1862   1
1718 
19#define VIP_SOUND_SPEAKER   0
20#define VIP_SOUND_CDP1863   1
21#define VIP_SOUND_VP550      2
22#define VIP_SOUND_VP551      3
23 
1824typedef struct _vip_state vip_state;
1925struct _vip_state
2026{
27   /* cpu state */
28   int reset;                  /* reset activated */
29 
2130   /* video state */
22   int cdp1861_efx;      /* EFx */
23   UINT8 *colorram;      /* CDP1862 color RAM */
31   const device_config *cdp1861;   /* CDP1861 */
32   const device_config *cdp1862;   /* CDP1862 */
33   int cdp1861_efx;            /* EFx */
34   UINT8 *colorram;            /* CDP1862 color RAM */
2435 
36   /* sound state */
37   const device_config *cdp1863;   /* CDP1863 */
38 
2539   /* keyboard state */
26   int keylatch;         /* key latch */
27   int reset;            /* reset activated */
28 
29   /* devices */
30   const device_config *cdp1861;
31   const device_config *cdp1862;
40   int keylatch;               /* key latch */
3241};
3342 
3443#endif
src/mess/messdriv.c
r3292r3293
8181   /* SEGA */
8282   DRIVER( sg1000 )   /* Sega SG-1000 (Japan)                        */
8383   DRIVER( sg1000m2 )   /* Sega SG-1000 Mark II (Japan)                  */
84//   DRIVER( omv )      /* Tsukuda Original Othello Multivision            */
8584   DRIVER( sc3000 )   /* Sega SC-3000 (Japan)                        */
8685   DRIVER( sc3000h )   /* Sega SC-3000H (Japan)                     */
8786   DRIVER( sf7000 )   /* Sega SC-3000 w/ SF-7000 (Japan)               */
87//   DRIVER( omv1000 )   /* Tsukuda Original Othello Multivision   FG-1000      */
88//   DRIVER( omv2000 )   /* Tsukuda Original Othello Multivision   FG-2000      */
8889
8990   DRIVER( gamegear )   /* Sega GameGear                           */
9091   DRIVER( gamegeaj )   /* Sega GameGear (Japan)                     */
r3292r3293
123124   /* RCA */
124125   DRIVER( vip )      /* 1977 Cosmac VIP                           */
125126   DRIVER( studio2 )   /* 1977 Studio II                           */
126//   DRIVER( m9016tc )   /* 1978 Mustang 9016 Telespiel Computer            */
127//   DRIVER( mtc9016 )   /* 1978 Mustang 9016 Telespiel Computer            */
127128
128129   /* FAIRCHILD */
129130   DRIVER( channelf )   /* Fairchild Channel F VES - 1976               */
src/mess/mess.mak
r3292r3293
761761   $(MESS_DRIVERS)/vip.o  \
762762   $(MESS_DRIVERS)/studio2.o  \
763763   $(MESS_VIDEO)/cdp1861.o \
764   $(MESS_VIDEO)/cdp1862.o
764   $(MESS_VIDEO)/cdp1862.o \
765   $(MESS_AUDIO)/cdp1863.o
765766
766767$(MESSOBJ)/fairch.a: \
767768   $(MESS_VIDEO)/channelf.o \
src/mess/drivers/vip.c
r3292r3293
11/*
22
3RCA COSMAC VIP
4
5PCB Layout
6----------
7
8|-------------------------------------------------------------------------------|
9|   |---------------CN1---------------|      |---------------CN2---------------|   |
10|CN6                                                         |
11|   |---------|               |---------|            4050      4050      |
12|   | CDPR566 |               | CDP1861 |                           CN3   |
13|   |---------|               |---------|                              |
14|                                                         CN4   |
15| 7805                              |---------|       |--------|         |
16|      2114               3.521280MHz   |  4508   |       |  4508  |      CN5   |
17|                                 |---------|       |--------|         |
18|      2114                                     |--------|         |
19|                        7474  7400   4049  4051  4028 |  4515  |   CA3401   |   
20|      2114                                     |--------|         |
21|            |-------------|                                       |
22|      2114   |   CDP1802     |                                       |
23|            |-------------|            LED1                        |
24|      2114                                                   |
25|                                 LED2                        |
26|      2114   4556   4042                                       |
27|                                 LED3                        |
28|  555   2114   4011   4013                                       |
29|                                 SW1                           |
30|      2114                                                   |
31|                                                            |
32|-------------------------------------------------------------------------------|
33
34Notes:
35    All IC's shown.
36   
37    CDPR566   - Programmed CDP1832 512 x 8-Bit Static ROM
38   2114   - 2114 4096 Bit (1024x4) NMOS Static RAM
39   CDP1802   - RCA CDP1802 CMOS 8-Bit Microprocessor
40   CDP1861   - RCA CDP1861 Video Display Controller
41   CA3401   - Quad Single-Supply Op-Amp
42   CN1      - expansion interface connector
43   CN2      - parallel I/O interface connector
44   CN3      - video connector
45   CN4      - tape in connector
46   CN5      - tape out connector
47   CN6      - power connector
48   LED1   - power led
49   LED2   - Q led
50   LED3   - tape led
51   SW1      - Run/Reset switch
52
53*/
54
55/*
56
357    TODO:
458
5   - CDP1862 colorram
6    - pcb layout guru-style readme
7    - artwork for leds
8    - VP-550/551 Super Sound Board (VP-550 2 channel, VP-551 4 channel sound)
59   - CDP1863 clocks
60   - second VP580 keypad
61   - colorram bit order
62
63    - VP-590 Color Board (CDP1862, 2 keypad connectors for VP-580)
64    - VP-595 Simple Sound Board (CDP1864-like sound generator)
965   - VP-580 Expansion Keyboard (connects to VP-585 or VP-590)
1066   - VP-585 Expansion Keyboard Interface (2 keypad connectors for VP-580)
11    - VP-590 Color Board (CDP1862, 2 keypad connectors for VP-580)
12    - VP-595 Simple Sound Board (CDP1863?)
67    - VP-550/551 Super Sound Board (VP-550 2 channel, VP-551 4 channel sound)
1368    - VP-601/611 ASCII Keyboard (VP-601 58 keys, VP611 58 keys + 16 keys numerical keypad)
1469    - VP-700 Expanded Tiny Basic Board (4 KB ROM expansion)
1570
16   - VIP Blockout
71*/
1772
18      1. This game is programmed in color and has sound effects.  It can be used with the
19      VP590 Color Board and VP595 Simple Sound Board, or it will run on a standard VIP
20      without color and sound enhancement.
73/*
2174
22      2. This game requires a minimum of one VIP expansion keyboard (VP580) or two expansion
23      keyboards for exciting "Dual action".  Expansion keyboards plug directly into the
24      VP590 Color graphics board or into the VP585 expansion keyboard interface.
75   VP-711 COSMAC MicroComputer $199
76   (CDP18S711) Features RCA COSMAC microprocessor. 2K RAM, expandable to
77   32K (4K on-board). Built-in cassette interface and video interface.
78   16 key hexidecimal keypad. ROM operating system. CHIP-8 language and
79   machine language. Tone generator and speaker. 8-bit input port, 8-bit
80   output port, and full system expansion connector. Power supply and 3
81   manuals (VP-311, VP-320, MPM201 B) included. Completely assembled.
2582
83   VP-44 VP-711 RAM On-Board Expansion Kit $36
84   Four type 2114 RAM IC's for expanding VP-711 on-board memory
85   to 4K bytes.
86
87   VP-111 MicroComputer $99
88   RCA COSMAC microprocessor. 1 K RAM expandable to 32K (4K On-
89   board). Built-in cassette interface and video interface. 16 key
90   Hexidecimal keypad. ROM operating system. CHIP-8 language and Machine
91   language. Tone generator. Assembled - user must install Cables
92   (supplied) and furnish 5 volt power supply and speaker.
93
94   VP-114 VP-111 Expansion Kit $76
95   Includes I/O ports, system expansion connector and additional
96   3K of RAM. Expands VP-111 to VP-711 capability.
97
98   VP-155 VP-111 Cover $12
99   Attractive protective plastic cover for VP-111.
100
101   VP-3301 Interactive Data Terminal Available Approx. 6 Months
102   Microprocessor Based Computer Terminal with keyboard, video
103   Interface and color graphics - includes full resident and user
104   Definable character font, switch selectable configuration, cursor
105   Control, reverse video and many other features.
106
107   VP-590 Color Board $69
108   Displays VP-711 output in color! Program control of four
109   Background colors and eight foreground colors. CHIP-8X language
110   Adds color commands. Includes two sockets for VP-580 Expansion
111   Keyboards.
112
113   VP-595 Simple Sound Board $30
114   Provides 256 different frequencies in place of VP-711 single-
115   tone Output. Use with VP-590 Color Board for simultaneous color and
116   Sound. Great for simple music or sound effects! Includes speaker.
117
118   VP-550 Super Sound Board $49
119   Turn your VP-711 into a music synthesizer! Two independent
120   sound Channels. Frequency, duration and amplitude envelope (voice) of
121   Each channel under program control. On-board tempo control. Provision
122   for multi-track recording or slaving VP-711's. Output drives audio
123   preamp. Does not permit simultaneous video display.
124
125   VP-551 Super Sound 4-Channel Expander Package $74
126   VP-551 provides four (4) independent sound channels with
127   frequency duration and amplitude envelope for each channel. Package
128   includes modified VP-550 super sound board, VP-576 two board
129   expander, data cassette with 4-channel PIN-8 program, and instruction
130   manual. Requires 4K RAM system and your VP-550 Super Sound Board.
131
132   VP-570 Memory Expansion Board $95
133   Plug-in 4K static RAM memory. Jumper locates RAM in any 4K
134   block in first 32K of VP-711 memory space.
135
136   VP-580 Auxiliary Keyboard $20
137   Adds two-player interactive game capability to VP-711 16-key
138   keypad with cable. Connects to sockets on VP-590 Color Board or VP-
139   585 Keyboard Interface.
140
141   VP-585 Keyboard Interface Board $15
142   Interfaces two VP-580 Expansion Keyboards directly to the VP-
143   711. Not required when VP-590 Color Board is used.
144
145   VP-560 EPROM Board $34
146   Interfaces two Intel 2716 EPROMs to VP-711. Places EPROMs any-
147   where in memory space. Can also re-allocate on-board RAM in memory
148   space.
149
150   VP-565 EPROM Programmer Board $99
151   Programs Intel 2716 EPROMs with VP-711. Complete with software
152   to program, copy, and verify. On-board generation of all programming
153   voltages.
154
155   VP-575 Expansion Board $59
156   Plug-in board with 4 buffered and one unbuffered socket.
157   Permits use of up to 5 Accessory Boards in VP-711 Expansion Socket.
158
159   VP-576 Two-Board Expander $20
160   Plug-in board for VP-711 I/O or Expansion Socket permits use
161   of two Accessory Boards in either location.
162
163   VP-601* ASCII Keyboard. 7-Bit Parallel Output $69
164   Fully encoded, 128-character ASCII alphanumeric keyboard. 58
165   light touch keys (2 user defined). Selectable "Upper-Case-Only".
166
167   VP-606* ASCII Keyboard - Serial Output $99
168   Same as VP-601. EIA RS232C compatible, 20 mA current loop and
169   TTL outputs. Six selectable baud rates. Available mid-1980.
170
171   VP-611* ASCII/Numeric Keyboard. 7-Bit Parallel Output $89
172   ASCII Keyboard identical to VP-601 plus 16 key numeric entry
173   keyboard for easier entry of numbers.
174
175   VP-616* ASCII/Numeric Keyboard - Serial Output $119
176   Same as VP-611. EIA RS232C compatible, 20 mA current loop and
177   TTL outputs. Six selectable baud rates. Available mid-1980.
178
179   VP-620 Cable: ASCII Keyboards to VP-711 $20
180   Flat ribbon cable, 24" length, for connecting VP-601 or VP-
181   611 and VP-711. Includes matching connector on both ends.
182
183   VP-623 Cable: Parallel Output ASCII Keyboards $20
184   Flat ribbon cable, 36" length with mating connector for VP-
185   601 or VP-611 Keyboards. Other end is unterminated.
186
187   VP-626 Connector: Serial Output ASCII Keyboards & Terminal $7
188   25 pin solderable male "D" connector mates to VP-606, VP-616
189   or VP-3301.
190
191   TC1210 9" Video Monitor $195
192   Ideal, low-cost monochrome monitor for displaying the video
193   output from your microcomputer or terminal.
194
195   TC1217 17" Video Monitor $480
196   A really BIG monochrome monitor for use with your
197   microcomputer or terminal 148 sq. in. pictures.
198
199   VP-700 Tiny BASIC ROM Board $39
200   Run Tiny BASIC on your VP-711! All BASIC code stored in ROM.
201   Requires separate ASCII keyboard.
202
203   VP-701 Floating Point BASIC for VP-711 $49
204   16K bytes on cassette tape, includes floating point and
205   integer math, string capability and color graphics. More than 70
206   commands and statements. Available mid-1980.
207
208   VP-710 Game Manual $10
209   More exciting games for your VP-711! Includes Blackjack,
210   Biorythm, Pinball, Bowling and 10 others.
211
212   VP-720 Game Manual II More exciting games. Available mid-1980. $15
213
214   VP-311 VP-711 Instruction Manual (Included with VP-711) $5
215
216   VP-320 VP-711 User Guide Manual (Included with VP-711) $5
217
218   MPM-201B CDP1802 User Manual (Included with VP-711) $5
219
220   * Quantities of 15 or more available less case and speaker (Assembled
221   keypad and circut board only). Price on request.
222
26223*/
27224
28225#include "driver.h"
r3292r3293
30227#include "cpu/cdp1802/cdp1802.h"
31228#include "devices/cassette.h"
32229#include "devices/snapquik.h"
33#include "sound/beep.h"
34230#include "sound/discrete.h"
35231#include "video/cdp1861.h"
36232#include "video/cdp1862.h"
233#include "audio/cdp1863.h"
37234#include "machine/rescap.h"
38235
39236static QUICKLOAD_LOAD( vip );
r3292r3293
46243   return device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" );
47244}
48245
49/* Discrete Sound */
246/* Sound */
50247
51248static const discrete_555_desc vip_ca555_a =
52249{
r3292r3293
61258   DISCRETE_OUTPUT(NODE_02, 5000)
62259DISCRETE_SOUND_END
63260
261static CDP1863_INTERFACE( vip_cdp1863_intf )
262{
263   1750000,   // ???
264   0         // ???
265};
266
64267/* Read/Write Handlers */
65268
66269static WRITE8_HANDLER( keylatch_w )
r3292r3293
107310static ADDRESS_MAP_START( vip_io_map, ADDRESS_SPACE_IO, 8 )
108311   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(CDP1861, CDP1861_TAG, cdp1861_dispon_r, cdp1861_dispoff_w)
109312   AM_RANGE(0x02, 0x02) AM_WRITE(keylatch_w)
313//   AM_RANGE(0x03, 0x03) AM_DEVWRITE(CDP1863, CDP1863_TAG, cdp1863_str_w)
110314   AM_RANGE(0x04, 0x04) AM_WRITE(bankswitch_w)
111315//   AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1862, CDP1862_TAG, cdp1862_bkg_w)
112316ADDRESS_MAP_END
r3292r3293
114318/* Input Ports */
115319
116320static INPUT_PORTS_START( vip )
117   PORT_START("KEYPAD1")
321   PORT_START("KEYPAD")
118322   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 MW") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD)
119323   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
120324   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
r3292r3293
132336   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
133337   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F TW") PORT_CODE(KEYCODE_F)
134338
339   PORT_START("VP580")
340   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 MW") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD)
341   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
342   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
343   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD)
344   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD)
345   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD)
346   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD)
347   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD)
348   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD)
349   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD)
350   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A MR") PORT_CODE(KEYCODE_A)
351   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B TR") PORT_CODE(KEYCODE_B)
352   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
353   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
354   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
355   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F TW") PORT_CODE(KEYCODE_F)
356
135357   PORT_START("RUN")
136358   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Run/Reset") PORT_CODE(KEYCODE_R) PORT_TOGGLE
137359
r3292r3293
150372
151373   PORT_START("SOUND")
152374   PORT_CONFNAME( 0x03, 0x00, "Sound")
153   PORT_CONFSETTING( 0x00, DEF_STR( None ) )
375   PORT_CONFSETTING( 0x00, "Standard" )
154376   PORT_CONFSETTING( 0x01, "VP-595 Simple Sound Board" )
155377   PORT_CONFSETTING( 0x02, "VP-550 Super Sound Board" )
156378   PORT_CONFSETTING( 0x03, "VP-551 Super Sound Board" )
r3292r3293
194416   RES_K(3.92)    // ???
195417};
196418
419static WRITE8_HANDLER( vip_colorram_w )
420{
421   vip_state *state = machine->driver_data;
422
423   state->colorram[offset] = data;
424}
425
197426static VIDEO_UPDATE( vip )
198427{
199428   vip_state *state = screen->machine->driver_data;
r3292r3293
262491
263492   /* tape input */
264493   if (cassette_input(cassette_device_image(machine)) < 0) flags -= EF2;
494   set_led_status(2, (cassette_input(cassette_device_image(machine)) > 0));
265495
266496   /* keyboard */
267   if (input_port_read(machine, "KEYPAD1") & (1 << state->keylatch)) flags -= EF3;
497   if (input_port_read(machine, "KEYPAD") & (1 << state->keylatch)) flags -= EF3;
268498
269499   /* extended keyboard */
270//   if (input_port_read(machine, "KEYPAD2") & (1 << state->keylatch)) flags -= EF4;
500   if (input_port_read(machine, "VP580") & (1 << state->keylatch)) flags -= EF4;
271501
272502   return flags;
273503}
274504
275505static CDP1802_Q_WRITE( vip_q_w )
276506{
507   vip_state *state = machine->driver_data;
508
277509   /* sound output */
278510   discrete_sound_w(machine, NODE_01, level);
279511
512   if (input_port_read(machine, "SOUND") == VIP_SOUND_CDP1863)
513   {
514      /* CDP1863 output enable */
515      cdp1863_oe_w(state->cdp1863, level);
516   }
517
280518   /* Q led */
281519   set_led_status(1, level);
282520
r3292r3293
291529   switch (input_port_read(machine, "VIDEO"))
292530   {
293531   case VIP_VIDEO_CDP1861:
294      {
295         cdp1861_dma_w(state->cdp1861, data);
296      }
532      cdp1861_dma_w(state->cdp1861, data);
297533      break;
298534
299535   case VIP_VIDEO_CDP1862:
300536      {
301         cdp1862_dma_w(state->cdp1862, data, ASSERT_LINE, 1, 1, 1);
537         UINT8 color = state->colorram[ma & 0xff];
538         
539         int rdata = BIT(color, 0);
540         int gdata = BIT(color, 2);
541         int bdata = BIT(color, 1);
542
543         cdp1862_dma_w(state->cdp1862, data, ASSERT_LINE, rdata, gdata, bdata);
302544      }
303545      break;
304546   }
r3292r3293
352594
353595   state->cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
354596   state->cdp1862 = device_list_find_by_tag(machine->config->devicelist, CDP1862, CDP1862_TAG);
597   state->cdp1863 = device_list_find_by_tag(machine->config->devicelist, CDP1863, CDP1863_TAG);
355598
356599   /* register for state saving */
357600
r3292r3293
366609{
367610   vip_state *state = machine->driver_data;
368611
369   /* reset video chips */
612   /* reset auxiliary chips */
370613
371614   state->cdp1861->reset(state->cdp1861);
372615   state->cdp1862->reset(state->cdp1862);
616   state->cdp1863->reset(state->cdp1863);
373617
374   /* map CDP1862 memory */
618   /* configure video */
375619
376620   switch (input_port_read(machine, "VIDEO"))
377621   {
378622   case VIP_VIDEO_CDP1861:
379      memory_install_write8_device_handler(state->cdp1862, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, SMH_UNMAP);
623      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, SMH_UNMAP);
624      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc0ff, 0, 0, SMH_UNMAP);
380625      break;
381626
382627   case VIP_VIDEO_CDP1862:
383628      memory_install_write8_device_handler(state->cdp1862, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, cdp1862_bkg_w);
629      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc0ff, 0, 0, vip_colorram_w);
384630      break;
385631   }
386632
633   /* configure audio */
634
635   switch (input_port_read(machine, "SOUND"))
636   {
637   case VIP_SOUND_CDP1863:
638      memory_install_write8_device_handler(state->cdp1863, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, cdp1863_str_w);
639      break;
640
641   default:
642      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, SMH_UNMAP);
643      break;
644   }
645
387646   /* enable ROM mirror at 0x0000 */
388647
389648   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x01ff, 0, 0x7e00, SMH_BANK1, SMH_UNMAP);
r3292r3293
427686   MDRV_DEVICE_CONFIG(vip_cdp1862_intf)
428687
429688   /* sound hardware */
689   MDRV_DEVICE_ADD(CDP1863_TAG, CDP1863)
690   MDRV_DEVICE_CONFIG(vip_cdp1863_intf)
691
430692   MDRV_SPEAKER_STANDARD_MONO("mono")
431693   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
432694   MDRV_SOUND_CONFIG_DISCRETE(vip)
433695   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
434696
697   MDRV_SOUND_ADD("beep", BEEP, 0) /* CDP1863 */
698   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
699
435700   /* devices */
436701   MDRV_QUICKLOAD_ADD(vip, "bin,c8,c8x", 0)
437702
r3292r3293
509774}
510775
511776static SYSTEM_CONFIG_START( vp711 )
512   CONFIG_RAM_DEFAULT   ( 4 * 1024)
513   CONFIG_RAM         (32 * 1024)
777   CONFIG_RAM_DEFAULT   ( 2 * 1024)
778   CONFIG_RAM         ( 4 * 1024)
779   CONFIG_RAM         ( 8 * 1024)
514780SYSTEM_CONFIG_END
515781
516782static SYSTEM_CONFIG_START( vp111 )
r3292r3293
519785   CONFIG_RAM         ( 4 * 1024)
520786SYSTEM_CONFIG_END
521787
788/* Driver Initialization */
789
790static TIMER_CALLBACK(setup_beep)
791{
792   beep_set_state(0, 0);
793   beep_set_frequency( 0, 0 );
794}
795
796static DRIVER_INIT( vip )
797{
798   timer_set(attotime_zero, NULL, 0, setup_beep);
799}
800
522801/* System Drivers */
523802
524803//     YEAR  NAME    PARENT  COMPAT  MACHINE     INPUT   INIT    CONFIG  COMPANY FULLNAME
525COMP( 1977, vip,   0,      0,      vip,      vip,   0,      vp711,   "RCA",   "Cosmac VIP (VP-711)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
526COMP( 1977, vp111,   vip,   0,      vip,      vip,   0,      vp111,   "RCA",   "Cosmac VIP (VP-111)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
804COMP( 1977, vip,   0,      0,      vip,      vip,   vip,   vp711,   "RCA",   "Cosmac VIP (VP-711)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
805COMP( 1977, vp111,   vip,   0,      vip,      vip,   vip,   vp111,   "RCA",   "Cosmac VIP (VP-111)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team