src/emu/sound/cdp1864.c
| r0 | r5706 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | RCA CDP1864C COS/MOS PAL Compatible Color TV Interface
|
| 4 | |
| 5 | Copyright MESS Team.
|
| 6 | Visit http://mamedev.org for licensing and usage restrictions.
|
| 7 | |
| 8 | **********************************************************************/
|
| 9 | |
| 10 | /*
|
| 11 | |
| 12 | TODO:
|
| 13 | |
| 14 | - interlace mode
|
| 15 | - PAL output, currently using RGB
|
| 16 | - cpu synchronization
|
| 17 | |
| 18 | SC1 and SC0 are used to provide CDP1864C-to-CPU synchronization for a jitter-free display.
|
| 19 | During every horizontal sync the CDP1864C samples SC0 and SC1 for SC0 = 1 and SC1 = 0
|
| 20 | (CDP1800 execute state). Detection of a fetch cycle causes the CDP1864C to skip cycles to
|
| 21 | attain synchronization. (i.e. picture moves 8 pixels to the right)
|
| 22 | |
| 23 | */
|
| 24 | |
| 25 | #include "driver.h"
|
| 26 | #include "cdp1864.h"
|
| 27 | #include "sndintrf.h"
|
| 28 | #include "streams.h"
|
| 29 | #include "cpu/cdp1802/cdp1802.h"
|
| 30 | |
| 31 | /***************************************************************************
|
| 32 | PARAMETERS
|
| 33 | ***************************************************************************/
|
| 34 | |
| 35 | #define CDP1864_DEFAULT_LATCH 0x35
|
| 36 | |
| 37 | #define CDP1864_CYCLES_DMA_START 2*8
|
| 38 | #define CDP1864_CYCLES_DMA_ACTIVE 8*8
|
| 39 | #define CDP1864_CYCLES_DMA_WAIT 6*8
|
| 40 | |
| 41 | static const int CDP1864_BACKGROUND_COLOR_SEQUENCE[] = { 2, 0, 1, 4 };
|
| 42 | |
| 43 | /***************************************************************************
|
| 44 | TYPE DEFINITIONS
|
| 45 | ***************************************************************************/
|
| 46 | |
| 47 | typedef struct _cdp1864_t cdp1864_t;
|
| 48 | struct _cdp1864_t
|
| 49 | {
|
| 50 | devcb_resolved_read_line in_rdata_func;
|
| 51 | devcb_resolved_read_line in_bdata_func;
|
| 52 | devcb_resolved_read_line in_gdata_func;
|
| 53 | devcb_resolved_write_line out_int_func;
|
| 54 | devcb_resolved_write_line out_dmao_func;
|
| 55 | devcb_resolved_write_line out_efx_func;
|
| 56 | |
| 57 | const device_config *screen; /* screen */
|
| 58 | bitmap_t *bitmap; /* bitmap */
|
| 59 | sound_stream *stream; /* sound output */
|
| 60 | |
| 61 | /* video state */
|
| 62 | int disp; /* display on */
|
| 63 | int dmaout; /* DMA request active */
|
| 64 | int bgcolor; /* background color */
|
| 65 | int con; /* color on */
|
| 66 | |
| 67 | /* sound state */
|
| 68 | int aoe; /* audio on */
|
| 69 | int latch; /* sound latch */
|
| 70 | INT16 signal; /* current signal */
|
| 71 | int incr; /* initial wave state */
|
| 72 | |
| 73 | /* timers */
|
| 74 | emu_timer *int_timer; /* interrupt timer */
|
| 75 | emu_timer *efx_timer; /* EFx timer */
|
| 76 | emu_timer *dma_timer; /* DMA timer */
|
| 77 | |
| 78 | const device_config *cpu;
|
| 79 | };
|
| 80 | |
| 81 | /***************************************************************************
|
| 82 | INLINE FUNCTIONS
|
| 83 | ***************************************************************************/
|
| 84 | |
| 85 | INLINE cdp1864_t *get_safe_token(const device_config *device)
|
| 86 | {
|
| 87 | assert(device != NULL);
|
| 88 | assert(device->token != NULL);
|
| 89 | return (cdp1864_t *)device->token;
|
| 90 | }
|
| 91 | |
| 92 | /***************************************************************************
|
| 93 | IMPLEMENTATION
|
| 94 | ***************************************************************************/
|
| 95 | |
| 96 | /*-------------------------------------------------
|
| 97 | TIMER_CALLBACK( cdp1864_int_tick )
|
| 98 | -------------------------------------------------*/
|
| 99 | |
| 100 | static TIMER_CALLBACK( cdp1864_int_tick )
|
| 101 | {
|
| 102 | const device_config *device = ptr;
|
| 103 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 104 | |
| 105 | int scanline = video_screen_get_vpos(cdp1864->screen);
|
| 106 | |
| 107 | if (scanline == CDP1864_SCANLINE_INT_START)
|
| 108 | {
|
| 109 | if (cdp1864->disp)
|
| 110 | {
|
| 111 | devcb_call_write_line(&cdp1864->out_int_func, ASSERT_LINE);
|
| 112 | }
|
| 113 | |
| 114 | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_END, 0), 0);
|
| 115 | }
|
| 116 | else
|
| 117 | {
|
| 118 | if (cdp1864->disp)
|
| 119 | {
|
| 120 | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE);
|
| 121 | }
|
| 122 | |
| 123 | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_START, 0), 0);
|
| 124 | }
|
| 125 | }
|
| 126 | |
| 127 | /*-------------------------------------------------
|
| 128 | TIMER_CALLBACK( cdp1864_efx_tick )
|
| 129 | -------------------------------------------------*/
|
| 130 | |
| 131 | static TIMER_CALLBACK( cdp1864_efx_tick )
|
| 132 | {
|
| 133 | const device_config *device = ptr;
|
| 134 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 135 | |
| 136 | int scanline = video_screen_get_vpos(cdp1864->screen);
|
| 137 | |
| 138 | switch (scanline)
|
| 139 | {
|
| 140 | case CDP1864_SCANLINE_EFX_TOP_START:
|
| 141 | devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE);
|
| 142 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_END, 0), 0);
|
| 143 | break;
|
| 144 | |
| 145 | case CDP1864_SCANLINE_EFX_TOP_END:
|
| 146 | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE);
|
| 147 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_BOTTOM_START, 0), 0);
|
| 148 | break;
|
| 149 | |
| 150 | case CDP1864_SCANLINE_EFX_BOTTOM_START:
|
| 151 | devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE);
|
| 152 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_BOTTOM_END, 0), 0);
|
| 153 | break;
|
| 154 | |
| 155 | case CDP1864_SCANLINE_EFX_BOTTOM_END:
|
| 156 | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE);
|
| 157 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_START, 0), 0);
|
| 158 | break;
|
| 159 | }
|
| 160 | }
|
| 161 | |
| 162 | /*-------------------------------------------------
|
| 163 | TIMER_CALLBACK( cdp1864_dma_tick )
|
| 164 | -------------------------------------------------*/
|
| 165 | |
| 166 | static TIMER_CALLBACK( cdp1864_dma_tick )
|
| 167 | {
|
| 168 | const device_config *device = ptr;
|
| 169 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 170 | |
| 171 | int scanline = video_screen_get_vpos(cdp1864->screen);
|
| 172 | |
| 173 | if (cdp1864->dmaout)
|
| 174 | {
|
| 175 | if (cdp1864->disp)
|
| 176 | {
|
| 177 | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END)
|
| 178 | {
|
| 179 | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE);
|
| 180 | }
|
| 181 | }
|
| 182 | |
| 183 | timer_adjust_oneshot(cdp1864->dma_timer, cpu_clocks_to_attotime(machine->firstcpu, CDP1864_CYCLES_DMA_WAIT), 0);
|
| 184 | |
| 185 | cdp1864->dmaout = 0;
|
| 186 | }
|
| 187 | else
|
| 188 | {
|
| 189 | if (cdp1864->disp)
|
| 190 | {
|
| 191 | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END)
|
| 192 | {
|
| 193 | devcb_call_write_line(&cdp1864->out_dmao_func, ASSERT_LINE);
|
| 194 | }
|
| 195 | }
|
| 196 | |
| 197 | timer_adjust_oneshot(cdp1864->dma_timer, cpu_clocks_to_attotime(machine->firstcpu, CDP1864_CYCLES_DMA_ACTIVE), 0);
|
| 198 | |
| 199 | cdp1864->dmaout = 1;
|
| 200 | }
|
| 201 | }
|
| 202 | |
| 203 | /*-------------------------------------------------
|
| 204 | cdp1864_init_palette - initialize palette
|
| 205 | -------------------------------------------------*/
|
| 206 | |
| 207 | static void cdp1864_init_palette(const device_config *device, const cdp1864_interface *intf)
|
| 208 | {
|
| 209 | int i;
|
| 210 | |
| 211 | double res_total = intf->res_r + intf->res_g + intf->res_b + intf->res_bkg;
|
| 212 | |
| 213 | int weight_r = (intf->res_r / res_total) * 100;
|
| 214 | int weight_g = (intf->res_g / res_total) * 100;
|
| 215 | int weight_b = (intf->res_b / res_total) * 100;
|
| 216 | int weight_bkg = (intf->res_bkg / res_total) * 100;
|
| 217 | |
| 218 | for (i = 0; i < 16; i++)
|
| 219 | {
|
| 220 | int r, g, b, luma = 0;
|
| 221 | |
| 222 | luma += (i & 4) ? weight_r : 0;
|
| 223 | luma += (i & 1) ? weight_g : 0;
|
| 224 | luma += (i & 2) ? weight_b : 0;
|
| 225 | luma += (i & 8) ? 0 : weight_bkg;
|
| 226 | |
| 227 | luma = (luma * 0xff) / 100;
|
| 228 | |
| 229 | r = (i & 4) ? luma : 0;
|
| 230 | g = (i & 1) ? luma : 0;
|
| 231 | b = (i & 2) ? luma : 0;
|
| 232 | |
| 233 | palette_set_color_rgb( device->machine, i, r, g, b );
|
| 234 | }
|
| 235 | }
|
| 236 | |
| 237 | /*-------------------------------------------------
|
| 238 | cdp1864_aoe_w - audio output enable
|
| 239 | -------------------------------------------------*/
|
| 240 | |
| 241 | WRITE_LINE_DEVICE_HANDLER( cdp1864_aoe_w )
|
| 242 | {
|
| 243 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 244 | |
| 245 | if (!state)
|
| 246 | {
|
| 247 | cdp1864->latch = CDP1864_DEFAULT_LATCH;
|
| 248 | }
|
| 249 | |
| 250 | cdp1864->aoe = state;
|
| 251 | }
|
| 252 | |
| 253 | /*-------------------------------------------------
|
| 254 | cdp1864_dispon_r - turn display on
|
| 255 | -------------------------------------------------*/
|
| 256 | |
| 257 | READ8_DEVICE_HANDLER( cdp1864_dispon_r )
|
| 258 | {
|
| 259 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 260 | |
| 261 | cdp1864->disp = 1;
|
| 262 | |
| 263 | return 0xff;
|
| 264 | }
|
| 265 | |
| 266 | /*-------------------------------------------------
|
| 267 | cdp1864_dispoff_r - turn display off
|
| 268 | -------------------------------------------------*/
|
| 269 | |
| 270 | READ8_DEVICE_HANDLER( cdp1864_dispoff_r )
|
| 271 | {
|
| 272 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 273 | |
| 274 | cdp1864->disp = 0;
|
| 275 | |
| 276 | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE);
|
| 277 | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE);
|
| 278 | |
| 279 | return 0xff;
|
| 280 | }
|
| 281 | |
| 282 | /*-------------------------------------------------
|
| 283 | cdp1864_step_bgcolor_w - step background color
|
| 284 | -------------------------------------------------*/
|
| 285 | |
| 286 | WRITE8_DEVICE_HANDLER( cdp1864_step_bgcolor_w )
|
| 287 | {
|
| 288 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 289 | |
| 290 | cdp1864->disp = 1;
|
| 291 | |
| 292 | if (++cdp1864->bgcolor > 3) cdp1864->bgcolor = 0;
|
| 293 | }
|
| 294 | |
| 295 | /*-------------------------------------------------
|
| 296 | cdp1864_con_w - color on write
|
| 297 | -------------------------------------------------*/
|
| 298 | |
| 299 | WRITE_LINE_DEVICE_HANDLER( cdp1864_con_w )
|
| 300 | {
|
| 301 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 302 | |
| 303 | if (!state)
|
| 304 | {
|
| 305 | cdp1864->con = 0;
|
| 306 | }
|
| 307 | }
|
| 308 | |
| 309 | /*-------------------------------------------------
|
| 310 | cdp1864_tone_latch_w - load tone latch
|
| 311 | -------------------------------------------------*/
|
| 312 | |
| 313 | WRITE8_DEVICE_HANDLER( cdp1864_tone_latch_w )
|
| 314 | {
|
| 315 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 316 | |
| 317 | cdp1864->latch = data;
|
| 318 | }
|
| 319 | |
| 320 | /*-------------------------------------------------
|
| 321 | cdp1864_dma_w - write DMA byte
|
| 322 | -------------------------------------------------*/
|
| 323 | |
| 324 | WRITE8_DEVICE_HANDLER( cdp1864_dma_w )
|
| 325 | {
|
| 326 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 327 | |
| 328 | int rdata = 1, bdata = 1, gdata = 1;
|
| 329 | int sx = video_screen_get_hpos(cdp1864->screen) + 4;
|
| 330 | int y = video_screen_get_vpos(cdp1864->screen);
|
| 331 | int x;
|
| 332 | |
| 333 | if (!cdp1864->con)
|
| 334 | {
|
| 335 | rdata = devcb_call_read_line(&cdp1864->in_rdata_func);
|
| 336 | bdata = devcb_call_read_line(&cdp1864->in_bdata_func);
|
| 337 | gdata = devcb_call_read_line(&cdp1864->in_gdata_func);
|
| 338 | }
|
| 339 | |
| 340 | for (x = 0; x < 8; x++)
|
| 341 | {
|
| 342 | int color = CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8;
|
| 343 | |
| 344 | if (BIT(data, 7))
|
| 345 | {
|
| 346 | color = (gdata << 2) | (bdata << 1) | rdata;
|
| 347 | }
|
| 348 | |
| 349 | *BITMAP_ADDR16(cdp1864->bitmap, y, sx + x) = color;
|
| 350 | |
| 351 | data <<= 1;
|
| 352 | }
|
| 353 | }
|
| 354 | |
| 355 | /*-------------------------------------------------
|
| 356 | STREAM_UPDATE( cdp1864_stream_update )
|
| 357 | -------------------------------------------------*/
|
| 358 | |
| 359 | static STREAM_UPDATE( cdp1864_stream_update )
|
| 360 | {
|
| 361 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 362 | |
| 363 | INT16 signal = cdp1864->signal;
|
| 364 | stream_sample_t *buffer = outputs[0];
|
| 365 | |
| 366 | memset( buffer, 0, samples * sizeof(*buffer) );
|
| 367 | |
| 368 | if (cdp1864->aoe)
|
| 369 | {
|
| 370 | double frequency = cpu_get_clock(cdp1864->cpu) / 8 / 4 / (cdp1864->latch + 1) / 2;
|
| 371 | int rate = device->machine->sample_rate / 2;
|
| 372 | |
| 373 | /* get progress through wave */
|
| 374 | int incr = cdp1864->incr;
|
| 375 | |
| 376 | if (signal < 0)
|
| 377 | {
|
| 378 | signal = -0x7fff;
|
| 379 | }
|
| 380 | else
|
| 381 | {
|
| 382 | signal = 0x7fff;
|
| 383 | }
|
| 384 | |
| 385 | while( samples-- > 0 )
|
| 386 | {
|
| 387 | *buffer++ = signal;
|
| 388 | incr -= frequency;
|
| 389 | while( incr < 0 )
|
| 390 | {
|
| 391 | incr += rate;
|
| 392 | signal = -signal;
|
| 393 | }
|
| 394 | }
|
| 395 | |
| 396 | /* store progress through wave */
|
| 397 | cdp1864->incr = incr;
|
| 398 | cdp1864->signal = signal;
|
| 399 | }
|
| 400 | }
|
| 401 | |
| 402 | /*-------------------------------------------------
|
| 403 | cdp1864_update - update screen
|
| 404 | -------------------------------------------------*/
|
| 405 | |
| 406 | void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect)
|
| 407 | {
|
| 408 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 409 | |
| 410 | if (cdp1864->disp)
|
| 411 | {
|
| 412 | copybitmap(bitmap, cdp1864->bitmap, 0, 0, 0, 0, cliprect);
|
| 413 | bitmap_fill(cdp1864->bitmap, cliprect, CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8);
|
| 414 | }
|
| 415 | else
|
| 416 | {
|
| 417 | bitmap_fill(bitmap, cliprect, get_black_pen(device->machine));
|
| 418 | }
|
| 419 | }
|
| 420 | |
| 421 | /*-------------------------------------------------
|
| 422 | DEVICE_START( cdp1864 )
|
| 423 | -------------------------------------------------*/
|
| 424 | |
| 425 | static DEVICE_START( cdp1864 )
|
| 426 | {
|
| 427 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 428 | const cdp1864_interface *intf = (const cdp1864_interface *) device->static_config;
|
| 429 | |
| 430 | /* resolve callbacks */
|
| 431 | devcb_resolve_read_line(&cdp1864->in_rdata_func, &intf->in_rdata_func, device);
|
| 432 | devcb_resolve_read_line(&cdp1864->in_bdata_func, &intf->in_bdata_func, device);
|
| 433 | devcb_resolve_read_line(&cdp1864->in_gdata_func, &intf->in_gdata_func, device);
|
| 434 | devcb_resolve_write_line(&cdp1864->out_int_func, &intf->out_int_func, device);
|
| 435 | devcb_resolve_write_line(&cdp1864->out_dmao_func, &intf->out_dmao_func, device);
|
| 436 | devcb_resolve_write_line(&cdp1864->out_efx_func, &intf->out_efx_func, device);
|
| 437 | |
| 438 | /* get the cpu */
|
| 439 | cdp1864->cpu = cputag_get_cpu(device->machine, intf->cpu_tag);
|
| 440 | |
| 441 | /* get the screen device */
|
| 442 | cdp1864->screen = devtag_get_device(device->machine, intf->screen_tag);
|
| 443 | assert(cdp1864->screen != NULL);
|
| 444 | |
| 445 | /* allocate the temporary bitmap */
|
| 446 | cdp1864->bitmap = auto_bitmap_alloc(device->machine, video_screen_get_width(cdp1864->screen), video_screen_get_height(cdp1864->screen), video_screen_get_format(cdp1864->screen));
|
| 447 | bitmap_fill(cdp1864->bitmap, 0, CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8);
|
| 448 | |
| 449 | /* initialize the palette */
|
| 450 | cdp1864_init_palette(device, intf);
|
| 451 | |
| 452 | /* create sound stream */
|
| 453 | cdp1864->stream = stream_create(device, 0, 1, device->machine->sample_rate, cdp1864, cdp1864_stream_update);
|
| 454 | |
| 455 | /* create the timers */
|
| 456 | cdp1864->int_timer = timer_alloc(device->machine, cdp1864_int_tick, (void *)device);
|
| 457 | cdp1864->efx_timer = timer_alloc(device->machine, cdp1864_efx_tick, (void *)device);
|
| 458 | cdp1864->dma_timer = timer_alloc(device->machine, cdp1864_dma_tick, (void *)device);
|
| 459 | |
| 460 | /* register for state saving */
|
| 461 | state_save_register_device_item(device, 0, cdp1864->disp);
|
| 462 | state_save_register_device_item(device, 0, cdp1864->dmaout);
|
| 463 | state_save_register_device_item(device, 0, cdp1864->bgcolor);
|
| 464 | state_save_register_device_item(device, 0, cdp1864->con);
|
| 465 | |
| 466 | state_save_register_device_item(device, 0, cdp1864->aoe);
|
| 467 | state_save_register_device_item(device, 0, cdp1864->latch);
|
| 468 | state_save_register_device_item(device, 0, cdp1864->signal);
|
| 469 | state_save_register_device_item(device, 0, cdp1864->incr);
|
| 470 | |
| 471 | state_save_register_bitmap(device->machine, "cdp1864", device->tag, 0, "cdp1864->bitmap", cdp1864->bitmap);
|
| 472 | }
|
| 473 | |
| 474 | /*-------------------------------------------------
|
| 475 | DEVICE_RESET( cdp1864 )
|
| 476 | -------------------------------------------------*/
|
| 477 | |
| 478 | static DEVICE_RESET( cdp1864 )
|
| 479 | {
|
| 480 | cdp1864_t *cdp1864 = get_safe_token(device);
|
| 481 | |
| 482 | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_START, 0), 0);
|
| 483 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_START, 0), 0);
|
| 484 | timer_adjust_oneshot(cdp1864->dma_timer, cpu_clocks_to_attotime(device->machine->firstcpu, CDP1864_CYCLES_DMA_START), 0);
|
| 485 | |
| 486 | cdp1864->disp = 0;
|
| 487 | cdp1864->dmaout = 0;
|
| 488 | cdp1864->bgcolor = 0;
|
| 489 | cdp1864->con = 1;
|
| 490 | |
| 491 | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE);
|
| 492 | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE);
|
| 493 | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE);
|
| 494 | |
| 495 | cdp1864_aoe_w(device, 0);
|
| 496 | }
|
| 497 | |
| 498 | /*-------------------------------------------------
|
| 499 | DEVICE_GET_INFO( cdp1864 )
|
| 500 | -------------------------------------------------*/
|
| 501 | |
| 502 | DEVICE_GET_INFO( cdp1864 )
|
| 503 | {
|
| 504 | switch (state)
|
| 505 | {
|
| 506 | /* --- the following bits of info are returned as 64-bit signed integers --- */
|
| 507 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(cdp1864_t); break;
|
| 508 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break;
|
| 509 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break;
|
| 510 | |
| 511 | /* --- the following bits of info are returned as pointers to data or functions --- */
|
| 512 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cdp1864); break;
|
| 513 | case DEVINFO_FCT_STOP: /* Nothing */ break;
|
| 514 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1864); break;
|
| 515 | |
| 516 | /* --- the following bits of info are returned as NULL-terminated strings --- */
|
| 517 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1864"); break;
|
| 518 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break;
|
| 519 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break;
|
| 520 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
|
| 521 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break;
|
| 522 | }
|
| 523 | }
|
src/emu/sound/cdp1864.h
| r0 | r5706 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | RCA CDP1864C COS/MOS PAL Compatible Color TV Interface
|
| 4 | |
| 5 | Copyright MESS Team.
|
| 6 | Visit http://mamedev.org for licensing and usage restrictions.
|
| 7 | |
| 8 | **********************************************************************
|
| 9 | ________________
|
| 10 | INLACE 1 ---| \/ |--- 40 Vdd
|
| 11 | CLK IN_ 2 ---| |--- 39 AUD
|
| 12 | CLR OUT_ 3 ---| |--- 38 CLR IN_
|
| 13 | AOE 4 ---| |--- 37 DMA0_
|
| 14 | SC1 5 ---| |--- 36 INT_
|
| 15 | SC0 6 ---| |--- 35 TPA
|
| 16 | MRD_ 7 ---| |--- 34 TPB
|
| 17 | BUS 7 8 ---| |--- 33 EVS
|
| 18 | BUS 6 9 ---| |--- 32 V SYNC
|
| 19 | BUS 5 10 ---| CDP1864C |--- 31 H SYNC
|
| 20 | BUS 4 11 ---| top view |--- 30 C SYNC_
|
| 21 | BUS 3 12 ---| |--- 29 RED
|
| 22 | BUS 2 13 ---| |--- 28 BLUE
|
| 23 | BUS 1 14 ---| |--- 27 GREEN
|
| 24 | BUS 0 15 ---| |--- 26 BCK GND_
|
| 25 | CON_ 16 ---| |--- 25 BURST
|
| 26 | N2 17 ---| |--- 24 ALT
|
| 27 | EF_ 18 ---| |--- 23 R DATA
|
| 28 | N0 19 ---| |--- 22 G DATA
|
| 29 | Vss 20 ---|________________|--- 21 B DATA
|
| 30 | |
| 31 | |
| 32 | http://homepage.mac.com/ruske/cosmacelf/cdp1864.pdf
|
| 33 | |
| 34 | **********************************************************************/
|
| 35 | |
| 36 | #ifndef __CDP1864__
|
| 37 | #define __CDP1864__
|
| 38 | |
| 39 | #include "devcb.h"
|
| 40 | |
| 41 | /***************************************************************************
|
| 42 | PARAMETERS
|
| 43 | ***************************************************************************/
|
| 44 | |
| 45 | #define CDP1864_CLOCK XTAL_1_75MHz
|
| 46 | |
| 47 | #define CDP1864_VISIBLE_COLUMNS 64
|
| 48 | #define CDP1864_VISIBLE_LINES 192
|
| 49 | |
| 50 | #define CDP1864_HBLANK_END 1 * 8
|
| 51 | #define CDP1864_HBLANK_START 13 * 8
|
| 52 | #define CDP1864_HSYNC_START 0 * 8
|
| 53 | #define CDP1864_HSYNC_END 1 * 8
|
| 54 | #define CDP1864_SCREEN_START 4 * 8
|
| 55 | #define CDP1864_SCREEN_END 12 * 8
|
| 56 | #define CDP1864_SCREEN_WIDTH 14 * 8
|
| 57 | |
| 58 | #define CDP1864_TOTAL_SCANLINES 312
|
| 59 | |
| 60 | #define CDP1864_SCANLINE_VBLANK_START CDP1864_TOTAL_SCANLINES - 4
|
| 61 | #define CDP1864_SCANLINE_VBLANK_END 20
|
| 62 | #define CDP1864_SCANLINE_VSYNC_START 0
|
| 63 | #define CDP1864_SCANLINE_VSYNC_END 4
|
| 64 | #define CDP1864_SCANLINE_DISPLAY_START 60 // ???
|
| 65 | #define CDP1864_SCANLINE_DISPLAY_END CDP1864_SCANLINE_DISPLAY_START + CDP1864_VISIBLE_LINES
|
| 66 | #define CDP1864_SCANLINE_INT_START CDP1864_SCANLINE_DISPLAY_START - 2
|
| 67 | #define CDP1864_SCANLINE_INT_END CDP1864_SCANLINE_DISPLAY_START
|
| 68 | #define CDP1864_SCANLINE_EFX_TOP_START CDP1864_SCANLINE_DISPLAY_START - 4
|
| 69 | #define CDP1864_SCANLINE_EFX_TOP_END CDP1864_SCANLINE_DISPLAY_START
|
| 70 | #define CDP1864_SCANLINE_EFX_BOTTOM_START CDP1864_SCANLINE_DISPLAY_END - 4
|
| 71 | #define CDP1864_SCANLINE_EFX_BOTTOM_END CDP1864_SCANLINE_DISPLAY_END
|
| 72 | |
| 73 | /***************************************************************************
|
| 74 | MACROS / CONSTANTS
|
| 75 | ***************************************************************************/
|
| 76 | |
| 77 | #define CDP1864 DEVICE_GET_INFO_NAME(cdp1864)
|
| 78 | #define SOUND_CDP1864 CDP1864
|
| 79 | |
| 80 | #define MDRV_CDP1864_ADD(_tag, _clock, _config) \
|
| 81 | MDRV_DEVICE_ADD(_tag, SOUND, _clock) \
|
| 82 | MDRV_DEVICE_CONFIG_DATAPTR(sound_config, type, SOUND_CDP1864) \
|
| 83 | MDRV_DEVICE_CONFIG(_config)
|
| 84 | |
| 85 | #define CDP1864_INTERFACE(name) \
|
| 86 | const cdp1864_interface (name) =
|
| 87 | |
| 88 | /***************************************************************************
|
| 89 | TYPE DEFINITIONS
|
| 90 | ***************************************************************************/
|
| 91 | |
| 92 | typedef enum _cdp1864_format cdp1864_format;
|
| 93 | enum _cdp1864_format {
|
| 94 | CDP1864_NON_INTERLACED = 0,
|
| 95 | CDP1864_INTERLACED
|
| 96 | };
|
| 97 | |
| 98 | typedef struct _cdp1864_interface cdp1864_interface;
|
| 99 | struct _cdp1864_interface
|
| 100 | {
|
| 101 | const char *cpu_tag; /* cpu we are working with */
|
| 102 | const char *screen_tag; /* screen we are acting on */
|
| 103 | |
| 104 | cdp1864_format interlace; /* interlace */
|
| 105 | |
| 106 | devcb_read_line in_rdata_func;
|
| 107 | devcb_read_line in_bdata_func;
|
| 108 | devcb_read_line in_gdata_func;
|
| 109 | |
| 110 | /* this gets called for every change of the INT pin (pin 36) */
|
| 111 | devcb_write_line out_int_func;
|
| 112 | |
| 113 | /* this gets called for every change of the DMAO pin (pin 37) */
|
| 114 | devcb_write_line out_dmao_func;
|
| 115 | |
| 116 | /* this gets called for every change of the EFX pin (pin 18) */
|
| 117 | devcb_write_line out_efx_func;
|
| 118 | |
| 119 | double res_r; /* red output resistor value */
|
| 120 | double res_g; /* green output resistor value */
|
| 121 | double res_b; /* blue output resistor value */
|
| 122 | double res_bkg; /* background output resistor value */
|
| 123 | };
|
| 124 | |
| 125 | /***************************************************************************
|
| 126 | PROTOTYPES
|
| 127 | ***************************************************************************/
|
| 128 | |
| 129 | /* device interface */
|
| 130 | DEVICE_GET_INFO( cdp1864 );
|
| 131 | |
| 132 | /* display on (0x69) */
|
| 133 | READ8_DEVICE_HANDLER( cdp1864_dispon_r ) ATTR_NONNULL(1);
|
| 134 | |
| 135 | /* display off (0x6c) */
|
| 136 | READ8_DEVICE_HANDLER( cdp1864_dispoff_r ) ATTR_NONNULL(1);
|
| 137 | |
| 138 | /* step background color (0x61) */
|
| 139 | WRITE8_DEVICE_HANDLER( cdp1864_step_bgcolor_w ) ATTR_NONNULL(1);
|
| 140 | |
| 141 | /* color on */
|
| 142 | WRITE_LINE_DEVICE_HANDLER( cdp1864_con_w ) ATTR_NONNULL(1);
|
| 143 | |
| 144 | /* load tone latch (0x64) */
|
| 145 | WRITE8_DEVICE_HANDLER( cdp1864_tone_latch_w ) ATTR_NONNULL(1);
|
| 146 | |
| 147 | /* audio output enable */
|
| 148 | WRITE_LINE_DEVICE_HANDLER( cdp1864_aoe_w ) ATTR_NONNULL(1);
|
| 149 | |
| 150 | /* DMA write */
|
| 151 | WRITE8_DEVICE_HANDLER( cdp1864_dma_w ) ATTR_NONNULL(1);
|
| 152 | |
| 153 | /* screen update */
|
| 154 | void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) ATTR_NONNULL(1) ATTR_NONNULL(2) ATTR_NONNULL(3);
|
| 155 | |
| 156 | #endif
|
src/mess/video/cdp1864.c
| r5705 | r5706 | |
| 1 | | /* |
| 2 | | |
| 3 | | TODO: |
| 4 | | |
| 5 | | - interlace mode |
| 6 | | - PAL output, currently using RGB |
| 7 | | - connect to sound system when possible |
| 8 | | - cpu synchronization |
| 9 | | |
| 10 | | SC1 and SC0 are used to provide CDP1864C-to-CPU synchronization for a jitter-free display. |
| 11 | | During every horizontal sync the CDP1864C samples SC0 and SC1 for SC0 = 1 and SC1 = 0 |
| 12 | | (CDP1800 execute state). Detection of a fetch cycle causes the CDP1864C to skip cycles to |
| 13 | | attain synchronization. (i.e. picture moves 8 pixels to the right) |
| 14 | | |
| 15 | | */ |
| 16 | | |
| 17 | | #include "driver.h" |
| 18 | | #include "sndintrf.h" |
| 19 | | #include "streams.h" |
| 20 | | #include "cpu/cdp1802/cdp1802.h" |
| 21 | | #include "sound/beep.h" |
| 22 | | #include "video/cdp1864.h" |
| 23 | | |
| 24 | | /*************************************************************************** |
| 25 | | PARAMETERS |
| 26 | | ***************************************************************************/ |
| 27 | | |
| 28 | | #define CDP1864_DEFAULT_LATCH 0x35 |
| 29 | | |
| 30 | | #define CDP1864_CYCLES_DMA_START 2*8 |
| 31 | | #define CDP1864_CYCLES_DMA_ACTIVE 8*8 |
| 32 | | #define CDP1864_CYCLES_DMA_WAIT 6*8 |
| 33 | | |
| 34 | | static const int CDP1864_BACKGROUND_COLOR_SEQUENCE[] = { 2, 0, 1, 4 }; |
| 35 | | |
| 36 | | /*************************************************************************** |
| 37 | | TYPE DEFINITIONS |
| 38 | | ***************************************************************************/ |
| 39 | | |
| 40 | | typedef struct _cdp1864_t cdp1864_t; |
| 41 | | struct _cdp1864_t |
| 42 | | { |
| 43 | | devcb_resolved_write_line out_int_func; |
| 44 | | devcb_resolved_write_line out_dmao_func; |
| 45 | | devcb_resolved_write_line out_efx_func; |
| 46 | | |
| 47 | | const device_config *screen; /* screen */ |
| 48 | | bitmap_t *bitmap; /* bitmap */ |
| 49 | | sound_stream *stream; /* sound output */ |
| 50 | | |
| 51 | | /* video state */ |
| 52 | | int disp; /* display on */ |
| 53 | | int dmaout; /* DMA request active */ |
| 54 | | int bgcolor; /* background color */ |
| 55 | | |
| 56 | | /* sound state */ |
| 57 | | int audio; /* audio on */ |
| 58 | | int latch; /* sound latch */ |
| 59 | | INT16 signal; /* current signal */ |
| 60 | | int incr; /* initial wave state */ |
| 61 | | |
| 62 | | /* timers */ |
| 63 | | emu_timer *int_timer; /* interrupt timer */ |
| 64 | | emu_timer *efx_timer; /* EFx timer */ |
| 65 | | emu_timer *dma_timer; /* DMA timer */ |
| 66 | | |
| 67 | | const device_config *cpu; |
| 68 | | }; |
| 69 | | |
| 70 | | /*************************************************************************** |
| 71 | | INLINE FUNCTIONS |
| 72 | | ***************************************************************************/ |
| 73 | | |
| 74 | | INLINE cdp1864_t *get_safe_token(const device_config *device) |
| 75 | | { |
| 76 | | assert(device != NULL); |
| 77 | | assert(device->token != NULL); |
| 78 | | |
| 79 | | return (cdp1864_t *)device->token; |
| 80 | | } |
| 81 | | |
| 82 | | INLINE const cdp1864_interface *get_interface(const device_config *device) |
| 83 | | { |
| 84 | | assert(device != NULL); |
| 85 | | assert((device->type == CDP1864)); |
| 86 | | return (const cdp1864_interface *) device->static_config; |
| 87 | | } |
| 88 | | |
| 89 | | /*************************************************************************** |
| 90 | | IMPLEMENTATION |
| 91 | | ***************************************************************************/ |
| 92 | | |
| 93 | | /*------------------------------------------------- |
| 94 | | TIMER_CALLBACK( cdp1864_int_tick ) |
| 95 | | -------------------------------------------------*/ |
| 96 | | |
| 97 | | static TIMER_CALLBACK( cdp1864_int_tick ) |
| 98 | | { |
| 99 | | const device_config *device = ptr; |
| 100 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 101 | | |
| 102 | | int scanline = video_screen_get_vpos(cdp1864->screen); |
| 103 | | |
| 104 | | if (scanline == CDP1864_SCANLINE_INT_START) |
| 105 | | { |
| 106 | | if (cdp1864->disp) |
| 107 | | { |
| 108 | | devcb_call_write_line(&cdp1864->out_int_func, ASSERT_LINE); |
| 109 | | } |
| 110 | | |
| 111 | | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_END, 0), 0); |
| 112 | | } |
| 113 | | else |
| 114 | | { |
| 115 | | if (cdp1864->disp) |
| 116 | | { |
| 117 | | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE); |
| 118 | | } |
| 119 | | |
| 120 | | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_START, 0), 0); |
| 121 | | } |
| 122 | | } |
| 123 | | |
| 124 | | /*------------------------------------------------- |
| 125 | | TIMER_CALLBACK( cdp1864_efx_tick ) |
| 126 | | -------------------------------------------------*/ |
| 127 | | |
| 128 | | static TIMER_CALLBACK( cdp1864_efx_tick ) |
| 129 | | { |
| 130 | | const device_config *device = ptr; |
| 131 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 132 | | |
| 133 | | int scanline = video_screen_get_vpos(cdp1864->screen); |
| 134 | | |
| 135 | | switch (scanline) |
| 136 | | { |
| 137 | | case CDP1864_SCANLINE_EFX_TOP_START: |
| 138 | | devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE); |
| 139 | | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_END, 0), 0); |
| 140 | | break; |
| 141 | | |
| 142 | | case CDP1864_SCANLINE_EFX_TOP_END: |
| 143 | | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE); |
| 144 | | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_BOTTOM_START, 0), 0); |
| 145 | | break; |
| 146 | | |
| 147 | | case CDP1864_SCANLINE_EFX_BOTTOM_START: |
| 148 | | devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE); |
| 149 | | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_BOTTOM_END, 0), 0); |
| 150 | | break; |
| 151 | | |
| 152 | | case CDP1864_SCANLINE_EFX_BOTTOM_END: |
| 153 | | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE); |
| 154 | | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_START, 0), 0); |
| 155 | | break; |
| 156 | | } |
| 157 | | } |
| 158 | | |
| 159 | | /*------------------------------------------------- |
| 160 | | TIMER_CALLBACK( cdp1864_dma_tick ) |
| 161 | | -------------------------------------------------*/ |
| 162 | | |
| 163 | | static TIMER_CALLBACK( cdp1864_dma_tick ) |
| 164 | | { |
| 165 | | const device_config *device = ptr; |
| 166 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 167 | | |
| 168 | | int scanline = video_screen_get_vpos(cdp1864->screen); |
| 169 | | |
| 170 | | if (cdp1864->dmaout) |
| 171 | | { |
| 172 | | if (cdp1864->disp) |
| 173 | | { |
| 174 | | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) |
| 175 | | { |
| 176 | | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE); |
| 177 | | } |
| 178 | | } |
| 179 | | |
| 180 | | timer_adjust_oneshot(cdp1864->dma_timer, cpu_clocks_to_attotime(machine->firstcpu, CDP1864_CYCLES_DMA_WAIT), 0); |
| 181 | | |
| 182 | | cdp1864->dmaout = 0; |
| 183 | | } |
| 184 | | else |
| 185 | | { |
| 186 | | if (cdp1864->disp) |
| 187 | | { |
| 188 | | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) |
| 189 | | { |
| 190 | | devcb_call_write_line(&cdp1864->out_dmao_func, ASSERT_LINE); |
| 191 | | } |
| 192 | | } |
| 193 | | |
| 194 | | timer_adjust_oneshot(cdp1864->dma_timer, cpu_clocks_to_attotime(machine->firstcpu, CDP1864_CYCLES_DMA_ACTIVE), 0); |
| 195 | | |
| 196 | | cdp1864->dmaout = 1; |
| 197 | | } |
| 198 | | } |
| 199 | | |
| 200 | | /*------------------------------------------------- |
| 201 | | cdp1864_init_palette - initialize palette |
| 202 | | -------------------------------------------------*/ |
| 203 | | |
| 204 | | static void cdp1864_init_palette(const device_config *device, const cdp1864_interface *intf) |
| 205 | | { |
| 206 | | int i; |
| 207 | | |
| 208 | | double res_total = intf->res_r + intf->res_g + intf->res_b + intf->res_bkg; |
| 209 | | |
| 210 | | int weight_r = (intf->res_r / res_total) * 100; |
| 211 | | int weight_g = (intf->res_g / res_total) * 100; |
| 212 | | int weight_b = (intf->res_b / res_total) * 100; |
| 213 | | int weight_bkg = (intf->res_bkg / res_total) * 100; |
| 214 | | |
| 215 | | for (i = 0; i < 16; i++) |
| 216 | | { |
| 217 | | int r, g, b, luma = 0; |
| 218 | | |
| 219 | | luma += (i & 4) ? weight_r : 0; |
| 220 | | luma += (i & 1) ? weight_g : 0; |
| 221 | | luma += (i & 2) ? weight_b : 0; |
| 222 | | luma += (i & 8) ? 0 : weight_bkg; |
| 223 | | |
| 224 | | luma = (luma * 0xff) / 100; |
| 225 | | |
| 226 | | r = (i & 4) ? luma : 0; |
| 227 | | g = (i & 1) ? luma : 0; |
| 228 | | b = (i & 2) ? luma : 0; |
| 229 | | |
| 230 | | palette_set_color_rgb( device->machine, i, r, g, b ); |
| 231 | | } |
| 232 | | } |
| 233 | | |
| 234 | | /*------------------------------------------------- |
| 235 | | cdp1864_aoe_w - audio output enable |
| 236 | | -------------------------------------------------*/ |
| 237 | | |
| 238 | | void cdp1864_aoe_w(const device_config *device, int level) |
| 239 | | { |
| 240 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 241 | | const device_config *speaker = devtag_get_device(device->machine, "beep"); |
| 242 | | |
| 243 | | if (!level) |
| 244 | | { |
| 245 | | cdp1864->latch = CDP1864_DEFAULT_LATCH; |
| 246 | | } |
| 247 | | |
| 248 | | cdp1864->audio = level; |
| 249 | | |
| 250 | | beep_set_state(speaker, level); // TODO: remove this |
| 251 | | } |
| 252 | | |
| 253 | | /*------------------------------------------------- |
| 254 | | cdp1864_dispon_r - turn display on |
| 255 | | -------------------------------------------------*/ |
| 256 | | |
| 257 | | READ8_DEVICE_HANDLER( cdp1864_dispon_r ) |
| 258 | | { |
| 259 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 260 | | |
| 261 | | cdp1864->disp = 1; |
| 262 | | |
| 263 | | return 0xff; |
| 264 | | } |
| 265 | | |
| 266 | | /*------------------------------------------------- |
| 267 | | cdp1864_dispoff_r - turn display off |
| 268 | | -------------------------------------------------*/ |
| 269 | | |
| 270 | | READ8_DEVICE_HANDLER( cdp1864_dispoff_r ) |
| 271 | | { |
| 272 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 273 | | |
| 274 | | cdp1864->disp = 0; |
| 275 | | |
| 276 | | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE); |
| 277 | | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE); |
| 278 | | |
| 279 | | return 0xff; |
| 280 | | } |
| 281 | | |
| 282 | | /*------------------------------------------------- |
| 283 | | cdp1864_step_bgcolor_w - step background color |
| 284 | | -------------------------------------------------*/ |
| 285 | | |
| 286 | | WRITE8_DEVICE_HANDLER( cdp1864_step_bgcolor_w ) |
| 287 | | { |
| 288 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 289 | | |
| 290 | | cdp1864->disp = 1; |
| 291 | | |
| 292 | | if (++cdp1864->bgcolor > 3) cdp1864->bgcolor = 0; |
| 293 | | } |
| 294 | | |
| 295 | | /*------------------------------------------------- |
| 296 | | cdp1864_tone_latch_w - load tone latch |
| 297 | | -------------------------------------------------*/ |
| 298 | | |
| 299 | | WRITE8_DEVICE_HANDLER( cdp1864_tone_latch_w ) |
| 300 | | { |
| 301 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 302 | | const device_config *speaker = devtag_get_device(device->machine, "beep"); |
| 303 | | |
| 304 | | cdp1864->latch = data; |
| 305 | | beep_set_frequency(speaker, CDP1864_CLOCK / 8 / 4 / (data + 1) / 2); // TODO: remove this |
| 306 | | } |
| 307 | | |
| 308 | | /*------------------------------------------------- |
| 309 | | cdp1864_dma_w - write DMA byte |
| 310 | | -------------------------------------------------*/ |
| 311 | | |
| 312 | | void cdp1864_dma_w(const device_config *device, UINT8 data, int color_on, int rdata, int gdata, int bdata) |
| 313 | | { |
| 314 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 315 | | |
| 316 | | int sx = video_screen_get_hpos(cdp1864->screen) + 4; |
| 317 | | int y = video_screen_get_vpos(cdp1864->screen); |
| 318 | | int x; |
| 319 | | |
| 320 | | if (color_on == CLEAR_LINE) |
| 321 | | { |
| 322 | | rdata = 1; |
| 323 | | gdata = 1; |
| 324 | | bdata = 1; |
| 325 | | } |
| 326 | | |
| 327 | | for (x = 0; x < 8; x++) |
| 328 | | { |
| 329 | | int color = CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8; |
| 330 | | |
| 331 | | if (BIT(data, 7)) |
| 332 | | { |
| 333 | | color = (gdata << 2) | (bdata << 1) | rdata; |
| 334 | | } |
| 335 | | |
| 336 | | *BITMAP_ADDR16(cdp1864->bitmap, y, sx + x) = color; |
| 337 | | |
| 338 | | data <<= 1; |
| 339 | | } |
| 340 | | } |
| 341 | | |
| 342 | | /*------------------------------------------------- |
| 343 | | cdp1864_sound_update - update sound |
| 344 | | -------------------------------------------------*/ |
| 345 | | |
| 346 | | #ifdef UNUSED_FUNCTION |
| 347 | | static void cdp1864_sound_update(const device_config *device, stream_sample_t **inputs, stream_sample_t **_buffer, int length) |
| 348 | | { |
| 349 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 350 | | |
| 351 | | INT16 signal = cdp1864->signal; |
| 352 | | stream_sample_t *buffer = _buffer[0]; |
| 353 | | |
| 354 | | memset(buffer, 0, length * sizeof(*buffer)); |
| 355 | | |
| 356 | | if (cdp1864->audio) |
| 357 | | { |
| 358 | | double frequency = cdp1864->intf->clock / 8 / 4 / (cdp1864->latch + 1) / 2; |
| 359 | | |
| 360 | | int rate = device->machine->sample_rate / 2; |
| 361 | | |
| 362 | | /* get progress through wave */ |
| 363 | | int incr = cdp1864->incr; |
| 364 | | |
| 365 | | if (signal < 0) |
| 366 | | { |
| 367 | | signal = -0x7fff; |
| 368 | | } |
| 369 | | else |
| 370 | | { |
| 371 | | signal = 0x7fff; |
| 372 | | } |
| 373 | | |
| 374 | | while( length-- > 0 ) |
| 375 | | { |
| 376 | | *buffer++ = signal; |
| 377 | | incr -= frequency; |
| 378 | | while( incr < 0 ) |
| 379 | | { |
| 380 | | incr += rate; |
| 381 | | signal = -signal; |
| 382 | | } |
| 383 | | } |
| 384 | | |
| 385 | | /* store progress through wave */ |
| 386 | | cdp1864->incr = incr; |
| 387 | | cdp1864->signal = signal; |
| 388 | | } |
| 389 | | } |
| 390 | | #endif |
| 391 | | |
| 392 | | /*------------------------------------------------- |
| 393 | | cdp1864_update - update screen |
| 394 | | -------------------------------------------------*/ |
| 395 | | |
| 396 | | void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 397 | | { |
| 398 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 399 | | |
| 400 | | if (cdp1864->disp) |
| 401 | | { |
| 402 | | copybitmap(bitmap, cdp1864->bitmap, 0, 0, 0, 0, cliprect); |
| 403 | | bitmap_fill(cdp1864->bitmap, cliprect, CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8); |
| 404 | | } |
| 405 | | else |
| 406 | | { |
| 407 | | bitmap_fill(bitmap, cliprect, get_black_pen(device->machine)); |
| 408 | | } |
| 409 | | } |
| 410 | | |
| 411 | | /*------------------------------------------------- |
| 412 | | DEVICE_START( cdp1864 ) |
| 413 | | -------------------------------------------------*/ |
| 414 | | |
| 415 | | static DEVICE_START( cdp1864 ) |
| 416 | | { |
| 417 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 418 | | const cdp1864_interface *intf = get_interface(device); |
| 419 | | |
| 420 | | /* resolve callbacks */ |
| 421 | | devcb_resolve_write_line(&cdp1864->out_int_func, &intf->out_int_func, device); |
| 422 | | devcb_resolve_write_line(&cdp1864->out_dmao_func, &intf->out_dmao_func, device); |
| 423 | | devcb_resolve_write_line(&cdp1864->out_efx_func, &intf->out_efx_func, device); |
| 424 | | |
| 425 | | /* get the cpu */ |
| 426 | | cdp1864->cpu = cputag_get_cpu(device->machine, intf->cpu_tag); |
| 427 | | |
| 428 | | /* get the screen device */ |
| 429 | | cdp1864->screen = devtag_get_device(device->machine, intf->screen_tag); |
| 430 | | assert(cdp1864->screen != NULL); |
| 431 | | |
| 432 | | /* allocate the temporary bitmap */ |
| 433 | | cdp1864->bitmap = auto_bitmap_alloc(device->machine, video_screen_get_width(cdp1864->screen), video_screen_get_height(cdp1864->screen), video_screen_get_format(cdp1864->screen)); |
| 434 | | bitmap_fill(cdp1864->bitmap, 0, CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8); |
| 435 | | |
| 436 | | /* initialize the palette */ |
| 437 | | cdp1864_init_palette(device, intf); |
| 438 | | |
| 439 | | /* create the timers */ |
| 440 | | cdp1864->int_timer = timer_alloc(device->machine, cdp1864_int_tick, (void *)device); |
| 441 | | cdp1864->efx_timer = timer_alloc(device->machine, cdp1864_efx_tick, (void *)device); |
| 442 | | cdp1864->dma_timer = timer_alloc(device->machine, cdp1864_dma_tick, (void *)device); |
| 443 | | |
| 444 | | /* register for state saving */ |
| 445 | | state_save_register_device_item(device, 0, cdp1864->disp); |
| 446 | | state_save_register_device_item(device, 0, cdp1864->dmaout); |
| 447 | | state_save_register_device_item(device, 0, cdp1864->bgcolor); |
| 448 | | |
| 449 | | state_save_register_device_item(device, 0, cdp1864->audio); |
| 450 | | state_save_register_device_item(device, 0, cdp1864->latch); |
| 451 | | state_save_register_device_item(device, 0, cdp1864->signal); |
| 452 | | state_save_register_device_item(device, 0, cdp1864->incr); |
| 453 | | |
| 454 | | state_save_register_bitmap(device->machine, "cdp1864", device->tag, 0, "cdp1864->bitmap", cdp1864->bitmap); |
| 455 | | } |
| 456 | | |
| 457 | | /*------------------------------------------------- |
| 458 | | DEVICE_RESET( cdp1861 ) |
| 459 | | -------------------------------------------------*/ |
| 460 | | |
| 461 | | static DEVICE_RESET( cdp1864 ) |
| 462 | | { |
| 463 | | cdp1864_t *cdp1864 = get_safe_token(device); |
| 464 | | |
| 465 | | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_START, 0), 0); |
| 466 | | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_START, 0), 0); |
| 467 | | timer_adjust_oneshot(cdp1864->dma_timer, cpu_clocks_to_attotime(device->machine->firstcpu, CDP1864_CYCLES_DMA_START), 0); |
| 468 | | |
| 469 | | cdp1864->disp = 0; |
| 470 | | cdp1864->dmaout = 0; |
| 471 | | cdp1864->bgcolor = 0; |
| 472 | | |
| 473 | | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE); |
| 474 | | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE); |
| 475 | | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE); |
| 476 | | |
| 477 | | cdp1864_aoe_w(device, 0); |
| 478 | | } |
| 479 | | |
| 480 | | /*------------------------------------------------- |
| 481 | | DEVICE_GET_INFO( cdp1861 ) |
| 482 | | -------------------------------------------------*/ |
| 483 | | |
| 484 | | DEVICE_GET_INFO( cdp1864 ) |
| 485 | | { |
| 486 | | switch (state) |
| 487 | | { |
| 488 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 489 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(cdp1864_t); break; |
| 490 | | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 491 | | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 492 | | |
| 493 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 494 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cdp1864); break; |
| 495 | | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 496 | | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1864); break; |
| 497 | | |
| 498 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 499 | | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1864"); break; |
| 500 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; |
| 501 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 502 | | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 503 | | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
| 504 | | } |
| 505 | | } |
src/mess/video/cdp1864.h
| r5705 | r5706 | |
| 1 | | /* |
| 2 | | |
| 3 | | CDP1864C COS/MOS PAL Compatible Color TV Interface |
| 4 | | |
| 5 | | ________________ |
| 6 | | INLACE 1 ---| \/ |--- 40 Vdd |
| 7 | | CLK IN_ 2 ---| |--- 39 AUD |
| 8 | | CLR OUT_ 3 ---| |--- 38 CLR IN_ |
| 9 | | AOE 4 ---| |--- 37 DMA0_ |
| 10 | | SC1 5 ---| |--- 36 INT_ |
| 11 | | SC0 6 ---| |--- 35 TPA |
| 12 | | MRD_ 7 ---| |--- 34 TPB |
| 13 | | BUS 7 8 ---| |--- 33 EVS |
| 14 | | BUS 6 9 ---| |--- 32 V SYNC |
| 15 | | BUS 5 10 ---| CDP1864C |--- 31 H SYNC |
| 16 | | BUS 4 11 ---| top view |--- 30 C SYNC_ |
| 17 | | BUS 3 12 ---| |--- 29 RED |
| 18 | | BUS 2 13 ---| |--- 28 BLUE |
| 19 | | BUS 1 14 ---| |--- 27 GREEN |
| 20 | | BUS 0 15 ---| |--- 26 BCK GND_ |
| 21 | | CON_ 16 ---| |--- 25 BURST |
| 22 | | N2 17 ---| |--- 24 ALT |
| 23 | | EF_ 18 ---| |--- 23 R DATA |
| 24 | | N0 19 ---| |--- 22 G DATA |
| 25 | | Vss 20 ---|________________|--- 21 B DATA |
| 26 | | |
| 27 | | |
| 28 | | http://homepage.mac.com/ruske/cosmacelf/cdp1864.pdf |
| 29 | | |
| 30 | | */ |
| 31 | | |
| 32 | | #ifndef __CDP1864__ |
| 33 | | #define __CDP1864__ |
| 34 | | |
| 35 | | #include "devcb.h" |
| 36 | | |
| 37 | | /*************************************************************************** |
| 38 | | PARAMETERS |
| 39 | | ***************************************************************************/ |
| 40 | | |
| 41 | | #define CDP1864_CLOCK XTAL_1_75MHz |
| 42 | | |
| 43 | | #define CDP1864_VISIBLE_COLUMNS 64 |
| 44 | | #define CDP1864_VISIBLE_LINES 192 |
| 45 | | |
| 46 | | #define CDP1864_HBLANK_END 1 * 8 |
| 47 | | #define CDP1864_HBLANK_START 13 * 8 |
| 48 | | #define CDP1864_HSYNC_START 0 * 8 |
| 49 | | #define CDP1864_HSYNC_END 1 * 8 |
| 50 | | #define CDP1864_SCREEN_START 4 * 8 |
| 51 | | #define CDP1864_SCREEN_END 12 * 8 |
| 52 | | #define CDP1864_SCREEN_WIDTH 14 * 8 |
| 53 | | |
| 54 | | #define CDP1864_TOTAL_SCANLINES 312 |
| 55 | | |
| 56 | | #define CDP1864_SCANLINE_VBLANK_START CDP1864_TOTAL_SCANLINES - 4 |
| 57 | | #define CDP1864_SCANLINE_VBLANK_END 20 |
| 58 | | #define CDP1864_SCANLINE_VSYNC_START 0 |
| 59 | | #define CDP1864_SCANLINE_VSYNC_END 4 |
| 60 | | #define CDP1864_SCANLINE_DISPLAY_START 60 // ??? |
| 61 | | #define CDP1864_SCANLINE_DISPLAY_END CDP1864_SCANLINE_DISPLAY_START + CDP1864_VISIBLE_LINES |
| 62 | | #define CDP1864_SCANLINE_INT_START CDP1864_SCANLINE_DISPLAY_START - 2 |
| 63 | | #define CDP1864_SCANLINE_INT_END CDP1864_SCANLINE_DISPLAY_START |
| 64 | | #define CDP1864_SCANLINE_EFX_TOP_START CDP1864_SCANLINE_DISPLAY_START - 4 |
| 65 | | #define CDP1864_SCANLINE_EFX_TOP_END CDP1864_SCANLINE_DISPLAY_START |
| 66 | | #define CDP1864_SCANLINE_EFX_BOTTOM_START CDP1864_SCANLINE_DISPLAY_END - 4 |
| 67 | | #define CDP1864_SCANLINE_EFX_BOTTOM_END CDP1864_SCANLINE_DISPLAY_END |
| 68 | | |
| 69 | | /*************************************************************************** |
| 70 | | MACROS / CONSTANTS |
| 71 | | ***************************************************************************/ |
| 72 | | |
| 73 | | #define CDP1864 DEVICE_GET_INFO_NAME(cdp1864) |
| 74 | | |
| 75 | | #define MDRV_CDP1864_ADD(_tag, _clock, _config) \ |
| 76 | | MDRV_DEVICE_ADD(_tag, CDP1864, _clock) \ |
| 77 | | MDRV_DEVICE_CONFIG(_config) |
| 78 | | |
| 79 | | #define CDP1864_INTERFACE(name) const cdp1864_interface (name)= |
| 80 | | |
| 81 | | /*************************************************************************** |
| 82 | | TYPE DEFINITIONS |
| 83 | | ***************************************************************************/ |
| 84 | | |
| 85 | | typedef enum _cdp1864_format cdp1864_format; |
| 86 | | enum _cdp1864_format { |
| 87 | | CDP1864_NON_INTERLACED = 0, |
| 88 | | CDP1864_INTERLACED |
| 89 | | }; |
| 90 | | |
| 91 | | typedef struct _cdp1864_interface cdp1864_interface; |
| 92 | | struct _cdp1864_interface |
| 93 | | { |
| 94 | | const char *cpu_tag; /* cpu we are working with */ |
| 95 | | const char *screen_tag; /* screen we are acting on */ |
| 96 | | |
| 97 | | cdp1864_format interlace; /* interlace */ |
| 98 | | |
| 99 | | /* this gets called for every change of the INT pin (pin 36) */ |
| 100 | | devcb_write_line out_int_func; |
| 101 | | |
| 102 | | /* this gets called for every change of the DMAO pin (pin 37) */ |
| 103 | | devcb_write_line out_dmao_func; |
| 104 | | |
| 105 | | /* this gets called for every change of the EFX pin (pin 18) */ |
| 106 | | devcb_write_line out_efx_func; |
| 107 | | |
| 108 | | double res_r; /* red output resistor value */ |
| 109 | | double res_g; /* green output resistor value */ |
| 110 | | double res_b; /* blue output resistor value */ |
| 111 | | double res_bkg; /* background output resistor value */ |
| 112 | | }; |
| 113 | | |
| 114 | | /*************************************************************************** |
| 115 | | PROTOTYPES |
| 116 | | ***************************************************************************/ |
| 117 | | |
| 118 | | /* device interface */ |
| 119 | | DEVICE_GET_INFO( cdp1864 ); |
| 120 | | |
| 121 | | /* display on (0x69) */ |
| 122 | | READ8_DEVICE_HANDLER( cdp1864_dispon_r ); |
| 123 | | |
| 124 | | /* display off (0x6c) */ |
| 125 | | READ8_DEVICE_HANDLER( cdp1864_dispoff_r ); |
| 126 | | |
| 127 | | /* step background color (0x61) */ |
| 128 | | WRITE8_DEVICE_HANDLER( cdp1864_step_bgcolor_w ); |
| 129 | | |
| 130 | | /* load tone latch (0x64) */ |
| 131 | | WRITE8_DEVICE_HANDLER( cdp1864_tone_latch_w ); |
| 132 | | |
| 133 | | /* audio output enable */ |
| 134 | | void cdp1864_aoe_w(const device_config *device, int level); |
| 135 | | |
| 136 | | /* DMA write */ |
| 137 | | void cdp1864_dma_w(const device_config *device, UINT8 data, int color_on, int rdata, int gdata, int bdata); |
| 138 | | |
| 139 | | /* screen update */ |
| 140 | | void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); |
| 141 | | |
| 142 | | #endif |
src/mess/drivers/studio2.c
| r5705 | r5706 | |
| 198 | 198 | #include "includes/studio2.h" |
| 199 | 199 | #include "cpu/cdp1802/cdp1802.h" |
| 200 | 200 | #include "video/cdp1861.h" |
| 201 | | #include "video/cdp1864.h" |
| 201 | #include "sound/cdp1864.h" |
| 202 | 202 | #include "devices/cartslot.h" |
| 203 | 203 | #include "sound/beep.h" |
| 204 | 204 | #include "sound/discrete.h" |
| r5705 | r5706 | |
| 331 | 331 | CDP1802_TAG, |
| 332 | 332 | SCREEN_TAG, |
| 333 | 333 | CDP1864_INTERLACED, |
| 334 | DEVCB_LINE_VCC, // ? |
| 335 | DEVCB_LINE_VCC, // ? |
| 336 | DEVCB_LINE_VCC, // ? |
| 334 | 337 | DEVCB_CPU_INPUT_LINE(CDP1802_TAG, CDP1802_INPUT_LINE_INT), |
| 335 | 338 | DEVCB_CPU_INPUT_LINE(CDP1802_TAG, CDP1802_INPUT_LINE_DMAOUT), |
| 336 | 339 | DEVCB_LINE(mpt02_efx_w), |
| r5705 | r5706 | |
| 378 | 381 | beep_set_state(speaker, state); |
| 379 | 382 | } |
| 380 | 383 | |
| 381 | | static WRITE8_DEVICE_HANDLER( studio2_dma_w ) |
| 382 | | { |
| 383 | | studio2_state *state = device->machine->driver_data; |
| 384 | | |
| 385 | | cdp1861_dma_w(state->cdp1861, data); |
| 386 | | } |
| 387 | | |
| 388 | 384 | static CDP1802_INTERFACE( studio2_config ) |
| 389 | 385 | { |
| 390 | 386 | studio2_mode_r, |
| r5705 | r5706 | |
| 392 | 388 | NULL, |
| 393 | 389 | DEVCB_LINE(studio2_q_w), |
| 394 | 390 | DEVCB_NULL, |
| 395 | | DEVCB_HANDLER(studio2_dma_w) |
| 391 | DEVCB_DEVICE_HANDLER(CDP1861_TAG, cdp1861_dma_w) |
| 396 | 392 | }; |
| 397 | 393 | |
| 398 | 394 | static CDP1802_EF_READ( mpt02_ef_r ) |
| r5705 | r5706 | |
| 413 | 409 | { |
| 414 | 410 | studio2_state *state = device->machine->driver_data; |
| 415 | 411 | |
| 416 | | UINT8 color = state->color_ram[offset / 4]; // 0x04 = R, 0x02 = B, 0x01 = G |
| 412 | state->color = state->color_ram[offset / 4]; |
| 417 | 413 | |
| 418 | | int rdata = BIT(color, 2); |
| 419 | | int gdata = BIT(color, 0); |
| 420 | | int bdata = BIT(color, 1); |
| 421 | | |
| 422 | | cdp1864_dma_w(state->cdp1864, data, ASSERT_LINE, rdata, gdata, bdata); |
| 414 | cdp1864_con_w(state->cdp1864, 0); // HACK |
| 415 | cdp1864_dma_w(state->cdp1864, offset, data); |
| 423 | 416 | } |
| 424 | 417 | |
| 425 | 418 | static CDP1802_INTERFACE( mpt02_config ) |
| r5705 | r5706 | |
| 543 | 536 | MDRV_DRIVER_DATA(studio2_state) |
| 544 | 537 | |
| 545 | 538 | // basic machine hardware |
| 546 | | |
| 547 | 539 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, 3579545/2) // the real clock is derived from an oscillator circuit |
| 548 | 540 | MDRV_CPU_PROGRAM_MAP(studio2_map) |
| 549 | 541 | MDRV_CPU_IO_MAP(studio2_io_map) |
| r5705 | r5706 | |
| 553 | 545 | MDRV_MACHINE_RESET(studio2) |
| 554 | 546 | |
| 555 | 547 | // video hardware |
| 556 | | |
| 557 | 548 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 558 | 549 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 559 | 550 | MDRV_SCREEN_RAW_PARAMS(3579545/2, CDP1861_SCREEN_WIDTH, CDP1861_HBLANK_END, CDP1861_HBLANK_START, CDP1861_TOTAL_SCANLINES, CDP1861_SCANLINE_VBLANK_END, CDP1861_SCANLINE_VBLANK_START) |
| r5705 | r5706 | |
| 562 | 553 | MDRV_PALETTE_INIT(black_and_white) |
| 563 | 554 | MDRV_VIDEO_UPDATE(studio2) |
| 564 | 555 | |
| 565 | | MDRV_CDP1861_ADD(CDP1861_TAG, XTAL_3_52128MHz, studio2_cdp1861_intf) |
| 556 | MDRV_CDP1861_ADD(CDP1861_TAG, 3579545/2, studio2_cdp1861_intf) |
| 566 | 557 | |
| 567 | 558 | // sound hardware |
| 568 | | |
| 569 | 559 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 570 | 560 | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 571 | 561 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| r5705 | r5706 | |
| 577 | 567 | MDRV_DRIVER_DATA(studio2_state) |
| 578 | 568 | |
| 579 | 569 | // basic machine hardware |
| 580 | | |
| 581 | 570 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_3_579545MHz/2) |
| 582 | 571 | MDRV_CPU_PROGRAM_MAP(visicom_map) |
| 583 | 572 | MDRV_CPU_IO_MAP(visicom_io_map) |
| r5705 | r5706 | |
| 587 | 576 | MDRV_MACHINE_RESET(studio2) |
| 588 | 577 | |
| 589 | 578 | // video hardware |
| 590 | | |
| 591 | 579 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 592 | 580 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 593 | 581 | MDRV_SCREEN_RAW_PARAMS(XTAL_3_579545MHz/2, CDP1861_SCREEN_WIDTH, CDP1861_HBLANK_END, CDP1861_HBLANK_START, CDP1861_TOTAL_SCANLINES, CDP1861_SCANLINE_VBLANK_END, CDP1861_SCANLINE_VBLANK_START) |
| r5705 | r5706 | |
| 599 | 587 | MDRV_CDP1861_ADD(CDP1861_TAG, XTAL_3_579545MHz/2/8, studio2_cdp1861_intf) |
| 600 | 588 | |
| 601 | 589 | // sound hardware |
| 602 | | |
| 603 | 590 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 604 | 591 | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 605 | 592 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| r5705 | r5706 | |
| 611 | 598 | MDRV_DRIVER_DATA(studio2_state) |
| 612 | 599 | |
| 613 | 600 | // basic machine hardware |
| 614 | | |
| 615 | 601 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, CDP1864_CLOCK) |
| 616 | 602 | MDRV_CPU_PROGRAM_MAP(mpt02_map) |
| 617 | 603 | MDRV_CPU_IO_MAP(mpt02_io_map) |
| r5705 | r5706 | |
| 621 | 607 | MDRV_MACHINE_RESET(mpt02) |
| 622 | 608 | |
| 623 | 609 | // video hardware |
| 624 | | |
| 625 | 610 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 626 | 611 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 627 | 612 | MDRV_SCREEN_RAW_PARAMS(CDP1864_CLOCK, CDP1864_SCREEN_WIDTH, CDP1864_HBLANK_END, CDP1864_HBLANK_START, CDP1864_TOTAL_SCANLINES, CDP1864_SCANLINE_VBLANK_END, CDP1864_SCANLINE_VBLANK_START) |
| r5705 | r5706 | |
| 629 | 614 | MDRV_PALETTE_LENGTH(8+8) |
| 630 | 615 | MDRV_VIDEO_UPDATE(mpt02) |
| 631 | 616 | |
| 632 | | MDRV_CDP1864_ADD(CDP1864_TAG, CDP1864_CLOCK, mpt02_cdp1864_intf) |
| 633 | | |
| 634 | 617 | // sound hardware |
| 635 | | |
| 636 | 618 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 637 | | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 638 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 619 | MDRV_CDP1864_ADD(CDP1864_TAG, CDP1864_CLOCK, mpt02_cdp1864_intf) |
| 620 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 639 | 621 | |
| 640 | 622 | MDRV_IMPORT_FROM( studio2_cartslot ) |
| 641 | 623 | MACHINE_DRIVER_END |
src/mess/drivers/tmc1800.c
| r5705 | r5706 | |
| 115 | 115 | #include "includes/tmc1800.h" |
| 116 | 116 | #include "cpu/cdp1802/cdp1802.h" |
| 117 | 117 | #include "video/cdp1861.h" |
| 118 | | #include "video/cdp1864.h" |
| 118 | #include "sound/cdp1864.h" |
| 119 | 119 | #include "devices/cassette.h" |
| 120 | 120 | #include "devices/snapquik.h" |
| 121 | 121 | #include "machine/rescap.h" |
| r5705 | r5706 | |
| 493 | 493 | cassette_output(driver_state->cassette, state ? 1.0 : -1.0); |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | | static WRITE8_DEVICE_HANDLER( tmc1800_dma_w ) |
| 497 | | { |
| 498 | | tmc1800_state *state = device->machine->driver_data; |
| 499 | | |
| 500 | | cdp1861_dma_w(state->cdp1861, data); |
| 501 | | } |
| 502 | | |
| 503 | 496 | static CDP1802_INTERFACE( tmc1800_config ) |
| 504 | 497 | { |
| 505 | 498 | tmc1800_mode_r, |
| r5705 | r5706 | |
| 507 | 500 | NULL, |
| 508 | 501 | DEVCB_LINE(tmc1800_q_w), |
| 509 | 502 | DEVCB_NULL, |
| 510 | | DEVCB_HANDLER(tmc1800_dma_w) |
| 503 | DEVCB_DEVICE_HANDLER(CDP1861_TAG, cdp1861_dma_w) |
| 511 | 504 | }; |
| 512 | 505 | |
| 513 | 506 | static CDP1802_INTERFACE( osc1000b_config ) |
| r5705 | r5706 | |
| 590 | 583 | { |
| 591 | 584 | tmc2000_state *state = device->machine->driver_data; |
| 592 | 585 | |
| 593 | | UINT8 color = ~(state->colorram[offset & 0x1ff]) & 0x07; |
| 594 | | |
| 595 | | int rdata = BIT(color, 2); |
| 596 | | int gdata = BIT(color, 0); |
| 597 | | int bdata = BIT(color, 1); |
| 586 | state->color = ~(state->colorram[offset & 0x1ff]) & 0x07; |
| 598 | 587 | |
| 599 | | cdp1864_dma_w(state->cdp1864, data, ASSERT_LINE, rdata, gdata, bdata); |
| 588 | cdp1864_con_w(state->cdp1864, 0); // HACK |
| 589 | cdp1864_dma_w(state->cdp1864, offset, data); |
| 600 | 590 | } |
| 601 | 591 | |
| 602 | 592 | static CDP1802_INTERFACE( tmc2000_config ) |
| r5705 | r5706 | |
| 702 | 692 | cassette_output(driver_state->cassette, state ? 1.0 : -1.0); |
| 703 | 693 | } |
| 704 | 694 | |
| 705 | | static WRITE8_DEVICE_HANDLER( oscnano_dma_w ) |
| 706 | | { |
| 707 | | oscnano_state *state = device->machine->driver_data; |
| 708 | | |
| 709 | | cdp1864_dma_w(state->cdp1864, data, CLEAR_LINE, 1, 1, 1); |
| 710 | | } |
| 711 | | |
| 712 | 695 | static CDP1802_INTERFACE( oscnano_config ) |
| 713 | 696 | { |
| 714 | 697 | oscnano_mode_r, |
| r5705 | r5706 | |
| 716 | 699 | NULL, |
| 717 | 700 | DEVCB_LINE(oscnano_q_w), |
| 718 | 701 | DEVCB_NULL, |
| 719 | | DEVCB_HANDLER(oscnano_dma_w) |
| 702 | DEVCB_DEVICE_HANDLER(CDP1864_TAG, cdp1864_dma_w) |
| 720 | 703 | }; |
| 721 | 704 | |
| 722 | 705 | /* Machine Initialization */ |
| r5705 | r5706 | |
| 741 | 724 | { |
| 742 | 725 | tmc1800_state *state = machine->driver_data; |
| 743 | 726 | |
| 744 | | /* reset CDP1864 */ |
| 727 | /* reset CDP1861 */ |
| 745 | 728 | device_reset(state->cdp1861); |
| 746 | 729 | } |
| 747 | 730 | |
| r5705 | r5706 | |
| 864 | 847 | MDRV_DRIVER_DATA(tmc1800_state) |
| 865 | 848 | |
| 866 | 849 | // basic system hardware |
| 867 | | |
| 868 | 850 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_1_75MHz) |
| 869 | 851 | MDRV_CPU_PROGRAM_MAP(tmc1800_map) |
| 870 | 852 | MDRV_CPU_IO_MAP(tmc1800_io_map) |
| r5705 | r5706 | |
| 874 | 856 | MDRV_MACHINE_RESET(tmc1800) |
| 875 | 857 | |
| 876 | 858 | // video hardware |
| 877 | | |
| 878 | 859 | MDRV_IMPORT_FROM(tmc1800_video) |
| 879 | 860 | |
| 880 | 861 | // sound hardware |
| 881 | | |
| 882 | 862 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 883 | 863 | |
| 884 | 864 | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 885 | 865 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 886 | 866 | |
| 887 | | // quickload |
| 888 | | |
| 867 | // devices |
| 889 | 868 | MDRV_QUICKLOAD_ADD("quickload", tmc1800, "bin", 0) |
| 890 | | |
| 891 | 869 | MDRV_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 892 | 870 | MACHINE_DRIVER_END |
| 893 | 871 | |
| r5705 | r5706 | |
| 895 | 873 | MDRV_DRIVER_DATA(osc1000b_state) |
| 896 | 874 | |
| 897 | 875 | // basic system hardware |
| 898 | | |
| 899 | 876 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_1_75MHz) |
| 900 | 877 | MDRV_CPU_PROGRAM_MAP(osc1000b_map) |
| 901 | 878 | MDRV_CPU_IO_MAP(osc1000b_io_map) |
| r5705 | r5706 | |
| 905 | 882 | MDRV_MACHINE_RESET(osc1000b) |
| 906 | 883 | |
| 907 | 884 | // video hardware |
| 908 | | |
| 909 | 885 | MDRV_IMPORT_FROM(osc1000b_video) |
| 910 | 886 | |
| 911 | 887 | // sound hardware |
| 912 | | |
| 913 | 888 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 914 | 889 | |
| 915 | 890 | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 916 | 891 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 917 | 892 | |
| 918 | | // quickload |
| 919 | | |
| 893 | // devices |
| 920 | 894 | MDRV_QUICKLOAD_ADD("quickload", tmc1800, "bin", 0) |
| 921 | | |
| 922 | 895 | MDRV_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 923 | 896 | MACHINE_DRIVER_END |
| 924 | 897 | |
| r5705 | r5706 | |
| 926 | 899 | MDRV_DRIVER_DATA(tmc2000_state) |
| 927 | 900 | |
| 928 | 901 | // basic system hardware |
| 929 | | |
| 930 | 902 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_1_75MHz) |
| 931 | 903 | MDRV_CPU_PROGRAM_MAP(tmc2000_map) |
| 932 | 904 | MDRV_CPU_IO_MAP(tmc2000_io_map) |
| r5705 | r5706 | |
| 936 | 908 | MDRV_MACHINE_RESET(tmc2000) |
| 937 | 909 | |
| 938 | 910 | // video hardware |
| 939 | | |
| 940 | 911 | MDRV_IMPORT_FROM(tmc2000_video) |
| 941 | 912 | |
| 942 | | // sound hardware |
| 943 | | |
| 944 | | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 945 | | |
| 946 | | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 947 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 948 | | |
| 949 | | // quickload |
| 950 | | |
| 913 | // devices |
| 951 | 914 | MDRV_QUICKLOAD_ADD("quickload", tmc1800, "bin", 0) |
| 952 | | |
| 953 | 915 | MDRV_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 954 | 916 | MACHINE_DRIVER_END |
| 955 | 917 | |
| r5705 | r5706 | |
| 957 | 919 | MDRV_DRIVER_DATA(oscnano_state) |
| 958 | 920 | |
| 959 | 921 | // basic system hardware |
| 960 | | |
| 961 | 922 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_1_75MHz) |
| 962 | 923 | MDRV_CPU_PROGRAM_MAP(oscnano_map) |
| 963 | 924 | MDRV_CPU_IO_MAP(oscnano_io_map) |
| r5705 | r5706 | |
| 967 | 928 | MDRV_MACHINE_RESET(oscnano) |
| 968 | 929 | |
| 969 | 930 | // video hardware |
| 970 | | |
| 971 | 931 | MDRV_IMPORT_FROM(oscnano_video) |
| 972 | 932 | |
| 973 | | // sound hardware |
| 974 | | |
| 975 | | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 976 | | |
| 977 | | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 978 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 979 | | |
| 980 | | // quickload |
| 981 | | |
| 933 | // devices |
| 982 | 934 | MDRV_QUICKLOAD_ADD("quickload", tmc1800, "bin", 0) |
| 983 | | |
| 984 | 935 | MDRV_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 985 | 936 | MACHINE_DRIVER_END |
| 986 | 937 | |
| r5705 | r5706 | |
| 1071 | 1022 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 1072 | 1023 | COMP( 1977, tmc1800, 0, 0, tmc1800, tmc1800, tmc1800, tmc1800, "Telercas Oy", "Telmac 1800", GAME_NOT_WORKING ) |
| 1073 | 1024 | COMP( 1977, osc1000b, tmc1800,0, osc1000b, tmc1800, tmc1800, osc1000b, "OSCOM Oy", "OSCOM 1000B", GAME_NOT_WORKING ) |
| 1074 | | COMP( 1980, tmc2000, 0, 0, tmc2000, tmc2000, tmc1800, tmc2000, "Telercas Oy", "Telmac 2000", GAME_SUPPORTS_SAVE ) |
| 1075 | | COMP( 1980, oscnano, tmc2000,0, oscnano, oscnano, tmc1800, oscnano, "OSCOM Oy", "OSCOM Nano", GAME_SUPPORTS_SAVE ) |
| 1025 | COMP( 1980, tmc2000, 0, 0, tmc2000, tmc2000, 0, tmc2000, "Telercas Oy", "Telmac 2000", GAME_SUPPORTS_SAVE ) |
| 1026 | COMP( 1980, oscnano, tmc2000,0, oscnano, oscnano, 0, oscnano, "OSCOM Oy", "OSCOM Nano", GAME_SUPPORTS_SAVE ) |
src/mess/drivers/tmc2000e.c
| r5705 | r5706 | |
| 36 | 36 | #include "devices/flopdrv.h" |
| 37 | 37 | #include "formats/basicdsk.h" |
| 38 | 38 | #include "devices/cassette.h" |
| 39 | | #include "video/cdp1864.h" |
| 40 | | #include "sound/beep.h" |
| 39 | #include "sound/cdp1864.h" |
| 41 | 40 | #include "machine/rescap.h" |
| 42 | 41 | |
| 43 | 42 | /* Read/Write Handlers */ |
| r5705 | r5706 | |
| 126 | 125 | |
| 127 | 126 | /* Video */ |
| 128 | 127 | |
| 128 | static READ_LINE_DEVICE_HANDLER( rdata_r ) |
| 129 | { |
| 130 | tmc2000e_state *state = device->machine->driver_data; |
| 131 | |
| 132 | return BIT(state->color, 2); |
| 133 | } |
| 134 | |
| 135 | static READ_LINE_DEVICE_HANDLER( bdata_r ) |
| 136 | { |
| 137 | tmc2000e_state *state = device->machine->driver_data; |
| 138 | |
| 139 | return BIT(state->color, 1); |
| 140 | } |
| 141 | |
| 142 | static READ_LINE_DEVICE_HANDLER( gdata_r ) |
| 143 | { |
| 144 | tmc2000e_state *state = device->machine->driver_data; |
| 145 | |
| 146 | return BIT(state->color, 0); |
| 147 | } |
| 148 | |
| 129 | 149 | static WRITE_LINE_DEVICE_HANDLER( tmc2000e_efx_w ) |
| 130 | 150 | { |
| 131 | 151 | tmc2000e_state *driver_state = device->machine->driver_data; |
| r5705 | r5706 | |
| 138 | 158 | CDP1802_TAG, |
| 139 | 159 | SCREEN_TAG, |
| 140 | 160 | CDP1864_INTERLACED, |
| 161 | DEVCB_LINE(rdata_r), |
| 162 | DEVCB_LINE(bdata_r), |
| 163 | DEVCB_LINE(gdata_r), |
| 141 | 164 | DEVCB_CPU_INPUT_LINE(CDP1802_TAG, CDP1802_INPUT_LINE_INT), |
| 142 | 165 | DEVCB_CPU_INPUT_LINE(CDP1802_TAG, CDP1802_INPUT_LINE_DMAOUT), |
| 143 | 166 | DEVCB_LINE(tmc2000e_efx_w), |
| r5705 | r5706 | |
| 222 | 245 | { |
| 223 | 246 | tmc2000e_state *state = device->machine->driver_data; |
| 224 | 247 | |
| 225 | | UINT8 color = (state->colorram[offset & 0x3ff]) & 0x07; // 0x04 = R, 0x02 = B, 0x01 = G |
| 226 | | |
| 227 | | int rdata = BIT(color, 2); |
| 228 | | int gdata = BIT(color, 0); |
| 229 | | int bdata = BIT(color, 1); |
| 248 | state->color = (state->colorram[offset & 0x3ff]) & 0x07; // 0x04 = R, 0x02 = B, 0x01 = G |
| 230 | 249 | |
| 231 | | cdp1864_dma_w(state->cdp1864, data, ASSERT_LINE, rdata, gdata, bdata); |
| 250 | cdp1864_con_w(state->cdp1864, 0); // HACK |
| 251 | cdp1864_dma_w(state->cdp1864, offset, data); |
| 232 | 252 | } |
| 233 | 253 | |
| 234 | 254 | static CDP1802_INTERFACE( tmc2000e_config ) |
| r5705 | r5706 | |
| 284 | 304 | MDRV_DRIVER_DATA(tmc2000e_state) |
| 285 | 305 | |
| 286 | 306 | // basic system hardware |
| 287 | | |
| 288 | 307 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_1_75MHz) |
| 289 | 308 | MDRV_CPU_PROGRAM_MAP(tmc2000e_map) |
| 290 | 309 | MDRV_CPU_IO_MAP(tmc2000e_io_map) |
| r5705 | r5706 | |
| 294 | 313 | MDRV_MACHINE_RESET(tmc2000e) |
| 295 | 314 | |
| 296 | 315 | // video hardware |
| 297 | | |
| 298 | 316 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 299 | 317 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 300 | 318 | MDRV_SCREEN_RAW_PARAMS(XTAL_1_75MHz, CDP1864_SCREEN_WIDTH, CDP1864_HBLANK_END, CDP1864_HBLANK_START, CDP1864_TOTAL_SCANLINES, CDP1864_SCANLINE_VBLANK_END, CDP1864_SCANLINE_VBLANK_START) |
| r5705 | r5706 | |
| 302 | 320 | MDRV_PALETTE_LENGTH(8) |
| 303 | 321 | MDRV_VIDEO_UPDATE(tmc2000e) |
| 304 | 322 | |
| 305 | | MDRV_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, tmc2000e_cdp1864_intf) |
| 306 | | |
| 307 | 323 | // sound hardware |
| 308 | | |
| 309 | 324 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 310 | | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 325 | MDRV_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, tmc2000e_cdp1864_intf) |
| 311 | 326 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 312 | 327 | |
| 313 | | /* printer */ |
| 328 | /* devices */ |
| 314 | 329 | MDRV_PRINTER_ADD("printer") |
| 315 | | |
| 316 | 330 | MDRV_CASSETTE_ADD("cassette", tmc2000_cassette_config) |
| 317 | 331 | MACHINE_DRIVER_END |
| 318 | 332 | |
| r5705 | r5706 | |
| 352 | 366 | CONFIG_DEVICE(tmc2000e_floppy_getinfo) |
| 353 | 367 | SYSTEM_CONFIG_END |
| 354 | 368 | |
| 355 | | /* Driver Initialization */ |
| 356 | | |
| 357 | | static TIMER_CALLBACK(setup_beep) |
| 358 | | { |
| 359 | | const device_config *speaker = devtag_get_device(machine, "beep"); |
| 360 | | beep_set_state(speaker, 0); |
| 361 | | beep_set_frequency( speaker, 0 ); |
| 362 | | } |
| 363 | | |
| 364 | | static DRIVER_INIT( tmc2000e ) |
| 365 | | { |
| 366 | | // enable power led |
| 367 | | set_led_status(2, 1); |
| 368 | | |
| 369 | | timer_set(machine, attotime_zero, NULL, 0, setup_beep); |
| 370 | | } |
| 371 | | |
| 372 | | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME |
| 373 | | COMP( 1980, tmc2000e, 0, 0, tmc2000e, tmc2000e, tmc2000e, tmc2000e, "Telercas Oy", "Telmac 2000E", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 369 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME |
| 370 | COMP( 1980, tmc2000e, 0, 0, tmc2000e, tmc2000e, 0, tmc2000e, "Telercas Oy", "Telmac 2000E", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |