src/mess/video/cdp1864.c
| r4227 | r4228 | |
| 21 | 21 | #include "sound/beep.h" |
| 22 | 22 | #include "video/cdp1864.h" |
| 23 | 23 | |
| 24 | /*************************************************************************** |
| 25 | PARAMETERS |
| 26 | ***************************************************************************/ |
| 27 | |
| 24 | 28 | #define CDP1864_DEFAULT_LATCH 0x35 |
| 25 | 29 | |
| 26 | 30 | #define CDP1864_CYCLES_DMA_START 2*8 |
| 27 | 31 | #define CDP1864_CYCLES_DMA_ACTIVE 8*8 |
| 28 | 32 | #define CDP1864_CYCLES_DMA_WAIT 6*8 |
| 29 | 33 | |
| 34 | static const int CDP1864_BACKGROUND_COLOR_SEQUENCE[] = { 2, 0, 1, 4 }; |
| 35 | |
| 36 | /*************************************************************************** |
| 37 | TYPE DEFINITIONS |
| 38 | ***************************************************************************/ |
| 39 | |
| 30 | 40 | typedef struct _cdp1864_t cdp1864_t; |
| 31 | 41 | struct _cdp1864_t |
| 32 | 42 | { |
| 33 | | const cdp1864_interface *intf; /* interface */ |
| 43 | devcb_resolved_write_line out_int_func; |
| 44 | devcb_resolved_write_line out_dmao_func; |
| 45 | devcb_resolved_write_line out_efx_func; |
| 34 | 46 | |
| 35 | 47 | const device_config *screen; /* screen */ |
| 36 | 48 | bitmap_t *bitmap; /* bitmap */ |
| r4227 | r4228 | |
| 51 | 63 | emu_timer *int_timer; /* interrupt timer */ |
| 52 | 64 | emu_timer *efx_timer; /* EFx timer */ |
| 53 | 65 | emu_timer *dma_timer; /* DMA timer */ |
| 66 | |
| 67 | const device_config *cpu; |
| 54 | 68 | }; |
| 55 | 69 | |
| 56 | | static const int CDP1864_BACKGROUND_COLOR_SEQUENCE[] = { 2, 0, 1, 4 }; |
| 70 | /*************************************************************************** |
| 71 | INLINE FUNCTIONS |
| 72 | ***************************************************************************/ |
| 57 | 73 | |
| 58 | 74 | INLINE cdp1864_t *get_safe_token(const device_config *device) |
| 59 | 75 | { |
| r4227 | r4228 | |
| 63 | 79 | return (cdp1864_t *)device->token; |
| 64 | 80 | } |
| 65 | 81 | |
| 66 | | /* Timer Callbacks */ |
| 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 | } |
| 67 | 88 | |
| 68 | | static TIMER_CALLBACK(cdp1864_int_tick) |
| 89 | /*************************************************************************** |
| 90 | IMPLEMENTATION |
| 91 | ***************************************************************************/ |
| 92 | |
| 93 | /*------------------------------------------------- |
| 94 | TIMER_CALLBACK( cdp1864_int_tick ) |
| 95 | -------------------------------------------------*/ |
| 96 | |
| 97 | static TIMER_CALLBACK( cdp1864_int_tick ) |
| 69 | 98 | { |
| 70 | 99 | const device_config *device = ptr; |
| 71 | 100 | cdp1864_t *cdp1864 = get_safe_token(device); |
| r4227 | r4228 | |
| 76 | 105 | { |
| 77 | 106 | if (cdp1864->disp) |
| 78 | 107 | { |
| 79 | | cdp1864->intf->on_int_changed(device, HOLD_LINE); |
| 108 | devcb_call_write_line(&cdp1864->out_int_func, ASSERT_LINE); |
| 80 | 109 | } |
| 81 | 110 | |
| 82 | 111 | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_END, 0), 0); |
| r4227 | r4228 | |
| 85 | 114 | { |
| 86 | 115 | if (cdp1864->disp) |
| 87 | 116 | { |
| 88 | | cdp1864->intf->on_int_changed(device, CLEAR_LINE); |
| 117 | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE); |
| 89 | 118 | } |
| 90 | 119 | |
| 91 | 120 | timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_START, 0), 0); |
| 92 | 121 | } |
| 93 | 122 | } |
| 94 | 123 | |
| 95 | | static TIMER_CALLBACK(cdp1864_efx_tick) |
| 124 | /*------------------------------------------------- |
| 125 | TIMER_CALLBACK( cdp1864_efx_tick ) |
| 126 | -------------------------------------------------*/ |
| 127 | |
| 128 | static TIMER_CALLBACK( cdp1864_efx_tick ) |
| 96 | 129 | { |
| 97 | 130 | const device_config *device = ptr; |
| 98 | 131 | cdp1864_t *cdp1864 = get_safe_token(device); |
| r4227 | r4228 | |
| 102 | 135 | switch (scanline) |
| 103 | 136 | { |
| 104 | 137 | case CDP1864_SCANLINE_EFX_TOP_START: |
| 105 | | cdp1864->intf->on_efx_changed(device, ASSERT_LINE); |
| 138 | devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE); |
| 106 | 139 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_END, 0), 0); |
| 107 | 140 | break; |
| 108 | 141 | |
| 109 | 142 | case CDP1864_SCANLINE_EFX_TOP_END: |
| 110 | | cdp1864->intf->on_efx_changed(device, CLEAR_LINE); |
| 143 | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE); |
| 111 | 144 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_BOTTOM_START, 0), 0); |
| 112 | 145 | break; |
| 113 | 146 | |
| 114 | 147 | case CDP1864_SCANLINE_EFX_BOTTOM_START: |
| 115 | | cdp1864->intf->on_efx_changed(device, ASSERT_LINE); |
| 148 | devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE); |
| 116 | 149 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_BOTTOM_END, 0), 0); |
| 117 | 150 | break; |
| 118 | 151 | |
| 119 | 152 | case CDP1864_SCANLINE_EFX_BOTTOM_END: |
| 120 | | cdp1864->intf->on_efx_changed(device, CLEAR_LINE); |
| 153 | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE); |
| 121 | 154 | timer_adjust_oneshot(cdp1864->efx_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_EFX_TOP_START, 0), 0); |
| 122 | 155 | break; |
| 123 | 156 | } |
| 124 | 157 | } |
| 125 | 158 | |
| 126 | | static TIMER_CALLBACK(cdp1864_dma_tick) |
| 159 | /*------------------------------------------------- |
| 160 | TIMER_CALLBACK( cdp1864_dma_tick ) |
| 161 | -------------------------------------------------*/ |
| 162 | |
| 163 | static TIMER_CALLBACK( cdp1864_dma_tick ) |
| 127 | 164 | { |
| 128 | 165 | const device_config *device = ptr; |
| 129 | 166 | cdp1864_t *cdp1864 = get_safe_token(device); |
| r4227 | r4228 | |
| 136 | 173 | { |
| 137 | 174 | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) |
| 138 | 175 | { |
| 139 | | cdp1864->intf->on_dmao_changed(device, CLEAR_LINE); |
| 176 | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE); |
| 140 | 177 | } |
| 141 | 178 | } |
| 142 | 179 | |
| r4227 | r4228 | |
| 150 | 187 | { |
| 151 | 188 | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) |
| 152 | 189 | { |
| 153 | | cdp1864->intf->on_dmao_changed(device, HOLD_LINE); |
| 190 | devcb_call_write_line(&cdp1864->out_dmao_func, ASSERT_LINE); |
| 154 | 191 | } |
| 155 | 192 | } |
| 156 | 193 | |
| r4227 | r4228 | |
| 160 | 197 | } |
| 161 | 198 | } |
| 162 | 199 | |
| 163 | | /* Palette Initialization */ |
| 200 | /*------------------------------------------------- |
| 201 | cdp1864_init_palette - initialize palette |
| 202 | -------------------------------------------------*/ |
| 164 | 203 | |
| 165 | | static void cdp1864_init_palette(const device_config *device) |
| 204 | static void cdp1864_init_palette(const device_config *device, const cdp1864_interface *intf) |
| 166 | 205 | { |
| 167 | 206 | cdp1864_t *cdp1864 = get_safe_token(device); |
| 168 | 207 | int i; |
| 169 | 208 | |
| 170 | | double res_total = cdp1864->intf->res_r + cdp1864->intf->res_g + cdp1864->intf->res_b + cdp1864->intf->res_bkg; |
| 209 | double res_total = intf->res_r + intf->res_g + intf->res_b + intf->res_bkg; |
| 171 | 210 | |
| 172 | | int weight_r = (cdp1864->intf->res_r / res_total) * 100; |
| 173 | | int weight_g = (cdp1864->intf->res_g / res_total) * 100; |
| 174 | | int weight_b = (cdp1864->intf->res_b / res_total) * 100; |
| 175 | | int weight_bkg = (cdp1864->intf->res_bkg / res_total) * 100; |
| 211 | int weight_r = (intf->res_r / res_total) * 100; |
| 212 | int weight_g = (intf->res_g / res_total) * 100; |
| 213 | int weight_b = (intf->res_b / res_total) * 100; |
| 214 | int weight_bkg = (intf->res_bkg / res_total) * 100; |
| 176 | 215 | |
| 177 | 216 | for (i = 0; i < 16; i++) |
| 178 | 217 | { |
| r4227 | r4228 | |
| 193 | 232 | } |
| 194 | 233 | } |
| 195 | 234 | |
| 196 | | /* Audio Output Enable */ |
| 235 | /*------------------------------------------------- |
| 236 | cdp1864_aoe_w - audio output enable |
| 237 | -------------------------------------------------*/ |
| 197 | 238 | |
| 198 | 239 | void cdp1864_aoe_w(const device_config *device, int level) |
| 199 | 240 | { |
| r4227 | r4228 | |
| 209 | 250 | beep_set_state(0, level); // TODO: remove this |
| 210 | 251 | } |
| 211 | 252 | |
| 212 | | /* Display On/Off */ |
| 253 | /*------------------------------------------------- |
| 254 | cdp1864_dispon_r - turn display on |
| 255 | -------------------------------------------------*/ |
| 213 | 256 | |
| 214 | 257 | READ8_DEVICE_HANDLER( cdp1864_dispon_r ) |
| 215 | 258 | { |
| r4227 | r4228 | |
| 220 | 263 | return 0xff; |
| 221 | 264 | } |
| 222 | 265 | |
| 266 | /*------------------------------------------------- |
| 267 | cdp1864_dispoff_r - turn display off |
| 268 | -------------------------------------------------*/ |
| 269 | |
| 223 | 270 | READ8_DEVICE_HANDLER( cdp1864_dispoff_r ) |
| 224 | 271 | { |
| 225 | 272 | cdp1864_t *cdp1864 = get_safe_token(device); |
| 226 | 273 | |
| 227 | 274 | cdp1864->disp = 0; |
| 228 | 275 | |
| 229 | | cdp1864->intf->on_int_changed(device, CLEAR_LINE); |
| 230 | | cdp1864->intf->on_dmao_changed(device, CLEAR_LINE); |
| 276 | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE); |
| 277 | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE); |
| 231 | 278 | |
| 232 | 279 | return 0xff; |
| 233 | 280 | } |
| 234 | 281 | |
| 235 | | /* Step Background Color */ |
| 282 | /*------------------------------------------------- |
| 283 | cdp1864_step_bgcolor_w - step background color |
| 284 | -------------------------------------------------*/ |
| 236 | 285 | |
| 237 | 286 | WRITE8_DEVICE_HANDLER( cdp1864_step_bgcolor_w ) |
| 238 | 287 | { |
| r4227 | r4228 | |
| 243 | 292 | if (++cdp1864->bgcolor > 3) cdp1864->bgcolor = 0; |
| 244 | 293 | } |
| 245 | 294 | |
| 246 | | /* Load Tone Latch */ |
| 295 | /*------------------------------------------------- |
| 296 | cdp1864_tone_latch_w - load tone latch |
| 297 | -------------------------------------------------*/ |
| 247 | 298 | |
| 248 | 299 | WRITE8_DEVICE_HANDLER( cdp1864_tone_latch_w ) |
| 249 | 300 | { |
| r4227 | r4228 | |
| 253 | 304 | beep_set_frequency(0, CDP1864_CLOCK / 8 / 4 / (data + 1) / 2); // TODO: remove this |
| 254 | 305 | } |
| 255 | 306 | |
| 256 | | /* DMA Write */ |
| 307 | /*------------------------------------------------- |
| 308 | cdp1864_dma_w - write DMA byte |
| 309 | -------------------------------------------------*/ |
| 257 | 310 | |
| 258 | 311 | void cdp1864_dma_w(const device_config *device, UINT8 data, int color_on, int rdata, int gdata, int bdata) |
| 259 | 312 | { |
| r4227 | r4228 | |
| 285 | 338 | } |
| 286 | 339 | } |
| 287 | 340 | |
| 288 | | /* Sound Update */ |
| 341 | /*------------------------------------------------- |
| 342 | cdp1864_sound_update - update sound |
| 343 | -------------------------------------------------*/ |
| 289 | 344 | |
| 290 | 345 | #ifdef UNUSED_FUNCTION |
| 291 | 346 | static void cdp1864_sound_update(const device_config *device, stream_sample_t **inputs, stream_sample_t **_buffer, int length) |
| r4227 | r4228 | |
| 333 | 388 | } |
| 334 | 389 | #endif |
| 335 | 390 | |
| 336 | | /* Screen Update */ |
| 391 | /*------------------------------------------------- |
| 392 | cdp1864_update - update screen |
| 393 | -------------------------------------------------*/ |
| 337 | 394 | |
| 338 | 395 | void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 339 | 396 | { |
| r4227 | r4228 | |
| 350 | 407 | } |
| 351 | 408 | } |
| 352 | 409 | |
| 353 | | /* Device Interface */ |
| 410 | /*------------------------------------------------- |
| 411 | DEVICE_START( cdp1864 ) |
| 412 | -------------------------------------------------*/ |
| 354 | 413 | |
| 355 | 414 | static DEVICE_START( cdp1864 ) |
| 356 | 415 | { |
| 357 | 416 | cdp1864_t *cdp1864 = get_safe_token(device); |
| 417 | const cdp1864_interface *intf = get_interface(device); |
| 358 | 418 | |
| 359 | | /* validate arguments */ |
| 360 | | assert(device != NULL); |
| 361 | | assert(device->tag != NULL); |
| 362 | | assert(device->clock > 0); |
| 419 | /* resolve callbacks */ |
| 420 | devcb_resolve_write_line(&cdp1864->out_int_func, &intf->out_int_func, device); |
| 421 | devcb_resolve_write_line(&cdp1864->out_dmao_func, &intf->out_dmao_func, device); |
| 422 | devcb_resolve_write_line(&cdp1864->out_efx_func, &intf->out_efx_func, device); |
| 363 | 423 | |
| 364 | | cdp1864->intf = device->static_config; |
| 424 | /* get the cpu */ |
| 425 | cdp1864->cpu = cputag_get_cpu(device->machine, intf->cpu_tag); |
| 365 | 426 | |
| 366 | | assert(cdp1864->intf != NULL); |
| 367 | | assert(cdp1864->intf->on_int_changed != NULL); |
| 368 | | assert(cdp1864->intf->on_dmao_changed != NULL); |
| 369 | | assert(cdp1864->intf->on_efx_changed != NULL); |
| 370 | | |
| 371 | 427 | /* get the screen device */ |
| 372 | | cdp1864->screen = devtag_get_device(device->machine, VIDEO_SCREEN, cdp1864->intf->screen_tag); |
| 428 | cdp1864->screen = devtag_get_device(device->machine, VIDEO_SCREEN, intf->screen_tag); |
| 373 | 429 | assert(cdp1864->screen != NULL); |
| 374 | 430 | |
| 375 | 431 | /* allocate the temporary bitmap */ |
| r4227 | r4228 | |
| 377 | 433 | bitmap_fill(cdp1864->bitmap, 0, CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8); |
| 378 | 434 | |
| 379 | 435 | /* initialize the palette */ |
| 380 | | cdp1864_init_palette(device); |
| 436 | cdp1864_init_palette(device, intf); |
| 381 | 437 | |
| 382 | 438 | /* create the timers */ |
| 383 | 439 | cdp1864->int_timer = timer_alloc(device->machine, cdp1864_int_tick, (void *)device); |
| r4227 | r4228 | |
| 397 | 453 | state_save_register_bitmap(device->machine, "cdp1864", device->tag, 0, "cdp1864->bitmap", cdp1864->bitmap); |
| 398 | 454 | } |
| 399 | 455 | |
| 456 | /*------------------------------------------------- |
| 457 | DEVICE_RESET( cdp1861 ) |
| 458 | -------------------------------------------------*/ |
| 459 | |
| 400 | 460 | static DEVICE_RESET( cdp1864 ) |
| 401 | 461 | { |
| 402 | 462 | cdp1864_t *cdp1864 = get_safe_token(device); |
| r4227 | r4228 | |
| 409 | 469 | cdp1864->dmaout = 0; |
| 410 | 470 | cdp1864->bgcolor = 0; |
| 411 | 471 | |
| 412 | | cdp1864->intf->on_int_changed(device, CLEAR_LINE); |
| 413 | | cdp1864->intf->on_dmao_changed(device, CLEAR_LINE); |
| 414 | | cdp1864->intf->on_efx_changed(device, CLEAR_LINE); |
| 472 | devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE); |
| 473 | devcb_call_write_line(&cdp1864->out_dmao_func, CLEAR_LINE); |
| 474 | devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE); |
| 415 | 475 | |
| 416 | 476 | cdp1864_aoe_w(device, 0); |
| 417 | 477 | } |
| 418 | 478 | |
| 479 | /*------------------------------------------------- |
| 480 | DEVICE_SET_INFO( cdp1861 ) |
| 481 | -------------------------------------------------*/ |
| 482 | |
| 419 | 483 | static DEVICE_SET_INFO( cdp1864 ) |
| 420 | 484 | { |
| 421 | 485 | switch (state) |
| r4227 | r4228 | |
| 424 | 488 | } |
| 425 | 489 | } |
| 426 | 490 | |
| 491 | /*------------------------------------------------- |
| 492 | DEVICE_GET_INFO( cdp1861 ) |
| 493 | -------------------------------------------------*/ |
| 494 | |
| 427 | 495 | DEVICE_GET_INFO( cdp1864 ) |
| 428 | 496 | { |
| 429 | 497 | switch (state) |
| 430 | 498 | { |
| 431 | 499 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 432 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(cdp1864_t); break; |
| 433 | | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 434 | | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 500 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(cdp1864_t); break; |
| 501 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 502 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 435 | 503 | |
| 436 | 504 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 437 | | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(cdp1864); break; |
| 438 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cdp1864); break; |
| 439 | | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 440 | | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1864); break; |
| 505 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(cdp1864); break; |
| 506 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cdp1864); break; |
| 507 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 508 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1864); break; |
| 441 | 509 | |
| 442 | 510 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 443 | | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1861"); break; |
| 444 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; |
| 445 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 511 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1864"); break; |
| 512 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; |
| 513 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 446 | 514 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 447 | | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
| 515 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
| 448 | 516 | } |
| 449 | 517 | } |
src/mess/video/cdp1861.c
| r4227 | r4228 | |
| 57 | 57 | IMPLEMENTATION |
| 58 | 58 | ***************************************************************************/ |
| 59 | 59 | |
| 60 | | /* Timer Callbacks */ |
| 60 | /*------------------------------------------------- |
| 61 | TIMER_CALLBACK( cdp1861_int_tick ) |
| 62 | -------------------------------------------------*/ |
| 61 | 63 | |
| 62 | 64 | static TIMER_CALLBACK( cdp1861_int_tick ) |
| 63 | 65 | { |
| r4227 | r4228 | |
| 86 | 88 | } |
| 87 | 89 | } |
| 88 | 90 | |
| 91 | /*------------------------------------------------- |
| 92 | TIMER_CALLBACK( cdp1861_efx_tick ) |
| 93 | -------------------------------------------------*/ |
| 94 | |
| 89 | 95 | static TIMER_CALLBACK( cdp1861_efx_tick ) |
| 90 | 96 | { |
| 91 | 97 | const device_config *device = ptr; |
| r4227 | r4228 | |
| 117 | 123 | } |
| 118 | 124 | } |
| 119 | 125 | |
| 126 | /*------------------------------------------------- |
| 127 | TIMER_CALLBACK( cdp1861_dma_tick ) |
| 128 | -------------------------------------------------*/ |
| 129 | |
| 120 | 130 | static TIMER_CALLBACK( cdp1861_dma_tick ) |
| 121 | 131 | { |
| 122 | 132 | const device_config *device = ptr; |
| r4227 | r4228 | |
| 154 | 164 | } |
| 155 | 165 | } |
| 156 | 166 | |
| 157 | | /* Display On/Off */ |
| 167 | /*------------------------------------------------- |
| 168 | cdp1861_dispon_r - turn display on |
| 169 | -------------------------------------------------*/ |
| 158 | 170 | |
| 159 | 171 | READ8_DEVICE_HANDLER( cdp1861_dispon_r ) |
| 160 | 172 | { |
| r4227 | r4228 | |
| 165 | 177 | return 0xff; |
| 166 | 178 | } |
| 167 | 179 | |
| 180 | /*------------------------------------------------- |
| 181 | cdp1861_dispoff_r - turn display off |
| 182 | -------------------------------------------------*/ |
| 183 | |
| 168 | 184 | WRITE8_DEVICE_HANDLER( cdp1861_dispoff_w ) |
| 169 | 185 | { |
| 170 | 186 | cdp1861_t *cdp1861 = get_safe_token(device); |
| r4227 | r4228 | |
| 175 | 191 | devcb_call_write_line(&cdp1861->out_dmao_func, CLEAR_LINE); |
| 176 | 192 | } |
| 177 | 193 | |
| 178 | | /* DMA Write */ |
| 194 | /*------------------------------------------------- |
| 195 | cdp1861_dma_w - write DMA byte |
| 196 | -------------------------------------------------*/ |
| 179 | 197 | |
| 180 | 198 | void cdp1861_dma_w(const device_config *device, UINT8 data) |
| 181 | 199 | { |
| r4227 | r4228 | |
| 193 | 211 | } |
| 194 | 212 | } |
| 195 | 213 | |
| 196 | | /* Screen Update */ |
| 214 | /*------------------------------------------------- |
| 215 | cdp1861_update - update screen |
| 216 | -------------------------------------------------*/ |
| 197 | 217 | |
| 198 | 218 | void cdp1861_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 199 | 219 | { |
| r4227 | r4228 | |
| 209 | 229 | } |
| 210 | 230 | } |
| 211 | 231 | |
| 212 | | /* Device Interface */ |
| 232 | /*------------------------------------------------- |
| 233 | DEVICE_START( cdp1861 ) |
| 234 | -------------------------------------------------*/ |
| 213 | 235 | |
| 214 | 236 | static DEVICE_START( cdp1861 ) |
| 215 | 237 | { |
| r4227 | r4228 | |
| 242 | 264 | state_save_register_device_item_bitmap(device, 0, cdp1861->bitmap); |
| 243 | 265 | } |
| 244 | 266 | |
| 267 | /*------------------------------------------------- |
| 268 | DEVICE_RESET( cdp1861 ) |
| 269 | -------------------------------------------------*/ |
| 270 | |
| 245 | 271 | static DEVICE_RESET( cdp1861 ) |
| 246 | 272 | { |
| 247 | 273 | cdp1861_t *cdp1861 = get_safe_token(device); |
| r4227 | r4228 | |
| 258 | 284 | devcb_call_write_line(&cdp1861->out_efx_func, CLEAR_LINE); |
| 259 | 285 | } |
| 260 | 286 | |
| 287 | /*------------------------------------------------- |
| 288 | DEVICE_SET_INFO( cdp1861 ) |
| 289 | -------------------------------------------------*/ |
| 290 | |
| 261 | 291 | static DEVICE_SET_INFO( cdp1861 ) |
| 262 | 292 | { |
| 263 | 293 | switch (state) |
| r4227 | r4228 | |
| 266 | 296 | } |
| 267 | 297 | } |
| 268 | 298 | |
| 299 | /*------------------------------------------------- |
| 300 | DEVICE_GET_INFO( cdp1861 ) |
| 301 | -------------------------------------------------*/ |
| 302 | |
| 269 | 303 | DEVICE_GET_INFO( cdp1861 ) |
| 270 | 304 | { |
| 271 | 305 | switch (state) |