void sol20_state::machine_reset() { UINT8 data = 0, s_count = 0; int s_clock; const UINT16 s_bauds[8]={ 75, 110, 180, 300, 600, 1200, 2400, 4800 }; m_sol20_fe=0; m_sol20_fa=1; // set hard-wired uart pins m_uart->set_input_pin(AY31015_CS, 0); m_uart->set_input_pin(AY31015_NB1, 1); m_uart->set_input_pin(AY31015_NB2, 1); m_uart->set_input_pin(AY31015_TSB, 1); m_uart->set_input_pin(AY31015_EPS, 1); m_uart->set_input_pin(AY31015_NP, 1); m_uart->set_input_pin(AY31015_CS, 1); // set switched uart pins data = m_iop_s4->read(); m_uart_s->set_input_pin(AY31015_CS, 0); m_uart_s->set_input_pin(AY31015_NB1, BIT(data, 1)); m_uart_s->set_input_pin(AY31015_NB2, BIT(data, 2)); m_uart_s->set_input_pin(AY31015_TSB, BIT(data, 3)); m_uart_s->set_input_pin(AY31015_EPS, BIT(data, 0)); m_uart_s->set_input_pin(AY31015_NP, BIT(data, 4)); m_uart_s->set_input_pin(AY31015_CS, 1); // set rs232 baud rate data = m_iop_s3->read(); if (data > 1) do { s_count++; data >>= 1; } while (!(data & 1) && (s_count < 7)); // find which switch is used if ( (s_count == 7) & BIT(m_iop_config->read(), 0) ) // if highest, look at jumper s_clock = 9600 << 4; else s_clock = s_bauds[s_count] << 4; // these lines could be commented out for now if you want better performance m_uart_s->set_receiver_clock(s_clock); m_uart_s->set_transmitter_clock(s_clock); // boot-bank membank("boot")->set_entry(1); timer_set(attotime::from_usec(9), TIMER_SOL20_BOOT); }
/* Reset it */ void force68k_state::machine_reset () { LOG("%s\n", FUNCNAME); // Set up the BRG divider. RSA is a jumper setting and RSB is always set High m_brg->rsa_w( m_serial_brf->read() == 0x80 ? ASSERT_LINE : CLEAR_LINE ); m_brg->rsb_w( ASSERT_LINE); // Disable all configured timers, only enabling the used ones m_brg->timer_disable_all(); m_brg->timer_enable((mc14411_device::timer_id) m_serial_p3->read(), true); m_brg->timer_enable((mc14411_device::timer_id) m_serial_p4->read(), true); m_brg->timer_enable((mc14411_device::timer_id) m_serial_p5->read(), true); }
int alg_state::get_lightgun_pos(int player, int *x, int *y) { const rectangle &visarea = m_screen->visible_area(); int xpos = (player == 0) ? m_gun1x->read() : (m_gun2x ? m_gun2x->read() : 0xffffffff); int ypos = (player == 0) ? m_gun1y->read() : (m_gun2y ? m_gun2y->read() : 0xffffffff); if (xpos == -1 || ypos == -1) return FALSE; *x = visarea.min_x + xpos * visarea.width() / 255; *y = visarea.min_y + ypos * visarea.height() / 255; return TRUE; }
UINT32 cv1k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_blitter->set_delay_scale(m_blitrate->read()); m_blitter->draw_screen(bitmap,cliprect); return 0; }
void nascom2_state::machine_reset() { // base machine reset nascom_state::machine_reset(); // restart address (on the real system, a12 to a15 are forced to 1 for one memory cycle) m_maincpu->set_state_int(Z80_PC, m_lsw1->read() << 12); }
/* * Serial port clock sources can all be driven by different or the same output(s) of the MC14411 */ void force68k_state::write_acia_clocks(int id, int state) { if (id == m_serial_p3->read()) { m_aciahost->write_txc(state); m_aciahost->write_rxc(state); } if (id == m_serial_p4->read()) { m_aciaterm->write_txc(state); m_aciaterm->write_rxc(state); } if (id == m_serial_p5->read()) { m_aciaremt->write_txc(state); m_aciaremt->write_rxc(state); } }
UINT32 rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_crtc->palette_select( m_inp9->read() ); if ( m_SCREEN_BLANK ) m_crtc->video_blanking(bitmap, cliprect); else m_crtc->video_update(bitmap, cliprect); return 0; }
UINT16 pico_base_state::pico_read_penpos(int pen) { UINT16 penpos = 0; switch (pen) { case PICO_PENX: penpos = m_io_penx->read(); penpos |= 0x6; penpos = penpos * 320 / 255; penpos += 0x3d; break; case PICO_PENY: penpos = m_io_peny->read(); penpos |= 0x6; penpos = penpos * 251 / 255; penpos += 0x1fc; break; } return penpos; }
void supercon_state::mouse_update() { UINT8 port_input; // m_left; int i; /* border pieces and moving piece */ port_input = m_b_white->read(); if (port_input) { i = get_first_bit(port_input); m_moving_piece = m_border_pieces[i]; output_set_value("MOVING", m_moving_piece); return; } port_input = m_b_black->read(); if (port_input) { i = get_first_bit(port_input); m_moving_piece = m_border_pieces[6+i]; output_set_value("MOVING", m_moving_piece); return; } port_input = m_b_clr->read(); if (port_input) { if (m_moving_piece) { m_moving_piece=0; output_set_value("MOVING", m_moving_piece); return; } } }
UINT32 rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // TEST-DEBUG: no screen updates during diskette operations! if (MOTOR_DISABLE_counter) return 0; m_crtc->palette_select( m_inp9->read() ); if ( m_SCREEN_BLANK ) m_crtc->video_blanking(bitmap, cliprect); else m_crtc->video_update(bitmap, cliprect); return 0; }
uint8_t alphatro_state::port10_r() { // Bit 0 -> 1 = FDC is installed, 0 = not // Bit 1 -> 1 = Graphic Board is installed, 0 = not // Bits 2-4 = Country select: 0 = Intl, 1 = German, 2 = US // Bit 5 -> 1 = BASIC LPRINT is RS-232, 0 = BASIC LPRINT is Centronics // Bit 6 -> 1 = NTSC, 0 = PAL // Bit 7 -> 1 = vblank or hblank, 0 = active display area u8 retval = m_is_ntsc ? 0x40 : 0x00; // we'll get "FDC present" and "graphics expansion present" from the config switches retval |= (m_config->read() & 3); if (!m_crtc->de_r()) { retval |= 0x80; } return retval; }
void gimix_state::machine_reset() { m_term_data = 0; m_rombank1->set_entry(0); // RAM banks are undefined on startup m_rombank2->set_entry(1); m_fixedrombank->set_entry(0); m_dma_status = 0x00; m_dma_ctrl = 0x00; m_task = 0x00; m_selected_drive = 0; m_floppy0_ready = false; m_floppy1_ready = false; membank("lower_ram")->set_base(m_ram->pointer()); if(m_ram->size() > 65536) membank("upper_ram")->set_base(m_ram->pointer()+0x10000); // initialise FDC clock based on DIP Switch S2-9 (5.25"/8" drive select) if(m_dma_dip->read() & 0x00000100) m_fdc->set_unscaled_clock(XTAL_8MHz / 4); // 8 inch (2MHz) else m_fdc->set_unscaled_clock(XTAL_8MHz / 8); // 5.25 inch (1MHz) }
INPUT_PORTS_END void rainbow_state::machine_reset() { m_unit = INVALID_DRIVE; m_fdc->reset(); m_fdc->set_floppy(NULL); m_fdc->dden_w(0); //m_fdc->set_force_ready(false); /* configure RAM */ address_space &program = m_maincpu->space(AS_PROGRAM); if (m_inp8->read() < END_OF_RAM) { program.unmap_readwrite(m_inp8->read(), END_OF_RAM); } // BIOS can't handle soft resets (=> triggers ERROR 16). if ( COLD_BOOT == 2 ) { // As a fallback, execute a hard reboot - device().machine().schedule_hard_reset(); } if ( COLD_BOOT == 1 ) { COLD_BOOT = 2; m_crtc->MHFU(-100); // reset MHFU counter } m_z80->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); INT88 = false; INTZ80 = false; m_zflip = true; m_z80_halted = true; m_kbd_tx_ready = m_kbd_rx_ready = false; m_kbd8251->write_cts(1); m_KBD = 0; m_irq_high = 0; // RESET ALL LEDs output_set_value("led1", 1); output_set_value("led2", 1); output_set_value("led3", 1); output_set_value("led4", 1); output_set_value("led5", 1); output_set_value("led6", 1); output_set_value("led7", 1); // GREEN KEYBOARD LEDs (1 = on, 0 = off): output_set_value("led_wait", 0); // led8 output_set_value("led_compose", 0); // led9 output_set_value("led_lock", 0); // led10 output_set_value("led_hold", 0); // led11 m_irq_mask = 0; }
UINT32 ie15_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline, UINT8 y) { UINT8 gfx,fg,bg,ra,blink,red; UINT16 x,chr; bg = 0; fg = 1; ra = scanline % 8; blink = (machine().primary_screen->frame_number() % 10) >= 5; red = m_io_keyboard->read() & 0x01; DBG_LOG(2,"draw_scanline", ("addr %03x row %d-%d video %d\n", offset, y, scanline, m_video)); for (x = offset; x < offset + 80; x++) { if (m_video) { chr = m_p_videoram[x] << 3; gfx = m_p_chargen[chr | ra]; /* Cursor is a character with only 3 scan lines, and is not shown if flag 1 is not active on this scan line. It always blinks if shown. Control characters blink if RED mode is on and they are not on status line; else they are blanked out. */ if (scanline > 7 && (!m_cursor || blink)) gfx = 0; if (chr < (0x20<<3)) { if (!y || !red || blink) gfx = 0; else gfx = m_p_chargen[chr | 0x200 | ra]; } /* Display a scanline of a character */ *p++ = BIT(gfx, 7) ? fg : bg; *p++ = BIT(gfx, 6) ? fg : bg; *p++ = BIT(gfx, 5) ? fg : bg; *p++ = BIT(gfx, 4) ? fg : bg; *p++ = BIT(gfx, 3) ? fg : bg; *p++ = BIT(gfx, 2) ? fg : bg; *p++ = BIT(gfx, 1) ? fg : bg; *p++ = bg; *p++ = bg; *p++ = bg; } else { *p++ = bg; *p++ = bg; *p++ = bg; *p++ = bg; *p++ = bg; *p++ = bg; *p++ = bg; *p++ = bg; *p++ = bg; *p++ = bg; } } return 0; }
void ql_state::machine_reset() { // QIMI m_qimi_enabled = (m_config->read() & 0x01) ? true : false; }
UINT32 sol20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // Visible screen is 64 x 16, with start position controlled by scroll register. // Each character is 9 pixels wide (blank ones at the right) and 13 lines deep. // Note on blinking characters: // any character with bit 7 set will blink. With DPMON, do DA C000 C2FF to see what happens UINT16 which = (m_iop_config->read() & 2) << 10; UINT8 s1 = m_iop_s1->read(); UINT8 y,ra,chr,gfx; UINT16 sy=0,ma,x,inv; UINT8 polarity = (s1 & 8) ? 0xff : 0; bool cursor_inv = false; if (((s1 & 0x30) == 0x20) || (((s1 & 0x30) == 0x10) && (m_framecnt & 0x08))) cursor_inv = true; m_framecnt++; ma = m_sol20_fe << 6; // scroll register for (y = 0; y < 16; y++) { for (ra = 0; ra < 13; ra++) { UINT16 *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 64; x++) { inv = polarity; chr = m_p_videoram[x & 0x3ff]; // cursor if (BIT(chr, 7) & cursor_inv) inv ^= 0xff; chr &= 0x7f; if ((ra == 0) || ((s1 & 4) && (chr < 0x20))) gfx = inv; else if ((chr==0x2C) || (chr==0x3B) || (chr==0x67) || (chr==0x6A) || (chr==0x70) || (chr==0x71) || (chr==0x79)) { if (ra < 4) gfx = inv; else gfx = m_p_chargen[which | (chr<<4) | (ra-4) ] ^ inv; } else { if (ra < 10) gfx = m_p_chargen[which | (chr<<4) | (ra-1) ] ^ inv; else gfx = inv; } /* Display a scanline of a character */ *p++ = BIT(gfx, 7); *p++ = BIT(gfx, 6); *p++ = BIT(gfx, 5); *p++ = BIT(gfx, 4); *p++ = BIT(gfx, 3); *p++ = BIT(gfx, 2); *p++ = BIT(gfx, 1); *p++ = BIT(gfx, 0); *p++ = BIT(inv, 0); } } ma+=64; } return 0; }
void ti74_state::machine_reset() { m_power = 1; update_battery_status(m_battery_inp->read()); }
void oric_state::vblank_w(screen_device &screen, bool state) { if(m_config->read()) m_via->write_cb1(state); }