예제 #1
0
파일: a1bus.cpp 프로젝트: Fulg/mame
void a1bus_device::install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data)
{
//  printf("install_bank: %s @ %x->%x\n", tag, start, end);
	m_maincpu = machine().device<cpu_device>(m_cputag);
	address_space &space = m_maincpu->space(AS_PROGRAM);
	space.install_readwrite_bank(start, end, tag );
	machine().root_device().membank(siblingtag(tag).c_str())->set_base(data);
}
예제 #2
0
/* device interface */
void crtc_ega_device::device_start()
{
	/* validate arguments */
	assert(m_clock > 0);
	assert(m_hpixels_per_column > 0);

	/* resolve callbacks */
	m_res_out_de_func.resolve(m_out_de_func, *this);
	m_res_out_hsync_func.resolve(m_out_hsync_func, *this);
	m_res_out_vsync_func.resolve(m_out_vsync_func, *this);
	m_res_out_vblank_func.resolve(m_out_vblank_func, *this);

	/* get the screen device */
	if ( m_screen_tag != NULL )
	{
		astring tempstring;
		m_screen = downcast<screen_device *>(machine().device(siblingtag(tempstring,m_screen_tag)));
		assert(m_screen != NULL);
	}
	else
		m_screen = NULL;

	/* create the timers */
	m_line_timer = timer_alloc(TIMER_LINE);
	m_de_off_timer = timer_alloc(TIMER_DE_OFF);
	m_cur_on_timer = timer_alloc(TIMER_CUR_ON);
	m_cur_off_timer = timer_alloc(TIMER_CUR_OFF);
	m_hsync_on_timer = timer_alloc(TIMER_HSYNC_ON);
	m_hsync_off_timer = timer_alloc(TIMER_HSYNC_OFF);
	m_light_pen_latch_timer = timer_alloc(TIMER_LIGHT_PEN_LATCH);

	/* Use some large startup values */
	m_horiz_char_total = 0xff;
	m_max_ras_addr = 0x1f;
	m_vert_total = 0x3ff;

	m_ena_vert_access = 0;
	m_de_skew = 0;
	m_horiz_retr_start = 0;
	m_horiz_retr_end = 0;
	m_horiz_retr_skew = 0;
	m_preset_row_scan = 0;
	m_byte_panning = 0;
	m_scan_doubling = 0;
	m_cursor_start_ras = 0x20;
	m_cursor_disable = 0;
	m_cursor_end_ras = 0;
	m_cursor_skew = 0;
	m_disp_start_addr = 0;
	m_light_pen_addr = 0;
	m_vert_retr_end = 0;
	m_protect = 0;
	m_bandwidth = 0;
	m_offset = 0;
	m_underline_loc = 0;
	m_vert_blank_end = 0;
	m_mode_control = 0;
	m_line_compare = 0;
	m_register_address_latch = 0;
	m_cursor_state = false;
	m_cursor_blink_count = 0;
	m_cur = 0;
	m_hsync = 0;
	m_vsync = 0;
	m_vblank = 0;
	m_de = 0;
	m_character_counter = 0;
	m_hsync_width_counter = 0;
	m_vsync_width_counter = 0;
	m_line_enable_ff = false;
	m_vsync_ff = 0;
	m_adjust_active = 0;

	m_current_disp_addr = 0;
	m_light_pen_latched = FALSE;
	m_has_valid_parameters = false;

	/* register for state saving */
	save_item(NAME(m_hpixels_per_column));
	save_item(NAME(m_register_address_latch));
	save_item(NAME(m_horiz_char_total));
	save_item(NAME(m_horiz_disp));
	save_item(NAME(m_horiz_blank_start));
	save_item(NAME(m_mode_control));
	save_item(NAME(m_cursor_start_ras));
	save_item(NAME(m_cursor_end_ras));
	save_item(NAME(m_disp_start_addr));
	save_item(NAME(m_cursor_addr));
	save_item(NAME(m_light_pen_addr));
	save_item(NAME(m_light_pen_latched));
	save_item(NAME(m_cursor_state));
	save_item(NAME(m_cursor_blink_count));
	save_item(NAME(m_horiz_blank_end));
	save_item(NAME(m_ena_vert_access));
	save_item(NAME(m_de_skew));
	save_item(NAME(m_horiz_retr_start));
	save_item(NAME(m_horiz_retr_end));
	save_item(NAME(m_horiz_retr_skew));
	save_item(NAME(m_vert_total));
	save_item(NAME(m_preset_row_scan));
	save_item(NAME(m_byte_panning));
	save_item(NAME(m_max_ras_addr));
	save_item(NAME(m_scan_doubling));
	save_item(NAME(m_cursor_disable));
	save_item(NAME(m_cursor_skew));
	save_item(NAME(m_vert_retr_start));
	save_item(NAME(m_vert_retr_end));
	save_item(NAME(m_protect));
	save_item(NAME(m_bandwidth));
	save_item(NAME(m_vert_disp_end));
	save_item(NAME(m_offset));
	save_item(NAME(m_underline_loc));
	save_item(NAME(m_vert_blank_start));
	save_item(NAME(m_vert_blank_end));
	save_item(NAME(m_line_compare));
}