src/mess/video/i8275.c
| r4133 | r4134 | |
| 113 | 113 | UINT8 char_blink_cnt; |
| 114 | 114 | |
| 115 | 115 | UINT8 next_in_fifo; |
| 116 | | |
| 116 | |
| 117 | 117 | UINT8 lineattr; |
| 118 | 118 | UINT8 rvv; |
| 119 | 119 | UINT8 gpa; |
| 120 | 120 | UINT8 hlgt; |
| 121 | 121 | UINT8 underline; |
| 122 | 122 | UINT8 blink; |
| 123 | | |
| 123 | |
| 124 | 124 | UINT8 last_data; |
| 125 | 125 | }; |
| 126 | 126 | |
| r4133 | r4134 | |
| 164 | 164 | i8275->status_reg &= ~I8275_STATUS_DMA_UNDERRUN; |
| 165 | 165 | i8275->status_reg &= ~I8275_STATUS_IMPROPER_COMMAND; |
| 166 | 166 | i8275->status_reg &= ~I8275_STATUS_LIGHT_PEN; |
| 167 | | i8275->status_reg &= ~I8275_STATUS_INTERRUPT_REQUEST; |
| 167 | i8275->status_reg &= ~I8275_STATUS_INTERRUPT_REQUEST; |
| 168 | 168 | } |
| 169 | 169 | else |
| 170 | 170 | { |
| r4133 | r4134 | |
| 354 | 354 | i8275->rvv = (chr >> 4) & 1; |
| 355 | 355 | i8275->underline = (chr >> 5) & 1; |
| 356 | 356 | } |
| 357 | | |
| 358 | | if (i8275->field_attribute_mode==0) { |
| 359 | | chr = (i8275->buffer_used==0) ? i8275->fifo_buffer_2[fifo_read] : i8275->fifo_buffer_1[fifo_read]; |
| 357 | |
| 358 | if (i8275->field_attribute_mode==0) { |
| 359 | chr = (i8275->buffer_used==0) ? i8275->fifo_buffer_2[fifo_read] : i8275->fifo_buffer_1[fifo_read]; |
| 360 | 360 | fifo_read = (fifo_read + 1 ) % 16; |
| 361 | | } else { |
| 361 | } else { |
| 362 | 362 | vsp = 1; |
| 363 | | } |
| 363 | } |
| 364 | 364 | } |
| 365 | 365 | if (vsp==0 && i8275->blink) { |
| 366 | 366 | vsp = (i8275->char_blink_cnt < 32) ? 1: 0; |
| 367 | | } |
| 367 | } |
| 368 | 368 | if ((i8275->current_row == i8275->cursor_row) && (xpos == i8275->cursor_col - i8275->intf->char_delay)) { |
| 369 | 369 | int vis = 1; |
| 370 | 370 | if ((i8275->cursor_format & 2)==0) { |
| r4133 | r4134 | |
| 392 | 392 | i8275->hlgt // highlight |
| 393 | 393 | ); |
| 394 | 394 | vsp = 0; |
| 395 | | } |
| 395 | } |
| 396 | 396 | i8275->ypos++; |
| 397 | 397 | } |
| 398 | 398 | i8275->current_row++; |
| r4133 | r4134 | |
| 400 | 400 | |
| 401 | 401 | void i8275_dack_set_data(const device_config *device, UINT8 data) |
| 402 | 402 | { |
| 403 | | i8275_t *i8275 = get_safe_token(device); |
| 404 | | |
| 405 | | if (i8275->next_in_fifo == 1) |
| 406 | | { |
| 403 | i8275_t *i8275 = get_safe_token(device); |
| 404 | |
| 405 | if (i8275->next_in_fifo == 1) |
| 406 | { |
| 407 | 407 | i8275->next_in_fifo = 0; |
| 408 | | |
| 409 | | if(i8275->buffer_used == 0) |
| 408 | |
| 409 | if(i8275->buffer_used == 0) |
| 410 | 410 | { |
| 411 | | i8275->fifo_buffer_1[i8275->fifo_write] = data & 0x7f; |
| 412 | | } |
| 413 | | else |
| 411 | i8275->fifo_buffer_1[i8275->fifo_write] = data & 0x7f; |
| 412 | } |
| 413 | else |
| 414 | 414 | { |
| 415 | 415 | i8275->fifo_buffer_2[i8275->fifo_write] = data & 0x7f; |
| 416 | 416 | } |
| 417 | 417 | i8275->fifo_write = (i8275->fifo_write + 1) % 16; |
| 418 | | |
| 418 | |
| 419 | 419 | if (i8275->last_data == 0xf1) { |
| 420 | 420 | i8275->row_pos = i8275->chars_per_row + 1; |
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | | else |
| 424 | | { |
| 425 | | if(i8275->buffer_used == 0) |
| 423 | else |
| 424 | { |
| 425 | if(i8275->buffer_used == 0) |
| 426 | 426 | { |
| 427 | 427 | i8275->row_buffer_1[i8275->row_pos++] = data; |
| 428 | | } |
| 429 | | else |
| 428 | } |
| 429 | else |
| 430 | 430 | { |
| 431 | 431 | i8275->row_buffer_2[i8275->row_pos++] = data; |
| 432 | 432 | } |
| 433 | | if (i8275->field_attribute_mode==0) |
| 433 | if (i8275->field_attribute_mode==0) |
| 434 | 434 | { |
| 435 | | if ((data & 0x80)==0x80) |
| 435 | if ((data & 0x80)==0x80) |
| 436 | 436 | { |
| 437 | 437 | i8275->last_data = data; |
| 438 | 438 | i8275->next_in_fifo = 1; |
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | | |
| 443 | | if ((i8275->row_pos - 1)==i8275->chars_per_row ) |
| 442 | |
| 443 | if ((i8275->row_pos - 1)==i8275->chars_per_row ) |
| 444 | 444 | { |
| 445 | 445 | i8275->buffer_used = (i8275->buffer_used==0) ? 1 : 0; |
| 446 | 446 | i8275->row_pos = 0; |
| 447 | 447 | i8275->fifo_write = 0; |
| 448 | 448 | i8275_draw_char_line(device); |
| 449 | 449 | } |
| 450 | | if (i8275->current_row == (i8275->rows_per_frame + 1)) |
| 450 | if (i8275->current_row == (i8275->rows_per_frame + 1)) |
| 451 | 451 | { |
| 452 | 452 | i8275->ypos = 0; |
| 453 | 453 | i8275->current_row = 0; |
| r4133 | r4134 | |
| 463 | 463 | i8275->lineattr = 0; |
| 464 | 464 | i8275->rvv = 0; |
| 465 | 465 | i8275->gpa = 0; |
| 466 | | i8275->hlgt = 0; |
| 466 | i8275->hlgt = 0; |
| 467 | 467 | i8275->underline = 0; |
| 468 | 468 | i8275->blink = 0; |
| 469 | 469 | i8275->row_pos = 0; |
| r4133 | r4134 | |
| 494 | 494 | |
| 495 | 495 | assert(device != NULL); |
| 496 | 496 | assert(device->tag != NULL); |
| 497 | | assert(strlen(device->tag) < 20); |
| 498 | 497 | assert(device->static_config != NULL); |
| 499 | 498 | |
| 500 | 499 | i8275->intf = device->static_config; |
| r4133 | r4134 | |
| 575 | 574 | i8275->cursor_blink_cnt = 0; |
| 576 | 575 | i8275->char_blink_cnt = 0; |
| 577 | 576 | i8275->next_in_fifo = 0; |
| 578 | | |
| 577 | |
| 579 | 578 | i8275->lineattr = 0; |
| 580 | 579 | i8275->rvv = 0; |
| 581 | 580 | i8275->gpa = 0; |
| 582 | | i8275->hlgt = 0; |
| 581 | i8275->hlgt = 0; |
| 583 | 582 | i8275->underline = 0; |
| 584 | 583 | i8275->blink = 0; |
| 585 | 584 | } |
src/mess/video/msm6255.c
| r4133 | r4134 | |
| 262 | 262 | msm6255_t *msm6255 = get_safe_token(device); |
| 263 | 263 | |
| 264 | 264 | UINT8 hn = (msm6255->hnr & MSM6255_HNR_HN_MASK) + 1; |
| 265 | | UINT8 nx = (msm6255->dvr & MSM6255_DVR_DN_MASK) + 1; |
| 265 | UINT8 nx = (msm6255->dvr & MSM6255_DVR_DN_MASK) + 1; |
| 266 | 266 | UINT16 sar = (msm6255->sur << 8) | msm6255->slr; |
| 267 | 267 | |
| 268 | 268 | int y; |
| r4133 | r4134 | |
| 292 | 292 | |
| 293 | 293 | UINT8 hn = (msm6255->hnr & MSM6255_HNR_HN_MASK) + 1; |
| 294 | 294 | UINT8 vp = (msm6255->pr & MSM6255_PR_VP_MASK) + 1; |
| 295 | | UINT8 nx = (msm6255->dvr & MSM6255_DVR_DN_MASK) + 1; |
| 295 | UINT8 nx = (msm6255->dvr & MSM6255_DVR_DN_MASK) + 1; |
| 296 | 296 | UINT16 sar = (msm6255->sur << 8) | msm6255->slr; |
| 297 | 297 | |
| 298 | 298 | int sy, y; |
| r4133 | r4134 | |
| 349 | 349 | |
| 350 | 350 | assert(device != NULL); |
| 351 | 351 | assert(device->tag != NULL); |
| 352 | | assert(strlen(device->tag) < 20); |
| 353 | 352 | assert(device->static_config != NULL); |
| 354 | 353 | |
| 355 | 354 | msm6255->intf = device->static_config; |
src/mess/machine/conkort.c
| r4133 | r4134 | |
| 48 | 48 | SAB1793 - Siemens SAB1793-02P Floppy Disc Controller |
| 49 | 49 | FDC9229 - SMC FDC9229BT Floppy Disc Interface Circuit |
| 50 | 50 | DM8131 - National Semiconductor DM8131N 6-Bit Unified Bus Comparator |
| 51 | | CON1 - |
| 51 | CON1 - |
| 52 | 52 | CON2 - AMP4284 |
| 53 | | CON3 - |
| 54 | | SW1 - |
| 55 | | SW2 - |
| 56 | | SW3 - |
| 57 | | S1 - |
| 58 | | S3 - |
| 59 | | S5 - |
| 53 | CON3 - |
| 54 | SW1 - |
| 55 | SW2 - |
| 56 | SW3 - |
| 57 | S1 - |
| 58 | S3 - |
| 59 | S5 - |
| 60 | 60 | S6 - Amount of RAM installed (A:2KB, B:8KB) |
| 61 | 61 | S7 - Number of drives connected (0:3, 1:?) *located on solder side |
| 62 | 62 | S8 - 0:8", 1:5.25" |
| r4133 | r4134 | |
| 219 | 219 | if (data == 0x2d) // TODO: bit 0 of this is configurable with S1 |
| 220 | 220 | { |
| 221 | 221 | const address_space *io = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_IO); |
| 222 | | |
| 222 | |
| 223 | 223 | memory_install_readwrite8_handler(io, ABCBUS_INP, ABCBUS_OUT, 0x18, 0, slow_bus_data_r, slow_bus_data_w); |
| 224 | 224 | memory_install_read8_handler(io, ABCBUS_STAT, ABCBUS_STAT, 0x18, 0, slow_bus_stat_r); |
| 225 | 225 | memory_install_write8_handler(io, ABCBUS_C1, ABCBUS_C1, 0x18, 0, slow_bus_c1_w); |
| r4133 | r4134 | |
| 277 | 277 | bit description |
| 278 | 278 | |
| 279 | 279 | 0 _INT to main Z80 |
| 280 | | 1 |
| 281 | | 2 |
| 282 | | 3 |
| 283 | | 4 |
| 284 | | 5 |
| 280 | 1 |
| 281 | 2 |
| 282 | 3 |
| 283 | 4 |
| 284 | 5 |
| 285 | 285 | 6 LS245 DIR |
| 286 | | 7 |
| 286 | 7 |
| 287 | 287 | |
| 288 | 288 | */ |
| 289 | 289 | |
| r4133 | r4134 | |
| 749 | 749 | MDRV_CPU_CONFIG(slow_daisy_chain) |
| 750 | 750 | |
| 751 | 751 | MDRV_Z80PIO_ADD(CONKORT_Z80PIO_TAG, conkort_pio_intf) |
| 752 | | MDRV_WD179X_ADD("wd179x", slow_wd17xx_interface ) |
| 752 | MDRV_WD179X_ADD("wd179x", slow_wd17xx_interface ) |
| 753 | 753 | MACHINE_DRIVER_END |
| 754 | 754 | |
| 755 | 755 | static MACHINE_DRIVER_START( luxor_55_21046 ) |
| r4133 | r4134 | |
| 759 | 759 | MDRV_CPU_CONFIG(fast_daisy_chain) |
| 760 | 760 | |
| 761 | 761 | MDRV_Z80DMA_ADD(CONKORT_Z80DMA_TAG, XTAL_16MHz/4, dma_intf) |
| 762 | | |
| 763 | | MDRV_WD1793_ADD("wd1793", fast_wd17xx_interface ) |
| 762 | |
| 763 | MDRV_WD1793_ADD("wd1793", fast_wd17xx_interface ) |
| 764 | 764 | MACHINE_DRIVER_END |
| 765 | 765 | |
| 766 | 766 | /* ROMs */ |
| r4133 | r4134 | |
| 818 | 818 | astring *tempstring = astring_alloc(); |
| 819 | 819 | |
| 820 | 820 | /* validate arguments */ |
| 821 | | assert(device->machine != NULL); |
| 822 | 821 | assert(device->tag != NULL); |
| 823 | | assert(strlen(device->tag) < 20); |
| 824 | 822 | |
| 825 | 823 | /* find our CPU */ |
| 826 | 824 | astring_printf(tempstring, "%s:%s", device->tag, CONKORT_Z80_TAG); |
| r4133 | r4134 | |
| 889 | 887 | astring *tempstring = astring_alloc(); |
| 890 | 888 | |
| 891 | 889 | /* validate arguments */ |
| 892 | | assert(device->machine != NULL); |
| 893 | 890 | assert(device->tag != NULL); |
| 894 | | assert(strlen(device->tag) < 20); |
| 895 | 891 | |
| 896 | 892 | /* find our CPU */ |
| 897 | 893 | astring_printf(tempstring, "%s:%s", device->tag, CONKORT_Z80_TAG); |
src/mess/machine/rp5c15.c
| r4133 | r4134 | |
| 119 | 119 | { |
| 120 | 120 | const device_config* device = ptr; |
| 121 | 121 | rp5c15_t* rtc = device->token; |
| 122 | | |
| 122 | |
| 123 | 123 | if(rtc->pulse16_state == 0) // low |
| 124 | 124 | { |
| 125 | 125 | rtc->pulse16_state = 1; // make high |
| r4133 | r4134 | |
| 148 | 148 | mame_system_time systm; |
| 149 | 149 | mame_system_tm time; |
| 150 | 150 | |
| 151 | | assert(device->machine != NULL); |
| 152 | 151 | rtc->intf = device->static_config; |
| 153 | 152 | |
| 154 | 153 | rtc->alarm_callback = rtc->intf->alarm_irq_callback; |
| r4133 | r4134 | |
| 186 | 185 | |
| 187 | 186 | rtc_timer = timer_alloc(device->machine, rtc_alarm_pulse, (void*)device); |
| 188 | 187 | timer_adjust_periodic(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32)); |
| 189 | | |
| 188 | |
| 190 | 189 | return DEVICE_START_OK; |
| 191 | 190 | } |
| 192 | 191 | |
| r4133 | r4134 | |
| 360 | 359 | void rtc_add_second(const device_config* device) // add one second to current time |
| 361 | 360 | { |
| 362 | 361 | rp5c15_t* rtc = device->token; |
| 363 | | |
| 362 | |
| 364 | 363 | if((rtc->mode & 0x08) == 0x00) // if timer is not enabled |
| 365 | 364 | return; |
| 366 | 365 | rtc->systime.sec_1++; |
| r4133 | r4134 | |
| 377 | 376 | void rtc_add_minute(const device_config* device) |
| 378 | 377 | { |
| 379 | 378 | rp5c15_t* rtc = device->token; |
| 380 | | |
| 379 | |
| 381 | 380 | rtc->systime.min_1++; |
| 382 | 381 | if(rtc->systime.min_1 < 10) |
| 383 | 382 | return; |
| r4133 | r4134 | |
| 470 | 469 | void rtc_add_month(const device_config* device) |
| 471 | 470 | { |
| 472 | 471 | rp5c15_t* rtc = device->token; |
| 473 | | |
| 472 | |
| 474 | 473 | rtc->systime.month_1++; |
| 475 | 474 | if(rtc->systime.month_1 < 10 && rtc->systime.month_10 < 1) |
| 476 | 475 | return; |
src/mess/machine/ins8154.c
| r4133 | r4134 | |
| 1 | 1 | /***************************************************************************** |
| 2 | 2 | * |
| 3 | 3 | * machine/ins8154.h |
| 4 | | * |
| 4 | * |
| 5 | 5 | * INS8154 N-Channel 128-by-8 Bit RAM Input/Output (RAM I/O) |
| 6 | | * |
| 6 | * |
| 7 | 7 | * Written by Dirk Best, January 2008 |
| 8 | 8 | * |
| 9 | 9 | * TODO: Strobed modes |
| 10 | | * |
| 10 | * |
| 11 | 11 | ****************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| r4133 | r4134 | |
| 47 | 47 | ins8154_t *ins8154 = device->token; |
| 48 | 48 | |
| 49 | 49 | /* validate arguments */ |
| 50 | | assert(device->machine != NULL); |
| 51 | 50 | assert(device->tag != NULL); |
| 52 | | assert(strlen(device->tag) < 20); |
| 53 | 51 | |
| 54 | 52 | /* assign interface */ |
| 55 | 53 | ins8154->intf = device->static_config; |
| r4133 | r4134 | |
| 69 | 67 | static DEVICE_RESET( ins8154 ) |
| 70 | 68 | { |
| 71 | 69 | ins8154_t *ins8154 = device->token; |
| 72 | | |
| 70 | |
| 73 | 71 | ins8154->in_a = 0; |
| 74 | 72 | ins8154->in_b = 0; |
| 75 | 73 | ins8154->out_a = 0; |
| r4133 | r4134 | |
| 91 | 89 | cpu_get_pc( device->machine->cpu[0] ), offset); |
| 92 | 90 | return 0xff; |
| 93 | 91 | } |
| 94 | | |
| 92 | |
| 95 | 93 | switch (offset) |
| 96 | 94 | { |
| 97 | 95 | case 0x20: |
| r4133 | r4134 | |
| 99 | 97 | val = i->intf->in_a_func(device, 0); |
| 100 | 98 | i->in_a = val; |
| 101 | 99 | break; |
| 102 | | |
| 100 | |
| 103 | 101 | case 0x21: |
| 104 | 102 | if (i->intf->in_b_func) |
| 105 | 103 | val = i->intf->in_b_func(device, 0); |
| 106 | 104 | i->in_b = val; |
| 107 | 105 | break; |
| 108 | | |
| 106 | |
| 109 | 107 | default: |
| 110 | 108 | if (offset < 0x08) |
| 111 | 109 | { |
| r4133 | r4134 | |
| 121 | 119 | } |
| 122 | 120 | break; |
| 123 | 121 | } |
| 124 | | |
| 122 | |
| 125 | 123 | return val; |
| 126 | 124 | } |
| 127 | 125 | |
| 128 | 126 | WRITE8_DEVICE_HANDLER( ins8154_porta_w ) |
| 129 | 127 | { |
| 130 | 128 | ins8154_t *i = device->token; |
| 131 | | |
| 129 | |
| 132 | 130 | i->out_a = data; |
| 133 | 131 | |
| 134 | 132 | /* Test if any pins are set as outputs */ |
| r4133 | r4134 | |
| 146 | 144 | WRITE8_DEVICE_HANDLER( ins8154_portb_w ) |
| 147 | 145 | { |
| 148 | 146 | ins8154_t *i = device->token; |
| 149 | | |
| 147 | |
| 150 | 148 | i->out_b = data; |
| 151 | | |
| 149 | |
| 152 | 150 | /* Test if any pins are set as outputs */ |
| 153 | 151 | if (i->odrb) |
| 154 | 152 | { |
| r4133 | r4134 | |
| 164 | 162 | WRITE8_DEVICE_HANDLER( ins8154_w ) |
| 165 | 163 | { |
| 166 | 164 | ins8154_t *i = device->token; |
| 167 | | |
| 165 | |
| 168 | 166 | if (offset > 0x24) |
| 169 | 167 | { |
| 170 | 168 | logerror("INS8154 (%04x): Write %02x to invalid offset %02x!\n", |
| 171 | 169 | cpu_get_pc( device->machine->cpu[0] ), data, offset); |
| 172 | 170 | return; |
| 173 | 171 | } |
| 174 | | |
| 172 | |
| 175 | 173 | switch (offset) |
| 176 | 174 | { |
| 177 | 175 | case 0x20: |
| 178 | 176 | ins8154_porta_w(device, 0, data); |
| 179 | 177 | break; |
| 180 | | |
| 178 | |
| 181 | 179 | case 0x21: |
| 182 | 180 | ins8154_portb_w(device, 0, data); |
| 183 | 181 | break; |
| 184 | | |
| 182 | |
| 185 | 183 | case 0x22: |
| 186 | 184 | LOG(("INS8154 (%04x): ODR for port A set to %02x\n", |
| 187 | 185 | cpu_get_pc( device->machine->cpu[0] ), data)); |
| 188 | 186 | i->odra = data; |
| 189 | 187 | break; |
| 190 | | |
| 188 | |
| 191 | 189 | case 0x23: |
| 192 | 190 | LOG(("INS8154 (%04x): ODR for port B set to %02x\n", |
| 193 | 191 | cpu_get_pc( device->machine->cpu[0] ), data)); |
| 194 | 192 | i->odrb = data; |
| 195 | 193 | break; |
| 196 | | |
| 194 | |
| 197 | 195 | case 0x24: |
| 198 | 196 | LOG(("INS8154 (%04x): MDR set to %02x\n", |
| 199 | 197 | cpu_get_pc( device->machine->cpu[0] ), data)); |
| 200 | 198 | i->mdr = data; |
| 201 | 199 | break; |
| 202 | | |
| 200 | |
| 203 | 201 | default: |
| 204 | 202 | if (offset & 0x10) |
| 205 | 203 | { |
| r4133 | r4134 | |
| 225 | 223 | ins8154_portb_w(device, 0, i->out_b & ~((offset >> 4) & 0x07)); |
| 226 | 224 | } |
| 227 | 225 | } |
| 228 | | |
| 226 | |
| 229 | 227 | break; |
| 230 | 228 | } |
| 231 | 229 | } |
src/mess/machine/74145.c
| r4133 | r4134 | |
| 73 | 73 | return (ttl74145_t *)device->token; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | | WRITE8_DEVICE_HANDLER( ttl74145_w ) { |
| 76 | WRITE8_DEVICE_HANDLER( ttl74145_w ) { |
| 77 | 77 | /* Decode number */ |
| 78 | 78 | ttl74145_t *ttl74145 = get_safe_token(device); |
| 79 | 79 | UINT16 new_number = bcd_2_dec(data & 0x0f); |
| 80 | | |
| 80 | |
| 81 | 81 | /* Call output callbacks if the number changed */ |
| 82 | 82 | if (new_number != ttl74145->number) |
| 83 | 83 | { |
| 84 | 84 | const ttl74145_interface *i = ttl74145->intf; |
| 85 | | |
| 85 | |
| 86 | 86 | if (i->output_line_0) i->output_line_0(device, new_number == 0); |
| 87 | 87 | if (i->output_line_1) i->output_line_1(device, new_number == 1); |
| 88 | 88 | if (i->output_line_2) i->output_line_2(device, new_number == 2); |
| r4133 | r4134 | |
| 94 | 94 | if (i->output_line_8) i->output_line_8(device, new_number == 8); |
| 95 | 95 | if (i->output_line_9) i->output_line_9(device, new_number == 9); |
| 96 | 96 | } |
| 97 | | |
| 97 | |
| 98 | 98 | /* Update state */ |
| 99 | | ttl74145->number = new_number; |
| 99 | ttl74145->number = new_number; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | | READ16_DEVICE_HANDLER( ttl74145_r ) { |
| 102 | READ16_DEVICE_HANDLER( ttl74145_r ) { |
| 103 | 103 | ttl74145_t *ttl74145 = get_safe_token(device); |
| 104 | | |
| 105 | | return ttl74145->number; |
| 104 | |
| 105 | return ttl74145->number; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /* Device Interface */ |
| r4133 | r4134 | |
| 114 | 114 | |
| 115 | 115 | assert(device != NULL); |
| 116 | 116 | assert(device->tag != NULL); |
| 117 | | assert(strlen(device->tag) < 20); |
| 118 | 117 | assert(device->static_config != NULL); |
| 119 | 118 | |
| 120 | 119 | ttl74145->intf = device->static_config; |
| 121 | 120 | ttl74145->number = 0; |
| 122 | | |
| 121 | |
| 123 | 122 | // register for state saving |
| 124 | 123 | state_save_register_item(device->machine, "ttl74145", device->tag, 0, ttl74145->number); |
| 125 | 124 | return DEVICE_START_OK; |
src/mess/machine/cdp1871.c
| r4133 | r4134 | |
| 82 | 82 | int sense; /* sense input scan counter */ |
| 83 | 83 | int drive; /* drive output scan counter */ |
| 84 | 84 | int modifiers; /* modifier inputs */ |
| 85 | | |
| 85 | |
| 86 | 86 | int da; /* data available flag */ |
| 87 | 87 | int next_da; /* next value of data available flag */ |
| 88 | 88 | int rpt; /* repeat flag */ |
| r4133 | r4134 | |
| 206 | 206 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 207 | 207 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 208 | 208 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 209 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('´') |
| 209 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('�') |
| 210 | 210 | |
| 211 | 211 | PORT_START("D2") |
| 212 | 212 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| r4133 | r4134 | |
| 295 | 295 | /* validate arguments */ |
| 296 | 296 | assert(device != NULL); |
| 297 | 297 | assert(device->tag != NULL); |
| 298 | | assert(strlen(device->tag) < 20); |
| 299 | 298 | |
| 300 | 299 | cdp1871->intf = device->static_config; |
| 301 | 300 | |
| r4133 | r4134 | |
| 306 | 305 | cdp1871->next_da = 1; |
| 307 | 306 | cdp1871->next_rpt = 1; |
| 308 | 307 | change_output_lines(device); |
| 309 | | |
| 308 | |
| 310 | 309 | /* create the timers */ |
| 311 | 310 | cdp1871->scan_timer = timer_alloc(device->machine, cdp1871_scan_tick, (void *)device); |
| 312 | 311 | timer_adjust_periodic(cdp1871->scan_timer, attotime_zero, 0, ATTOTIME_IN_HZ(cdp1871->intf->clock)); |
src/mess/machine/6883sam.c
| r4133 | r4134 | |
| 117 | 117 | static void update_sam(const device_config *device) |
| 118 | 118 | { |
| 119 | 119 | sam6883_t *sam = get_safe_token(device); |
| 120 | | UINT16 xorval; |
| 120 | UINT16 xorval; |
| 121 | 121 | |
| 122 | 122 | xorval = sam->old_state ^ sam->state; |
| 123 | 123 | sam->old_state = sam->state; |
| r4133 | r4134 | |
| 159 | 159 | { |
| 160 | 160 | UINT16 mask; |
| 161 | 161 | sam6883_t *sam = get_safe_token(device); |
| 162 | | |
| 162 | |
| 163 | 163 | if (offset < 32) |
| 164 | 164 | { |
| 165 | 165 | mask = 1 << (offset / 2); |
| r4133 | r4134 | |
| 235 | 235 | |
| 236 | 236 | /* Device Interface */ |
| 237 | 237 | static device_start_err common_start(const device_config *device, SAM6883_VERSION device_type) |
| 238 | | { |
| 238 | { |
| 239 | 239 | sam6883_t *sam = get_safe_token(device); |
| 240 | 240 | // validate arguments |
| 241 | 241 | assert(device != NULL); |
| 242 | 242 | assert(device->tag != NULL); |
| 243 | | assert(strlen(device->tag) < 20); |
| 244 | 243 | assert(device->static_config != NULL); |
| 245 | 244 | |
| 246 | 245 | sam->intf = device->static_config; |
| 247 | 246 | |
| 248 | 247 | sam->type = device_type; |
| 249 | | |
| 248 | |
| 250 | 249 | sam->state = 0; |
| 251 | 250 | sam->old_state = ~0; |
| 252 | | |
| 251 | |
| 253 | 252 | /* save state registration */ |
| 254 | 253 | state_save_register_item(device->machine, "6883sam", NULL, 0, sam->state); |
| 255 | 254 | state_save_register_item(device->machine, "6883sam", NULL, 0, sam->video_position); |
src/mess/machine/tms9901.c
| r4133 | r4134 | |
| 128 | 128 | double clock_rate; |
| 129 | 129 | |
| 130 | 130 | /* Pointer to interface */ |
| 131 | | const tms9901_interface *intf; |
| 131 | const tms9901_interface *intf; |
| 132 | 132 | }; |
| 133 | 133 | |
| 134 | 134 | |
| r4133 | r4134 | |
| 263 | 263 | { |
| 264 | 264 | const device_config *device = (const device_config *) ptr; |
| 265 | 265 | tms9901_t *tms = get_token(device); |
| 266 | | |
| 266 | |
| 267 | 267 | tms->timer_int_pending = TRUE; /* decrementer interrupt requested */ |
| 268 | 268 | |
| 269 | 269 | tms9901_field_interrupts(device); |
| r4133 | r4134 | |
| 542 | 542 | static DEVICE_STOP( tms9901 ) |
| 543 | 543 | { |
| 544 | 544 | tms9901_t *tms = get_token(device); |
| 545 | | |
| 545 | |
| 546 | 546 | if (tms->timer) |
| 547 | 547 | { |
| 548 | 548 | timer_reset(tms->timer, attotime_never); /* FIXME - timers should only be allocated once */ |
| r4133 | r4134 | |
| 585 | 585 | |
| 586 | 586 | assert(device != NULL); |
| 587 | 587 | assert(device->tag != NULL); |
| 588 | | assert(strlen(device->tag) < 20); |
| 589 | 588 | assert(device->static_config != NULL); |
| 590 | 589 | |
| 591 | 590 | tms->intf = device->static_config; |
| r4133 | r4134 | |
| 593 | 592 | tms->timer = timer_alloc(device->machine, decrementer_callback, (void *) device); |
| 594 | 593 | |
| 595 | 594 | tms->supported_int_mask = tms->intf->supported_int_mask; |
| 596 | | |
| 595 | |
| 597 | 596 | tms->clock_rate = tms->intf->clock_rate; |
| 598 | 597 | |
| 599 | 598 | tms->int_state = 0; |
src/mess/machine/68901mfp.c
| r4133 | r4134 | |
| 251 | 251 | UINT8 tbcr; /* timer B control register */ |
| 252 | 252 | UINT8 tcdcr; /* timers C and D control register */ |
| 253 | 253 | UINT8 tdr[MC68901_MAX_TIMERS]; /* timer data registers */ |
| 254 | | |
| 254 | |
| 255 | 255 | UINT8 scr; /* synchronous character register */ |
| 256 | 256 | UINT8 ucr; /* USART control register */ |
| 257 | 257 | UINT8 tsr; /* transmitter status register */ |
| 258 | 258 | UINT8 rsr; /* receiver status register */ |
| 259 | 259 | UINT8 udr; /* USART data register */ |
| 260 | | |
| 260 | |
| 261 | 261 | /* counter timer state */ |
| 262 | 262 | UINT8 tmc[MC68901_MAX_TIMERS]; /* timer main counters */ |
| 263 | 263 | int ti[MC68901_MAX_TIMERS]; /* timer in latch */ |
| r4133 | r4134 | |
| 265 | 265 | |
| 266 | 266 | /* interrupt state */ |
| 267 | 267 | int irqlevel; /* interrupt level latch */ |
| 268 | | |
| 268 | |
| 269 | 269 | /* serial state */ |
| 270 | 270 | UINT8 next_rsr; /* receiver status register latch */ |
| 271 | 271 | int rsr_read; /* receiver status register read flag */ |
| r4133 | r4134 | |
| 288 | 288 | |
| 289 | 289 | /* timers */ |
| 290 | 290 | emu_timer *timer[MC68901_MAX_TIMERS]; /* counter timers */ |
| 291 | | |
| 291 | |
| 292 | 292 | emu_timer *rx_timer; /* receive timer */ |
| 293 | 293 | emu_timer *tx_timer; /* transmit timer */ |
| 294 | 294 | |
| r4133 | r4134 | |
| 1378 | 1378 | mc68901_t *mc68901 = device->token; |
| 1379 | 1379 | |
| 1380 | 1380 | /* validate arguments */ |
| 1381 | | assert(device->machine != NULL); |
| 1382 | 1381 | assert(device->tag != NULL); |
| 1383 | | assert(strlen(device->tag) < 20); |
| 1382 | |
| 1384 | 1383 | mc68901->intf = device->static_config; |
| 1385 | 1384 | |
| 1386 | 1385 | /* set initial values */ |
src/mess/machine/tms9902.c
| r4133 | r4134 | |
| 93 | 93 | void *timer; /* MESS timer, used to emulate the decrementer register */ |
| 94 | 94 | |
| 95 | 95 | /* Pointer to interface */ |
| 96 | | const tms9902_interface *intf; |
| 96 | const tms9902_interface *intf; |
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | 99 | /* bits in register_select */ |
| r4133 | r4134 | |
| 146 | 146 | function device should be called by the driver when the state of CTS changes |
| 147 | 147 | |
| 148 | 148 | state == 0: CTS* is inactive (high) |
| 149 | | state != 0: CTS* is active (low) |
| 149 | state != 0: CTS* is active (low) |
| 150 | 150 | */ |
| 151 | 151 | void tms9902_set_cts(const device_config *device, int state) |
| 152 | 152 | { |
| r4133 | r4134 | |
| 213 | 213 | { |
| 214 | 214 | const device_config *device = (const device_config *) ptr; |
| 215 | 215 | tms9902_t *tms9902 = get_token(device); |
| 216 | | |
| 216 | |
| 217 | 217 | if (tms9902->TIMELP) |
| 218 | 218 | tms9902->TIMERR = 1; |
| 219 | 219 | else |
| r4133 | r4134 | |
| 273 | 273 | static void initiate_transmit(const device_config *device) |
| 274 | 274 | { |
| 275 | 275 | tms9902_t *tms9902 = get_token(device); |
| 276 | | |
| 276 | |
| 277 | 277 | /* Load transmit register */ |
| 278 | 278 | tms9902->XSR = tms9902->XBR; |
| 279 | 279 | tms9902->XSRE = 0; |
| r4133 | r4134 | |
| 369 | 369 | WRITE8_DEVICE_HANDLER( tms9902_cru_w ) |
| 370 | 370 | { |
| 371 | 371 | tms9902_t *tms9902 = get_token(device); |
| 372 | | |
| 372 | |
| 373 | 373 | data &= 1; /* clear extra bits */ |
| 374 | 374 | offset &= 0x01F; |
| 375 | 375 | |
| r4133 | r4134 | |
| 578 | 578 | static DEVICE_STOP( tms9902 ) |
| 579 | 579 | { |
| 580 | 580 | tms9902_t *tms9902 = get_token(device); |
| 581 | | |
| 581 | |
| 582 | 582 | if (tms9902->timer) |
| 583 | 583 | { |
| 584 | 584 | timer_reset(tms9902->timer, attotime_never); /* FIXME - timers should only be allocated once */ |
| r4133 | r4134 | |
| 634 | 634 | |
| 635 | 635 | assert(device != NULL); |
| 636 | 636 | assert(device->tag != NULL); |
| 637 | | assert(strlen(device->tag) < 20); |
| 638 | 637 | assert(device->static_config != NULL); |
| 639 | 638 | |
| 640 | 639 | tms9902->intf = device->static_config; |
src/mess/machine/nec765.c
| r4133 | r4134 | |
| 128 | 128 | int timer_type; |
| 129 | 129 | |
| 130 | 130 | emu_timer *command_timer; |
| 131 | | |
| 131 | |
| 132 | 132 | char *data_buffer; |
| 133 | 133 | const nec765_interface *intf; |
| 134 | 134 | }; |
| r4133 | r4134 | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | static void nec765_seek_complete(const device_config *device) |
| 226 | | { |
| 226 | { |
| 227 | 227 | /* tested on Amstrad CPC */ |
| 228 | 228 | |
| 229 | 229 | /* if a seek is done without drive connected: */ |
| r4133 | r4134 | |
| 279 | 279 | |
| 280 | 280 | const device_config *img = current_image(device); |
| 281 | 281 | nec765_t *fdc = get_safe_token(device); |
| 282 | | |
| 282 | |
| 283 | 283 | if (!img) |
| 284 | 284 | return; |
| 285 | 285 | |
| r4133 | r4134 | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | static TIMER_CALLBACK(nec765_timer_callback) |
| 413 | | { |
| 413 | { |
| 414 | 414 | const device_config *device = ptr; |
| 415 | 415 | nec765_timer_func(device,param); |
| 416 | 416 | } |
| r4133 | r4134 | |
| 424 | 424 | static void nec765_setup_timed_generic(const device_config *device, int timer_type, attotime duration) |
| 425 | 425 | { |
| 426 | 426 | nec765_t *fdc = get_safe_token(device); |
| 427 | | |
| 427 | |
| 428 | 428 | fdc->timer_type = timer_type; |
| 429 | 429 | |
| 430 | 430 | if (!(fdc->nec765_flags & NEC765_DMA_MODE)) |
| r4133 | r4134 | |
| 578 | 578 | static void nec765_setup_execution_phase_write(const device_config *device, char *ptr, int size) |
| 579 | 579 | { |
| 580 | 580 | nec765_t *fdc = get_safe_token(device); |
| 581 | | |
| 581 | |
| 582 | 582 | fdc->FDC_main &= ~0x040; /* FDC->CPU */ |
| 583 | 583 | |
| 584 | 584 | fdc->nec765_transfer_bytes_count = 0; |
| r4133 | r4134 | |
| 594 | 594 | static void nec765_setup_result_phase(const device_config *device, int byte_count) |
| 595 | 595 | { |
| 596 | 596 | nec765_t *fdc = get_safe_token(device); |
| 597 | | |
| 597 | |
| 598 | 598 | fdc->FDC_main |= 0x040; /* FDC->CPU */ |
| 599 | 599 | fdc->FDC_main &= ~0x020; /* not execution phase */ |
| 600 | 600 | |
| r4133 | r4134 | |
| 608 | 608 | void nec765_idle(const device_config *device) |
| 609 | 609 | { |
| 610 | 610 | nec765_t *fdc = get_safe_token(device); |
| 611 | | |
| 611 | |
| 612 | 612 | fdc->FDC_main &= ~0x040; /* CPU->FDC */ |
| 613 | 613 | fdc->FDC_main &= ~0x020; /* not execution phase */ |
| 614 | 614 | fdc->FDC_main &= ~0x010; /* not busy */ |
| r4133 | r4134 | |
| 625 | 625 | unsigned int new_flags; |
| 626 | 626 | unsigned int changed_flags; |
| 627 | 627 | nec765_t *fdc = get_safe_token(device); |
| 628 | | |
| 628 | |
| 629 | 629 | assert((flags & ~mask) == 0); |
| 630 | 630 | |
| 631 | 631 | /* compute the new flags and which ones have changed */ |
| r4133 | r4134 | |
| 1716 | 1716 | READ8_DEVICE_HANDLER(nec765_data_r) |
| 1717 | 1717 | { |
| 1718 | 1718 | nec765_t *fdc = get_safe_token(device); |
| 1719 | | |
| 1719 | |
| 1720 | 1720 | if ((fdc->FDC_main & 0x0c0) == 0x0c0) |
| 1721 | 1721 | { |
| 1722 | 1722 | if ( |
| r4133 | r4134 | |
| 1744 | 1744 | WRITE8_DEVICE_HANDLER(nec765_data_w) |
| 1745 | 1745 | { |
| 1746 | 1746 | nec765_t *fdc = get_safe_token(device); |
| 1747 | | |
| 1747 | |
| 1748 | 1748 | if (LOG_EXTRA) |
| 1749 | 1749 | logerror("DATA W: %02x\n", data); |
| 1750 | 1750 | |
| r4133 | r4134 | |
| 1773 | 1773 | static void nec765_setup_invalid(const device_config *device) |
| 1774 | 1774 | { |
| 1775 | 1775 | nec765_t *fdc = get_safe_token(device); |
| 1776 | | |
| 1776 | |
| 1777 | 1777 | fdc->command = 0; |
| 1778 | 1778 | fdc->nec765_result_bytes[0] = 0x080; |
| 1779 | 1779 | nec765_setup_result_phase(device,1); |
| r4133 | r4134 | |
| 1782 | 1782 | static void nec765_setup_command(const device_config *device) |
| 1783 | 1783 | { |
| 1784 | 1784 | nec765_t *fdc = get_safe_token(device); |
| 1785 | | |
| 1785 | |
| 1786 | 1786 | static const char *const commands[] = |
| 1787 | 1787 | { |
| 1788 | 1788 | NULL, /* [00] */ |
| r4133 | r4134 | |
| 2150 | 2150 | void nec765_reset(const device_config *device, int offset) |
| 2151 | 2151 | { |
| 2152 | 2152 | nec765_t *fdc = get_safe_token(device); |
| 2153 | | |
| 2153 | |
| 2154 | 2154 | /* nec765 in idle state - ready to accept commands */ |
| 2155 | 2155 | nec765_idle(device); |
| 2156 | 2156 | |
| r4133 | r4134 | |
| 2197 | 2197 | void nec765_set_reset_state(const device_config *device, int state) |
| 2198 | 2198 | { |
| 2199 | 2199 | nec765_t *fdc = get_safe_token(device); |
| 2200 | | |
| 2200 | |
| 2201 | 2201 | int flags; |
| 2202 | 2202 | |
| 2203 | 2203 | /* get previous reset state */ |
| r4133 | r4134 | |
| 2233 | 2233 | void nec765_set_ready_state(const device_config *device, int state) |
| 2234 | 2234 | { |
| 2235 | 2235 | nec765_t *fdc = get_safe_token(device); |
| 2236 | | |
| 2236 | |
| 2237 | 2237 | /* clear ready state */ |
| 2238 | 2238 | fdc->nec765_flags &= ~NEC765_FDD_READY; |
| 2239 | 2239 | |
| r4133 | r4134 | |
| 2253 | 2253 | |
| 2254 | 2254 | assert(device != NULL); |
| 2255 | 2255 | assert(device->tag != NULL); |
| 2256 | | assert(strlen(device->tag) < 20); |
| 2257 | 2256 | assert(device->static_config != NULL); |
| 2258 | | |
| 2257 | |
| 2259 | 2258 | fdc->intf = device->static_config; |
| 2260 | 2259 | |
| 2261 | 2260 | fdc->version = device_type; |
| r4133 | r4134 | |
| 2295 | 2294 | static DEVICE_RESET( nec765 ) |
| 2296 | 2295 | { |
| 2297 | 2296 | int i; |
| 2298 | | |
| 2297 | |
| 2299 | 2298 | for (i = 0; i < device_count(device->machine, IO_FLOPPY); i++) { |
| 2300 | 2299 | const device_config *img = image_from_devtype_and_index(device->machine, IO_FLOPPY, i); |
| 2301 | 2300 | floppy_drive_set_controller(img, device); |
| 2302 | 2301 | floppy_drive_set_ready_state_change_callback(img, nec765_set_ready_change_callback); |
| 2303 | 2302 | } |
| 2304 | | |
| 2303 | |
| 2305 | 2304 | nec765_reset(device,0); |
| 2306 | 2305 | } |
| 2307 | 2306 | |
src/mess/machine/upd7002.c
| r4133 | r4134 | |
| 28 | 28 | D7 0 = conversion completed, 1 = conversion not completed (~EOC) |
| 29 | 29 | */ |
| 30 | 30 | int status; |
| 31 | | |
| 31 | |
| 32 | 32 | /* High data byte |
| 33 | 33 | This byte contains the 8 most significant bits of the analogue to digital conversion. */ |
| 34 | 34 | int data1; |
| 35 | | |
| 35 | |
| 36 | 36 | /* Low data byte |
| 37 | 37 | In 12 bit mode: Bits 7 to 4 define the four low order bits of the conversion. |
| 38 | 38 | In 8 bit mode. All bits 7 to 4 are inaccurate. |
| 39 | 39 | Bits 3 to 0 are always set to low. */ |
| 40 | 40 | int data0; |
| 41 | | |
| 42 | | |
| 41 | |
| 42 | |
| 43 | 43 | /* temporary store of the next A to D conversion */ |
| 44 | 44 | int digitalvalue; |
| 45 | 45 | |
| r4133 | r4134 | |
| 47 | 47 | if the uPD7002 is half way through one conversion and a new conversion is requested |
| 48 | 48 | the counter at the end of the first conversion will not match and not be processed |
| 49 | 49 | only then at the end of the second conversion will the conversion complete function run */ |
| 50 | | int conversion_counter; |
| 50 | int conversion_counter; |
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | 53 | |
| r4133 | r4134 | |
| 182 | 182 | |
| 183 | 183 | assert(device != NULL); |
| 184 | 184 | assert(device->tag != NULL); |
| 185 | | assert(strlen(device->tag) < 20); |
| 186 | 185 | assert(device->static_config != NULL); |
| 187 | 186 | |
| 188 | 187 | uPD7002->intf = device->static_config; |
| r4133 | r4134 | |
| 191 | 190 | uPD7002->data0 = 0; |
| 192 | 191 | uPD7002->digitalvalue = 0; |
| 193 | 192 | uPD7002->conversion_counter = 0; |
| 194 | | |
| 193 | |
| 195 | 194 | // register for state saving |
| 196 | 195 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->status); |
| 197 | 196 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->data1); |
src/mess/machine/mm58274c.c
| r4133 | r4134 | |
| 194 | 194 | WRITE8_DEVICE_HANDLER (mm58274c_w) |
| 195 | 195 | { |
| 196 | 196 | mm58274c_t *mm58274c = get_safe_token(device); |
| 197 | | |
| 197 | |
| 198 | 198 | offset &= 0xf; |
| 199 | 199 | data &= 0xf; |
| 200 | 200 | |
| r4133 | r4134 | |
| 444 | 444 | static DEVICE_START( mm58274c ) |
| 445 | 445 | { |
| 446 | 446 | mm58274c_t *mm58274c = get_safe_token(device); |
| 447 | | |
| 447 | |
| 448 | 448 | // validate arguments |
| 449 | 449 | assert(device != NULL); |
| 450 | 450 | assert(device->tag != NULL); |
| 451 | | assert(strlen(device->tag) < 20); |
| 452 | 451 | assert(device->static_config != NULL); |
| 453 | 452 | |
| 454 | 453 | mm58274c->intf = device->static_config; |
| r4133 | r4134 | |
| 470 | 469 | state_save_register_item(device->machine, "mm58274c", device->tag, 0, mm58274c->minutes2); |
| 471 | 470 | state_save_register_item(device->machine, "mm58274c", device->tag, 0, mm58274c->seconds1); |
| 472 | 471 | state_save_register_item(device->machine, "mm58274c", device->tag, 0, mm58274c->seconds2); |
| 473 | | state_save_register_item(device->machine, "mm58274c", device->tag, 0, mm58274c->tenths); |
| 472 | state_save_register_item(device->machine, "mm58274c", device->tag, 0, mm58274c->tenths); |
| 474 | 473 | |
| 475 | 474 | mm58274c->increment_rtc = timer_alloc(device->machine, increment_rtc, ((void*)device)); |
| 476 | 475 | timer_adjust_periodic(mm58274c->increment_rtc, attotime_zero, 0, ATTOTIME_IN_MSEC(100)); |
| r4133 | r4134 | |
| 491 | 490 | mm58274c->clk_set = systime.local_time.year & 3 << 2; |
| 492 | 491 | if (mm58274c->intf->mode24) |
| 493 | 492 | mm58274c->clk_set |= clk_set_24; |
| 494 | | |
| 493 | |
| 495 | 494 | /* The clock count starts on 1st January 1900 */ |
| 496 | 495 | mm58274c->wday = 1 + ((systime.local_time.weekday - mm58274c->intf->day1)%7); |
| 497 | 496 | mm58274c->years1 = (systime.local_time.year / 10) % 10; |
src/mess/machine/zx8302.c
| r4133 | r4134 | |
| 102 | 102 | |
| 103 | 103 | int mdv_motor; /* selected motor */ |
| 104 | 104 | int mdv_offset[8]; /* image offset */ |
| 105 | | |
| 105 | |
| 106 | 106 | UINT8 *mdv_image[8]; /* image */ |
| 107 | 107 | |
| 108 | 108 | /* timers */ |
| r4133 | r4134 | |
| 224 | 224 | void zx8302_comctl_w(const device_config *device, int level) |
| 225 | 225 | { |
| 226 | 226 | if (LOG) logerror("IPC COMCTL W: %x\n", level); |
| 227 | | |
| 227 | |
| 228 | 228 | if (level == 1) |
| 229 | 229 | { |
| 230 | 230 | zx8302_ipc_comm_tick(device); |
| r4133 | r4134 | |
| 573 | 573 | /* validate arguments */ |
| 574 | 574 | assert(device != NULL); |
| 575 | 575 | assert(device->tag != NULL); |
| 576 | | assert(strlen(device->tag) < 20); |
| 577 | 576 | assert(device->clock > 0); |
| 578 | 577 | |
| 579 | 578 | zx8302->intf = device->static_config; |
| r4133 | r4134 | |
| 619 | 618 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->ipc_rx); |
| 620 | 619 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->ipc_busy); |
| 621 | 620 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->baudx4); |
| 622 | | |
| 621 | |
| 623 | 622 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->tx_bits); |
| 624 | 623 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->ser1_rxd); |
| 625 | 624 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->ser1_cts); |
| r4133 | r4134 | |
| 632 | 631 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->mdselck); |
| 633 | 632 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->mdseld); |
| 634 | 633 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->erase); |
| 635 | | |
| 634 | |
| 636 | 635 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->mdv_motor); |
| 637 | 636 | state_save_register_item_array(device->machine, "zx8302", device->tag, 0, zx8302->mdv_offset); |
| 638 | 637 | return DEVICE_START_OK; |