src/mess/audio/cdp1863.c
| r0 | r3293 | |
| 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 | |
| 18 | typedef struct _cdp1863_t cdp1863_t;
|
| 19 | struct _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 | |
| 32 | INLINE 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 | |
| 42 | WRITE8_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 | |
| 65 | void 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
|
| 75 | static 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 | |
| 132 | static 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 | |
| 160 | static DEVICE_RESET( cdp1863 )
|
| 161 | {
|
| 162 | cdp1863_t *cdp1863 = get_safe_token(device);
|
| 163 | |
| 164 | cdp1863->latch = CDP1863_DEFAULT_LATCH;
|
| 165 | }
|
| 166 | |
| 167 | static DEVICE_SET_INFO( cdp1863 )
|
| 168 | {
|
| 169 | switch (state)
|
| 170 | {
|
| 171 | /* no parameters to set */
|
| 172 | }
|
| 173 | }
|
| 174 | |
| 175 | DEVICE_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/drivers/vip.c
| r3292 | r3293 | |
| 1 | 1 | /* |
| 2 | 2 | |
| 3 | RCA COSMAC VIP |
| 4 | |
| 5 | PCB 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 | |
| 34 | Notes: |
| 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 | |
| 3 | 57 | TODO: |
| 4 | 58 | |
| 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) |
| 9 | 65 | - VP-580 Expansion Keyboard (connects to VP-585 or VP-590) |
| 10 | 66 | - 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) |
| 13 | 68 | - VP-601/611 ASCII Keyboard (VP-601 58 keys, VP611 58 keys + 16 keys numerical keypad) |
| 14 | 69 | - VP-700 Expanded Tiny Basic Board (4 KB ROM expansion) |
| 15 | 70 | |
| 16 | | - VIP Blockout |
| 71 | */ |
| 17 | 72 | |
| 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 | /* |
| 21 | 74 | |
| 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. |
| 25 | 82 | |
| 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 | |
| 26 | 223 | */ |
| 27 | 224 | |
| 28 | 225 | #include "driver.h" |
| r3292 | r3293 | |
| 30 | 227 | #include "cpu/cdp1802/cdp1802.h" |
| 31 | 228 | #include "devices/cassette.h" |
| 32 | 229 | #include "devices/snapquik.h" |
| 33 | | #include "sound/beep.h" |
| 34 | 230 | #include "sound/discrete.h" |
| 35 | 231 | #include "video/cdp1861.h" |
| 36 | 232 | #include "video/cdp1862.h" |
| 233 | #include "audio/cdp1863.h" |
| 37 | 234 | #include "machine/rescap.h" |
| 38 | 235 | |
| 39 | 236 | static QUICKLOAD_LOAD( vip ); |
| r3292 | r3293 | |
| 46 | 243 | return device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ); |
| 47 | 244 | } |
| 48 | 245 | |
| 49 | | /* Discrete Sound */ |
| 246 | /* Sound */ |
| 50 | 247 | |
| 51 | 248 | static const discrete_555_desc vip_ca555_a = |
| 52 | 249 | { |
| r3292 | r3293 | |
| 61 | 258 | DISCRETE_OUTPUT(NODE_02, 5000) |
| 62 | 259 | DISCRETE_SOUND_END |
| 63 | 260 | |
| 261 | static CDP1863_INTERFACE( vip_cdp1863_intf ) |
| 262 | { |
| 263 | 1750000, // ??? |
| 264 | 0 // ??? |
| 265 | }; |
| 266 | |
| 64 | 267 | /* Read/Write Handlers */ |
| 65 | 268 | |
| 66 | 269 | static WRITE8_HANDLER( keylatch_w ) |
| r3292 | r3293 | |
| 107 | 310 | static ADDRESS_MAP_START( vip_io_map, ADDRESS_SPACE_IO, 8 ) |
| 108 | 311 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(CDP1861, CDP1861_TAG, cdp1861_dispon_r, cdp1861_dispoff_w) |
| 109 | 312 | AM_RANGE(0x02, 0x02) AM_WRITE(keylatch_w) |
| 313 | // AM_RANGE(0x03, 0x03) AM_DEVWRITE(CDP1863, CDP1863_TAG, cdp1863_str_w) |
| 110 | 314 | AM_RANGE(0x04, 0x04) AM_WRITE(bankswitch_w) |
| 111 | 315 | // AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1862, CDP1862_TAG, cdp1862_bkg_w) |
| 112 | 316 | ADDRESS_MAP_END |
| r3292 | r3293 | |
| 114 | 318 | /* Input Ports */ |
| 115 | 319 | |
| 116 | 320 | static INPUT_PORTS_START( vip ) |
| 117 | | PORT_START("KEYPAD1") |
| 321 | PORT_START("KEYPAD") |
| 118 | 322 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 MW") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) |
| 119 | 323 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) |
| 120 | 324 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) |
| r3292 | r3293 | |
| 132 | 336 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) |
| 133 | 337 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F TW") PORT_CODE(KEYCODE_F) |
| 134 | 338 | |
| 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 | |
| 135 | 357 | PORT_START("RUN") |
| 136 | 358 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Run/Reset") PORT_CODE(KEYCODE_R) PORT_TOGGLE |
| 137 | 359 | |
| r3292 | r3293 | |
| 150 | 372 | |
| 151 | 373 | PORT_START("SOUND") |
| 152 | 374 | PORT_CONFNAME( 0x03, 0x00, "Sound") |
| 153 | | PORT_CONFSETTING( 0x00, DEF_STR( None ) ) |
| 375 | PORT_CONFSETTING( 0x00, "Standard" ) |
| 154 | 376 | PORT_CONFSETTING( 0x01, "VP-595 Simple Sound Board" ) |
| 155 | 377 | PORT_CONFSETTING( 0x02, "VP-550 Super Sound Board" ) |
| 156 | 378 | PORT_CONFSETTING( 0x03, "VP-551 Super Sound Board" ) |
| r3292 | r3293 | |
| 194 | 416 | RES_K(3.92) // ??? |
| 195 | 417 | }; |
| 196 | 418 | |
| 419 | static WRITE8_HANDLER( vip_colorram_w ) |
| 420 | { |
| 421 | vip_state *state = machine->driver_data; |
| 422 | |
| 423 | state->colorram[offset] = data; |
| 424 | } |
| 425 | |
| 197 | 426 | static VIDEO_UPDATE( vip ) |
| 198 | 427 | { |
| 199 | 428 | vip_state *state = screen->machine->driver_data; |
| r3292 | r3293 | |
| 262 | 491 | |
| 263 | 492 | /* tape input */ |
| 264 | 493 | if (cassette_input(cassette_device_image(machine)) < 0) flags -= EF2; |
| 494 | set_led_status(2, (cassette_input(cassette_device_image(machine)) > 0)); |
| 265 | 495 | |
| 266 | 496 | /* 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; |
| 268 | 498 | |
| 269 | 499 | /* 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; |
| 271 | 501 | |
| 272 | 502 | return flags; |
| 273 | 503 | } |
| 274 | 504 | |
| 275 | 505 | static CDP1802_Q_WRITE( vip_q_w ) |
| 276 | 506 | { |
| 507 | vip_state *state = machine->driver_data; |
| 508 | |
| 277 | 509 | /* sound output */ |
| 278 | 510 | discrete_sound_w(machine, NODE_01, level); |
| 279 | 511 | |
| 512 | if (input_port_read(machine, "SOUND") == VIP_SOUND_CDP1863) |
| 513 | { |
| 514 | /* CDP1863 output enable */ |
| 515 | cdp1863_oe_w(state->cdp1863, level); |
| 516 | } |
| 517 | |
| 280 | 518 | /* Q led */ |
| 281 | 519 | set_led_status(1, level); |
| 282 | 520 | |
| r3292 | r3293 | |
| 291 | 529 | switch (input_port_read(machine, "VIDEO")) |
| 292 | 530 | { |
| 293 | 531 | case VIP_VIDEO_CDP1861: |
| 294 | | { |
| 295 | | cdp1861_dma_w(state->cdp1861, data); |
| 296 | | } |
| 532 | cdp1861_dma_w(state->cdp1861, data); |
| 297 | 533 | break; |
| 298 | 534 | |
| 299 | 535 | case VIP_VIDEO_CDP1862: |
| 300 | 536 | { |
| 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); |
| 302 | 544 | } |
| 303 | 545 | break; |
| 304 | 546 | } |
| r3292 | r3293 | |
| 352 | 594 | |
| 353 | 595 | state->cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG); |
| 354 | 596 | 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); |
| 355 | 598 | |
| 356 | 599 | /* register for state saving */ |
| 357 | 600 | |
| r3292 | r3293 | |
| 366 | 609 | { |
| 367 | 610 | vip_state *state = machine->driver_data; |
| 368 | 611 | |
| 369 | | /* reset video chips */ |
| 612 | /* reset auxiliary chips */ |
| 370 | 613 | |
| 371 | 614 | state->cdp1861->reset(state->cdp1861); |
| 372 | 615 | state->cdp1862->reset(state->cdp1862); |
| 616 | state->cdp1863->reset(state->cdp1863); |
| 373 | 617 | |
| 374 | | /* map CDP1862 memory */ |
| 618 | /* configure video */ |
| 375 | 619 | |
| 376 | 620 | switch (input_port_read(machine, "VIDEO")) |
| 377 | 621 | { |
| 378 | 622 | 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); |
| 380 | 625 | break; |
| 381 | 626 | |
| 382 | 627 | case VIP_VIDEO_CDP1862: |
| 383 | 628 | 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); |
| 384 | 630 | break; |
| 385 | 631 | } |
| 386 | 632 | |
| 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 | |
| 387 | 646 | /* enable ROM mirror at 0x0000 */ |
| 388 | 647 | |
| 389 | 648 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x01ff, 0, 0x7e00, SMH_BANK1, SMH_UNMAP); |
| r3292 | r3293 | |
| 427 | 686 | MDRV_DEVICE_CONFIG(vip_cdp1862_intf) |
| 428 | 687 | |
| 429 | 688 | /* sound hardware */ |
| 689 | MDRV_DEVICE_ADD(CDP1863_TAG, CDP1863) |
| 690 | MDRV_DEVICE_CONFIG(vip_cdp1863_intf) |
| 691 | |
| 430 | 692 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 431 | 693 | MDRV_SOUND_ADD("discrete", DISCRETE, 0) |
| 432 | 694 | MDRV_SOUND_CONFIG_DISCRETE(vip) |
| 433 | 695 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 434 | 696 | |
| 697 | MDRV_SOUND_ADD("beep", BEEP, 0) /* CDP1863 */ |
| 698 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 699 | |
| 435 | 700 | /* devices */ |
| 436 | 701 | MDRV_QUICKLOAD_ADD(vip, "bin,c8,c8x", 0) |
| 437 | 702 | |
| r3292 | r3293 | |
| 509 | 774 | } |
| 510 | 775 | |
| 511 | 776 | static 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) |
| 514 | 780 | SYSTEM_CONFIG_END |
| 515 | 781 | |
| 516 | 782 | static SYSTEM_CONFIG_START( vp111 ) |
| r3292 | r3293 | |
| 519 | 785 | CONFIG_RAM ( 4 * 1024) |
| 520 | 786 | SYSTEM_CONFIG_END |
| 521 | 787 | |
| 788 | /* Driver Initialization */ |
| 789 | |
| 790 | static TIMER_CALLBACK(setup_beep) |
| 791 | { |
| 792 | beep_set_state(0, 0); |
| 793 | beep_set_frequency( 0, 0 ); |
| 794 | } |
| 795 | |
| 796 | static DRIVER_INIT( vip ) |
| 797 | { |
| 798 | timer_set(attotime_zero, NULL, 0, setup_beep); |
| 799 | } |
| 800 | |
| 522 | 801 | /* System Drivers */ |
| 523 | 802 | |
| 524 | 803 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME |
| 525 | | COMP( 1977, vip, 0, 0, vip, vip, 0, vp711, "RCA", "Cosmac VIP (VP-711)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 526 | | COMP( 1977, vp111, vip, 0, vip, vip, 0, vp111, "RCA", "Cosmac VIP (VP-111)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 804 | COMP( 1977, vip, 0, 0, vip, vip, vip, vp711, "RCA", "Cosmac VIP (VP-711)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 805 | COMP( 1977, vp111, vip, 0, vip, vip, vip, vp111, "RCA", "Cosmac VIP (VP-111)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |