int
main (int argc, const char *argv[])
{
    int i;

    for (i = 1; i <= 8; i++)
    {
	initialize_palette (&(rgb_palette[i]), i, TRUE);
	initialize_palette (&(y_palette[i]), i, FALSE);
    }

    return fuzzer_test_main("blitters", 2000000,
			    0x1DB8BDF8,
			    test_composite, argc, argv);
}
예제 #2
0
파일: uv201.c 프로젝트: felipesanches/ume
void uv201_device::device_start()
{
	// resolve callbacks
	m_out_ext_int_func.resolve(m_out_ext_int_cb, *this);
	m_out_hblank_func.resolve(m_out_hblank_cb, *this);
	m_in_db_func.resolve(m_in_db_cb, *this);

	// allocate timers
	m_timer_y_odd = timer_alloc(TIMER_Y_ODD);
	m_timer_y_even = timer_alloc(TIMER_Y_EVEN);
	m_timer_hblank_on = timer_alloc(TIMER_HBLANK_ON);
	m_timer_hblank_off = timer_alloc(TIMER_HBLANK_OFF);

	initialize_palette();

	memset(m_ram, 0x00, sizeof(m_ram));
	m_y_int = 0;
	m_fmod = 0;
	m_bg = 0;
	m_cmd = 0;
	m_freeze_x = 0;
	m_freeze_y = 0;
	m_field = 0;

	// state saving
	save_item(NAME(m_ram));
	save_item(NAME(m_y_int));
	save_item(NAME(m_fmod));
	save_item(NAME(m_bg));
	save_item(NAME(m_cmd));
	save_item(NAME(m_freeze_x));
	save_item(NAME(m_freeze_y));
	save_item(NAME(m_field));
}
예제 #3
0
파일: uv201.c 프로젝트: clobber/UME
void uv201_device::device_start()
{
	// resolve callbacks
	m_out_ext_int_func.resolve(m_out_ext_int_cb, *this);
	m_out_hblank_func.resolve(m_out_hblank_cb, *this);
	m_in_db_func.resolve(m_in_db_cb, *this);

	// allocate timers
	m_timer_y_odd = timer_alloc(TIMER_Y_ODD);
	m_timer_y_even = timer_alloc(TIMER_Y_EVEN);
	m_timer_hblank_on = timer_alloc(TIMER_HBLANK_ON);
	m_timer_hblank_off = timer_alloc(TIMER_HBLANK_OFF);

	// find devices
	m_screen = machine().device<screen_device>(m_screen_tag);

	initialize_palette();

	// state saving
	save_item(NAME(m_ram));
	save_item(NAME(m_y_int));
	save_item(NAME(m_fmod));
	save_item(NAME(m_bg));
	save_item(NAME(m_cmd));
	save_item(NAME(m_freeze_x));
	save_item(NAME(m_freeze_y));
	save_item(NAME(m_field));
}
예제 #4
0
void cdp1862_device::device_start()
{
	// resolve callbacks
	m_read_rd.resolve_safe(0);
	m_read_bd.resolve_safe(0);
	m_read_gd.resolve_safe(0);

	// find devices
	m_screen->register_screen_bitmap(m_bitmap);

	// init palette
	initialize_palette();

	// register for state saving
	save_item(NAME(m_bgcolor));
	save_item(NAME(m_con));
}
예제 #5
0
파일: cdp1862.c 프로젝트: coinhelper/jsmess
void cdp1862_device::device_start()
{
	// resolve callbacks
	m_in_rd_func.resolve(m_in_rd_cb, *this);
	m_in_bd_func.resolve(m_in_bd_cb, *this);
	m_in_gd_func.resolve(m_in_gd_cb, *this);

	// find devices
	m_screen =  machine().device<screen_device>(m_screen_tag);
	m_screen->register_screen_bitmap(m_bitmap);

	// init palette
	initialize_palette();

	// register for state saving
	save_item(NAME(m_bgcolor));
	save_item(NAME(m_con));
}
예제 #6
0
void PixmanBitmap::Init(int width, int height, void* data, int pitch, bool destroy) {
	if (!pitch)
		pitch = width * bytes();

	bitmap = pixman_image_create_bits(pixman_format, width, height, (uint32_t*) data, pitch);

	if (bitmap == NULL) {
		Output::Error("Couldn't create %dx%d image.\n", width, height);
	}

	if (format.bits == 8) {
		initialize_palette();
		pixman_image_set_indexed(bitmap, &palette);
	}

	if (data != NULL && destroy)
		pixman_image_set_destroy_function(bitmap, destroy_func, data);
}
예제 #7
0
void cdp1864_device::device_start()
{
    // resolve callbacks
    m_in_inlace_func.resolve(m_in_inlace_cb, *this);
    m_in_rdata_func.resolve(m_in_rdata_cb, *this);
    m_in_bdata_func.resolve(m_in_bdata_cb, *this);
    m_in_gdata_func.resolve(m_in_gdata_cb, *this);
    m_out_int_func.resolve(m_out_int_cb, *this);
    m_out_dmao_func.resolve(m_out_dmao_cb, *this);
    m_out_efx_func.resolve(m_out_efx_cb, *this);
    m_out_hsync_func.resolve(m_out_hsync_cb, *this);

    // initialize palette
    initialize_palette();

    // create sound stream
    m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate());

    // allocate timers
    m_int_timer = timer_alloc(TIMER_INT);
    m_efx_timer = timer_alloc(TIMER_EFX);
    m_dma_timer = timer_alloc(TIMER_DMA);
    m_hsync_timer = timer_alloc(TIMER_HSYNC);

    // find devices
    m_cpu = machine().device<cpu_device>(m_cpu_tag);
    m_screen = machine().device<screen_device>(m_screen_tag);
    m_screen->register_screen_bitmap(m_bitmap);

    // register for state saving
    save_item(NAME(m_disp));
    save_item(NAME(m_dmaout));
    save_item(NAME(m_bgcolor));
    save_item(NAME(m_con));
    save_item(NAME(m_aoe));
    save_item(NAME(m_latch));
    save_item(NAME(m_signal));
    save_item(NAME(m_incr));
}
예제 #8
0
void cdp1864_device::device_start()
{
	// resolve callbacks
	m_read_inlace.resolve_safe(1);
	m_read_rdata.resolve_safe(0);
	m_read_bdata.resolve_safe(0);
	m_read_gdata.resolve_safe(0);
	m_write_irq.resolve_safe();
	m_write_dma_out.resolve_safe();
	m_write_efx.resolve_safe();
	m_write_hsync.resolve_safe();

	// initialize palette
	initialize_palette();

	// create sound stream
	m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate());

	// allocate timers
	m_int_timer = timer_alloc(TIMER_INT);
	m_efx_timer = timer_alloc(TIMER_EFX);
	m_dma_timer = timer_alloc(TIMER_DMA);
	m_hsync_timer = timer_alloc(TIMER_HSYNC);

	// find devices
	m_screen->register_screen_bitmap(m_bitmap);

	// register for state saving
	save_item(NAME(m_disp));
	save_item(NAME(m_dmaout));
	save_item(NAME(m_bgcolor));
	save_item(NAME(m_con));
	save_item(NAME(m_aoe));
	save_item(NAME(m_latch));
	save_item(NAME(m_signal));
	save_item(NAME(m_incr));
}
예제 #9
0
파일: main.c 프로젝트: rtobar/imanes
int main(int args, char *argv[]) {

	char *save_file;
	ines_file *nes_rom;

	/* Print NOW everything :D */
#ifdef _MSC_VER
	setvbuf(stdout,NULL,_IONBF,0);
	setvbuf(stderr,NULL,_IONBF,0);
#else
	setbuf(stdout,NULL);
	setbuf(stderr,NULL);
#endif

	/* i18n stuff */
	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	/* Parse command line options */
	initialize_configuration();
	switch ( parse_options(args, argv) ) {
		case -1:
			usage(stderr,argv);
			exit(EXIT_FAILURE);
		case 0:
			exit(EXIT_SUCCESS);
		default:
			break;
	}

	load_user_configuration();

	/* Initialize static data */
	initialize_palette();
	initialize_instruction_set();
	initialize_playback();
	initialize_apu();
	initialize_cpu();
	initialize_ppu();
	initialize_clock();
	initialize_pads();

	/* Read the ines file and get all the ROM/VROM */
	config.rom_file = argv[optind];
	nes_rom = check_ines_file(config.rom_file);
	map_rom_memory(nes_rom);
	save_file = load_sram(config.rom_file);

	/* Init the graphics engine */
	init_screen();
	init_gui();

	/* Main execution loop */
	main_loop();

	/* After finishing the emulation, save the SRAM if necessary */
	save_sram(save_file);
	free(save_file);

	/* Free all the used resources */
	mapper->end_mapper();
	end_screen();
	end_gui();
	end_ppu();
	end_cpu();
	end_apu();
	end_playback();
	free_ines_file(nes_rom);

	return 0;
}