static attotime compute_duration(ttl74123_t *chip) { double duration; switch (chip->intf->connection_type) { case TTL74123_NOT_GROUNDED_NO_DIODE: duration = 0.28 * chip->intf->res * chip->intf->cap * (1.0 + (700.0 / chip->intf->res)); break; case TTL74123_NOT_GROUNDED_DIODE: duration = 0.25 * chip->intf->res * chip->intf->cap * (1.0 + (700.0 / chip->intf->res)); break; case TTL74123_GROUNDED: default: if (chip->intf->cap < CAP_U(0.1)) /* this is really a curve - a very flat one in the 0.1uF-.01uF range */ duration = 0.32 * chip->intf->res * chip->intf->cap; else duration = 0.33 * chip->intf->res * chip->intf->cap; break; } return double_to_attotime(duration); }
static STATE_POSTLOAD( schaser_reinit_555_time_remain ) { mw8080bw_state *state = machine->driver_data<mw8080bw_state>(); address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM); state->schaser_effect_555_time_remain = double_to_attotime(state->schaser_effect_555_time_remain_savable); schaser_sh_port_2_w(space, 0, state->port_2_last_extra); }
attotime ttl74123_device::compute_duration() { double duration; switch (m_config.m_connection_type) { case TTL74123_NOT_GROUNDED_NO_DIODE: duration = 0.28 * m_config.m_res * m_config.m_cap * (1.0 + (700.0 / m_config.m_res)); break; case TTL74123_NOT_GROUNDED_DIODE: duration = 0.25 * m_config.m_res * m_config.m_cap * (1.0 + (700.0 / m_config.m_res)); break; case TTL74123_GROUNDED: default: if (m_config.m_cap < CAP_U(0.1)) { /* this is really a curve - a very flat one in the 0.1uF-.01uF range */ duration = 0.32 * m_config.m_res * m_config.m_cap; } else { duration = 0.33 * m_config.m_res * m_config.m_cap; } break; } return double_to_attotime(duration); }
static MACHINE_RESET( beathead ) { /* reset the common subsystems */ atarigen_eeprom_reset(); atarigen_interrupt_reset(update_interrupts); atarijsa_reset(); /* the code is temporarily mapped at 0 at startup */ /* just copying the first 0x40 bytes is sufficient */ memcpy(ram_base, rom_base, 0x40); /* compute the timing of the HBLANK interrupt and set the first timer */ hblank_offset = attotime_to_double(video_screen_get_scan_period(machine->primary_screen)) * ((455. - 336. - 25.) / 455.); timer_set(machine, double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(machine->primary_screen, 0, 0)) - hblank_offset), NULL, 0, scanline_callback); /* reset IRQs */ irq_line_state = CLEAR_LINE; irq_state[0] = irq_state[1] = irq_state[2] = 0; irq_enable[0] = irq_enable[1] = irq_enable[2] = 0; }
static TIMER_DEVICE_CALLBACK( scanline_callback ) { int scanline = param; /* update the video */ video_screen_update_now(timer->machine->primary_screen); /* on scanline zero, clear any halt condition */ if (scanline == 0) cputag_set_input_line(timer->machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); /* wrap around at 262 */ scanline++; if (scanline >= MAX_SCANLINES) scanline = 0; /* set the scanline IRQ */ irq_state[2] = 1; update_interrupts(timer->machine); /* set the timer for the next one */ timer_device_adjust_oneshot(timer, double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(timer->machine->primary_screen, scanline, 0)) - hblank_offset), scanline); }
static STATE_POSTLOAD( schaser_reinit_555_time_remain ) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); schaser_effect_555_time_remain = double_to_attotime(schaser_effect_555_time_remain_savable); schaser_sh_port_2_w(space, 0, port_2_last_extra); }