Beispiel #1
0
DRIVER_INIT_MEMBER(gstriker_state,vgoalsoc)
{
    m_gametype = 3;
    mcu_init();

    m_maincpu->space(AS_PROGRAM).install_write_handler(0x200090, 0x200091, write16_delegate(FUNC(gstriker_state::vbl_toggle_w),this)); // vblank toggle
    m_maincpu->space(AS_PROGRAM).install_read_handler(0x200090, 0x200091, read16_delegate(FUNC(gstriker_state::vbl_toggle_r),this));
}
Beispiel #2
0
void bwidow_state::bwidow_map(address_map &map)
{
	map(0x0000, 0x07ff).ram();
	map(0x2000, 0x27ff).ram().share("vectorram").region("maincpu", 0x2000);
	map(0x2800, 0x5fff).rom();
	map(0x6000, 0x67ff).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write));
	map(0x6800, 0x6fff).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write));
	map(0x7000, 0x7000).r(FUNC(bwidow_state::earom_read));
	map(0x7800, 0x7800).portr("IN0");
	map(0x8000, 0x8000).portr("IN3");
	map(0x8800, 0x8800).portr("IN4");
	map(0x8800, 0x8800).w(FUNC(bwidow_state::bwidow_misc_w)); /* coin counters, leds */
	map(0x8840, 0x8840).w("avg", FUNC(avg_device::go_w));
	map(0x8880, 0x8880).w("avg", FUNC(avg_device::reset_w));
	map(0x88c0, 0x88c0).w(FUNC(bwidow_state::irq_ack_w)); /* interrupt acknowledge */
	map(0x8900, 0x8900).w(FUNC(bwidow_state::earom_control_w));
	map(0x8940, 0x897f).w(FUNC(bwidow_state::earom_write));
	map(0x8980, 0x89ed).nopw(); /* watchdog clear */
	map(0x9000, 0xffff).rom();
}
Beispiel #3
0
void bwidow_state::spacduel_map(address_map &map)
{
	map(0x0000, 0x03ff).ram();
	map(0x0800, 0x0800).portr("IN0");
	map(0x0900, 0x0907).r(FUNC(bwidow_state::spacduel_IN3_r));    /* IN1 */
	map(0x0905, 0x0906).nopw(); /* ignore? */
	map(0x0a00, 0x0a00).r(FUNC(bwidow_state::earom_read));
	map(0x0c00, 0x0c00).w(FUNC(bwidow_state::spacduel_coin_counter_w)); /* coin out */
	map(0x0c80, 0x0c80).w("avg", FUNC(avg_device::go_w));
	map(0x0d00, 0x0d00).nopw(); /* watchdog clear */
	map(0x0d80, 0x0d80).w("avg", FUNC(avg_device::reset_w));
	map(0x0e00, 0x0e00).w(FUNC(bwidow_state::irq_ack_w)); /* interrupt acknowledge */
	map(0x0e80, 0x0e80).w(FUNC(bwidow_state::earom_control_w));
	map(0x0f00, 0x0f3f).w(FUNC(bwidow_state::earom_write));
	map(0x1000, 0x10ff).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write));
	map(0x1400, 0x14ff).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write));
	map(0x2000, 0x27ff).ram().share("vectorram").region("maincpu", 0x2000);
	map(0x2800, 0x3fff).rom();
	map(0x4000, 0xffff).rom();
}
Beispiel #4
0
void esripsys_state::video_start()
{
	struct line_buffer_t *line_buffer = m_line_buffer;
	int i;

	/* Allocate memory for the two 512-pixel line buffers */
	line_buffer[0].colour_buf = auto_alloc_array(machine(), UINT8, 512);
	line_buffer[0].intensity_buf = auto_alloc_array(machine(), UINT8, 512);
	line_buffer[0].priority_buf = auto_alloc_array(machine(), UINT8, 512);

	line_buffer[1].colour_buf = auto_alloc_array(machine(), UINT8, 512);
	line_buffer[1].intensity_buf = auto_alloc_array(machine(), UINT8, 512);
	line_buffer[1].priority_buf = auto_alloc_array(machine(), UINT8, 512);

	/* Create and initialise the HBLANK timers */
	m_hblank_start_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(esripsys_state::hblank_start_callback),this));
	m_hblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(esripsys_state::hblank_end_callback),this));
	m_hblank_start_timer->adjust(m_screen->time_until_pos(0, ESRIPSYS_HBLANK_START));

	/* Create the sprite scaling table */
	m_scale_table = auto_alloc_array(machine(), UINT8, 64 * 64);

	for (i = 0; i < 64; ++i)
	{
		int j;

		for (j = 1; j < 65; ++j)
		{
			int p0 = 0;
			int p1 = 0;
			int p2 = 0;
			int p3 = 0;
			int p4 = 0;
			int p5 = 0;

			if (i & 0x1)
				p0 = BIT(j, 5) && !BIT(j, 4) && !BIT(j,3) && !BIT(j, 2) && !BIT(j, 1) && !BIT(j, 0);
			if (i & 0x2)
				p1 = BIT(j, 4) && !BIT(j, 3) && !BIT(j, 2) && !BIT(j, 1) && !BIT(j, 0);
			if (i & 0x4)
				p2 = BIT(j,3) && !BIT(j, 2) && !BIT(j, 1) && !BIT(j, 0);
			if (i & 0x8)
				p3 = BIT(j, 2) && !BIT(j,1) && !BIT(j,0);
			if (i & 0x10)
				p4 = BIT(j, 1) && !BIT(j, 0);
			if (i & 0x20)
				p5 = BIT(j, 0);

			m_scale_table[i * 64 + j - 1] = p0 | p1 | p2 | p3 | p4 | p5;
		}
	}

	/* Now create a lookup table for scaling the sprite 'fig' value */
	m_fig_scale_table = auto_alloc_array(machine(), UINT8, 1024 * 64);

	for (i = 0; i < 1024; ++i)
	{
		int scale;

		for (scale = 0; scale < 64; ++scale)
		{
			int input_pixels = i + 1;
			int scaled_pixels = 0;

			while (input_pixels)
			{
				if (m_scale_table[scale * 64 + (scaled_pixels & 0x3f)] == 0)
					input_pixels--;

				scaled_pixels++;
			}

			m_fig_scale_table[i * 64 + scale] = scaled_pixels - 1;
		}
	}

	/* Register stuff for state saving */
	save_pointer(NAME(line_buffer[0].colour_buf), 512);
	save_pointer(NAME(line_buffer[0].intensity_buf), 512);
	save_pointer(NAME(line_buffer[0].priority_buf), 512);

	save_pointer(NAME(line_buffer[1].colour_buf), 512);
	save_pointer(NAME(line_buffer[1].intensity_buf), 512);
	save_pointer(NAME(line_buffer[1].priority_buf), 512);

	save_item(NAME(m_video_firq));
	save_item(NAME(m_bg_intensity));
	save_item(NAME(m_hblank));
	save_item(NAME(m_video_firq_en));
	save_item(NAME(m_frame_vbl));
	save_item(NAME(m_12sel));
}
Beispiel #5
0
void cischeat_state::create_tilemaps()
{
	int layer, i;

	for (layer = 0; layer < 3; layer++)
	{
		/* 16x16 tilemaps */
		m_tilemap[layer][0][0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
									8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
		m_tilemap[layer][0][1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
									8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
		m_tilemap[layer][0][2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
									8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
		m_tilemap[layer][0][3] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
									8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);

		/* 8x8 tilemaps */
		m_tilemap[layer][1][0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
									8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
		m_tilemap[layer][1][1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
									8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
		m_tilemap[layer][1][2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
									8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
		m_tilemap[layer][1][3] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
									8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);

		/* set user data and transparency */
		for (i = 0; i < 8; i++)
		{
			m_tilemap[layer][i/4][i%4]->set_user_data((void *)(FPTR)layer);
			m_tilemap[layer][i/4][i%4]->set_transparent_pen(15);
		}
	}
}
Beispiel #6
0
void aic6250_device::map(address_map &map)
{
	map(0x0, 0x0).rw(FUNC(aic6250_device::dma_count_l_r), FUNC(aic6250_device::dma_count_l_w));
	map(0x1, 0x1).rw(FUNC(aic6250_device::dma_count_m_r), FUNC(aic6250_device::dma_count_m_w));
	map(0x2, 0x2).rw(FUNC(aic6250_device::dma_count_h_r), FUNC(aic6250_device::dma_count_h_w));
	map(0x3, 0x3).w(FUNC(aic6250_device::int_msk_reg_0_w));
	map(0x4, 0x4).w(FUNC(aic6250_device::offset_cntrl_w));
	map(0x5, 0x5).rw(FUNC(aic6250_device::fifo_status_r), FUNC(aic6250_device::dma_cntrl_w));
	map(0x6, 0x6).rw(FUNC(aic6250_device::rev_cntrl_r), FUNC(aic6250_device::int_msk_reg_1_w));
	map(0x7, 0x7).rw(FUNC(aic6250_device::status_reg_0_r), FUNC(aic6250_device::control_reg_0_w));
	map(0x8, 0x8).rw(FUNC(aic6250_device::status_reg_1_r), FUNC(aic6250_device::control_reg_1_w));
	map(0x9, 0x9).rw(FUNC(aic6250_device::scsi_signal_reg_r), FUNC(aic6250_device::scsi_signal_reg_w));
	map(0xa, 0xa).rw(FUNC(aic6250_device::scsi_id_data_r), FUNC(aic6250_device::scsi_id_data_w));
	map(0xb, 0xb).r(FUNC(aic6250_device::source_dest_id_r));
	map(0xc, 0xc).rw(FUNC(aic6250_device::memory_data_r), FUNC(aic6250_device::memory_data_w));
	map(0xd, 0xd).rw(FUNC(aic6250_device::port_a_r), FUNC(aic6250_device::port_a_w));
	map(0xe, 0xe).rw(FUNC(aic6250_device::port_b_r), FUNC(aic6250_device::port_b_w));
	map(0xf, 0xf).rw(FUNC(aic6250_device::scsi_latch_data_r), FUNC(aic6250_device::scsi_bsy_rst_w));
}
Beispiel #7
0
/******************************************************************/

void galastrm_state::galastrm_exit()
{
	poly_free(m_poly);
}

void galastrm_state::video_start()
{
	m_spritelist = auto_alloc_array(machine(), struct gs_tempsprite, 0x4000);

	m_screen->register_screen_bitmap(m_tmpbitmaps);
	m_screen->register_screen_bitmap(m_polybitmap);

	m_poly = poly_alloc(machine(), 16, sizeof(gs_poly_extra_data), POLYFLAG_ALLOW_QUADS);
	machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(galastrm_state::galastrm_exit), this));
}

/************************************************************
            SPRITE DRAW ROUTINES

We draw a series of small tiles ("chunks") together to
create each big sprite. The spritemap rom provides the lookup
table for this. The game hardware looks up 16x16 sprite chunks
from the spritemap rom, creating a 64x64 sprite like this:

     0  1  2  3
     4  5  6  7
     8  9 10 11
    12 13 14 15
Beispiel #8
0
    int quot, rem; \
} div_t; \
\
typedef struct { \
    int quot, rem; \
} ldiv_t; \
";
#endif

#define MIN_OPT_LEVEL 2
#include "rodefs.h"

/* all stdlib.h functions */
const PICOC_REG_TYPE StdlibFunctions[] = {
#ifndef NO_FP
    { FUNC(StdlibAtof),           PROTO("float atof(char *);") },
    { FUNC(StdlibStrtod),         PROTO("float strtod(char *,char **);") },
#endif
    { FUNC(StdlibAtoi),           PROTO("int atoi(char *);") },
    { FUNC(StdlibAtol),           PROTO("int atol(char *);") },
    { FUNC(StdlibStrtol),         PROTO("int strtol(char *,char **,int);") },
    { FUNC(StdlibStrtoul),        PROTO("int strtoul(char *,char **,int);") },
    { FUNC(StdlibMalloc),         PROTO("void *malloc(int);") },
    { FUNC(StdlibCalloc),         PROTO("void *calloc(int,int);") },
    { FUNC(StdlibRealloc),        PROTO("void *realloc(void *,int);") },
    { FUNC(StdlibFree),           PROTO("void free(void *);") },
    { FUNC(StdlibRand),           PROTO("int rand();") },
    { FUNC(StdlibSrand),          PROTO("void srand(int);") },
    { FUNC(StdlibAbort),          PROTO("void abort();") },
    { FUNC(StdlibExit),           PROTO("void exit(int);") },
    { FUNC(StdlibGetenv),         PROTO("char *getenv(char *);") },
Beispiel #9
0
	MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
	MCFG_SCREEN_UPDATE_DEVICE("crtc", sy6545_1_device, screen_update)
	MCFG_PALETTE_ADD_MONOCHROME("palette")
	MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_v6809)

	/* sound hardware */
	SPEAKER(config, "mono").front_center();
	MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
	MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)

	/* devices */
	SY6545_1(config, m_crtc, 16_MHz_XTAL / 8);
	m_crtc->set_screen("screen");
	m_crtc->set_show_border_area(false);
	m_crtc->set_char_width(8);
	m_crtc->set_update_row_callback(FUNC(v6809_state::crtc_update_row), this);
	m_crtc->set_on_update_addr_change_callback(FUNC(v6809_state::crtc_update_addr), this);

	generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
	keyboard.set_keyboard_callback(FUNC(v6809_state::kbd_put));

// port A = drive select and 2 control lines ; port B = keyboard
// CB2 connects to the interrupt pin of the RTC (the rtc code doesn't support it)
	PIA6821(config, m_pia0, 0);
	m_pia0->readpb_handler().set(FUNC(v6809_state::pb_r));
	m_pia0->writepa_handler().set(FUNC(v6809_state::pa_w));
	m_pia0->irqa_handler().set_inputline("maincpu", M6809_IRQ_LINE);
	m_pia0->irqb_handler().set_inputline("maincpu", M6809_IRQ_LINE);

// no idea what this does
	pia6821_device &pia1(PIA6821(config, "pia1", 0));
Beispiel #10
0
void sdl_osd_interface::init(running_machine &machine)
{
	// call our parent
	osd_interface::init(machine);

	sdl_options &options = downcast<sdl_options &>(machine.options());
	const char *stemp;

	// determine if we are benchmarking, and adjust options appropriately
	int bench = options.bench();
	astring error_string;
	if (bench > 0)
	{
		options.set_value(OPTION_THROTTLE, false, OPTION_PRIORITY_MAXIMUM, error_string);
		options.set_value(OPTION_SOUND, false, OPTION_PRIORITY_MAXIMUM, error_string);
		options.set_value(SDLOPTION_VIDEO, "none", OPTION_PRIORITY_MAXIMUM, error_string);
		options.set_value(OPTION_SECONDS_TO_RUN, bench, OPTION_PRIORITY_MAXIMUM, error_string);
		assert(!error_string);
	}

	// Some driver options - must be before audio init!
	stemp = options.audio_driver();
	if (stemp != NULL && strcmp(stemp, SDLOPTVAL_AUTO) != 0)
	{
		mame_printf_verbose("Setting SDL audiodriver '%s' ...\n", stemp);
		osd_setenv(SDLENV_AUDIODRIVER, stemp, 1);
	}

	stemp = options.video_driver();
	if (stemp != NULL && strcmp(stemp, SDLOPTVAL_AUTO) != 0)
	{
		mame_printf_verbose("Setting SDL videodriver '%s' ...\n", stemp);
		osd_setenv(SDLENV_VIDEODRIVER, stemp, 1);
	}

#if (SDLMAME_SDL2)
		stemp = options.render_driver();
		if (stemp != NULL && strcmp(stemp, SDLOPTVAL_AUTO) != 0)
		{
			mame_printf_verbose("Setting SDL renderdriver '%s' ...\n", stemp);
			//osd_setenv(SDLENV_RENDERDRIVER, stemp, 1);
			SDL_SetHint(SDL_HINT_RENDER_DRIVER, stemp);
		}
#endif

	/* Set the SDL environment variable for drivers wanting to load the
	 * lib at startup.
	 */
#if USE_OPENGL
	/* FIXME: move lib loading code from drawogl.c here */

	stemp = options.gl_lib();
	if (stemp != NULL && strcmp(stemp, SDLOPTVAL_AUTO) != 0)
	{
		osd_setenv("SDL_VIDEO_GL_DRIVER", stemp, 1);
		mame_printf_verbose("Setting SDL_VIDEO_GL_DRIVER = '%s' ...\n", stemp);
	}
#endif

	/* get number of processors */
	stemp = options.numprocessors();

	osd_num_processors = 0;

	if (strcmp(stemp, "auto") != 0)
	{
		osd_num_processors = atoi(stemp);
		if (osd_num_processors < 1)
		{
			mame_printf_warning("Warning: numprocessors < 1 doesn't make much sense. Assuming auto ...\n");
			osd_num_processors = 0;
		}
	}

	/* Initialize SDL */

	if (!SDLMAME_INIT_IN_WORKER_THREAD)
	{
#if (SDLMAME_SDL2)
		if (SDL_InitSubSystem(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) {
#else
		if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) {
#endif
			mame_printf_error("Could not initialize SDL %s\n", SDL_GetError());
			exit(-1);
		}
		osd_sdl_info();
	}
	// must be before sdlvideo_init!
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(osd_exit), &machine));

	defines_verbose();

	if (!SDLMAME_HAS_DEBUGGER)
		if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
		{
			mame_printf_error("sdlmame: -debug not supported on X11-less builds\n\n");
			osd_exit(machine);
			exit(-1);
		}

	if (sdlvideo_init(machine))
	{
		osd_exit(machine);
		mame_printf_error("sdlvideo_init: Initialization failed!\n\n\n");
		fflush(stderr);
		fflush(stdout);
		exit(-1);
	}

	sdlinput_init(machine);
	sdlaudio_init(machine);
	sdloutput_init(machine);

#ifdef SDLMAME_NETWORK
	sdlnetdev_init(machine);
#endif

	if (options.oslog())
		machine.add_logerror_callback(output_oslog);

	/* now setup watchdog */

	int watchdog_timeout = options.watchdog();
	int str = options.seconds_to_run();

	/* only enable watchdog if seconds_to_run is enabled *and* relatively short (time taken from ui.c) */
	if ((watchdog_timeout != 0) && (str > 0) && (str < 60*5 ))
	{
		m_watchdog = auto_alloc(machine, watchdog);
		m_watchdog->setTimeout(watchdog_timeout);
	}

#if (SDLMAME_SDL2)
	SDL_EventState(SDL_TEXTINPUT, SDL_TRUE);
#else
	SDL_EnableUNICODE(SDL_TRUE);
#endif
}

#if defined(SDLMAME_UNIX) && (!defined(SDLMAME_EMSCRIPTEN))
#define POINT_SIZE 144.0

#ifdef SDLMAME_MACOSX

#define EXTRA_HEIGHT 1.0
#define EXTRA_WIDTH 1.15

//-------------------------------------------------
//  font_open - attempt to "open" a handle to the
//  font with the given name
//-------------------------------------------------

osd_font sdl_osd_interface::font_open(const char *_name, int &height)
{
	CFStringRef font_name = NULL;
	CTFontRef ct_font = NULL;
	CTFontDescriptorRef font_descriptor;
	CGAffineTransform affine_transform = CGAffineTransformIdentity;

	astring name(_name);

	if (name == "default")
	{
		name = "LucidaGrande";
	}

	/* handle bdf fonts in the core */
	if (name.len() > 4)
		if (name.makeupper().substr(name.len()-4,4) == ".BDF" )
			return NULL;

	font_name = CFStringCreateWithCString( NULL, _name, kCFStringEncodingUTF8 );

	if( font_name != NULL )
	{
		font_descriptor = CTFontDescriptorCreateWithNameAndSize( font_name, POINT_SIZE );

		if( font_descriptor != NULL )
		{
			ct_font = CTFontCreateWithFontDescriptor( font_descriptor, POINT_SIZE, &affine_transform );

			CFRelease( font_descriptor );
		}
	}

	CFRelease( font_name );

	if (!ct_font)
	{
		printf("WARNING: Couldn't find/open font %s, using MAME default\n", name.cstr());
		return NULL;
	}

	CFStringRef real_name = CTFontCopyPostScriptName( ct_font );
	char real_name_c_string[255];
	CFStringGetCString ( real_name, real_name_c_string, 255, kCFStringEncodingUTF8 );
	mame_printf_verbose("Matching font: %s\n", real_name_c_string);
	CFRelease( real_name );

	CGFloat line_height = 0.0;
	line_height += CTFontGetAscent(ct_font);
	line_height += CTFontGetDescent(ct_font);
	line_height += CTFontGetLeading(ct_font);
	height = ceilf(line_height * EXTRA_HEIGHT);

	return (osd_font)ct_font;
}
Beispiel #11
0
void bsktball_state::video_start()
{
	m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bsktball_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
Beispiel #12
0
bool Cacheable::validate(Session *s)
{
	FUNC("Cacheable::validate()");
	
	// Return true if the object is already valid
	if (isValid())
		return true;
	
	// Set the mode to first search locally, then search remote
	s->setCacheMode(Session::LOCAL_THEN_REMOTE);
	
	// Construct the match info for this object's issuer
	acl::MatchInfo mi;
	getIssuerInfo(mi);
	
	// Find this object's issuer (clearance cert)
	CCList *pCCList = s->getCC(mi);
	if (pCCList == NULL)
    {
        char lpszBuf[2048];
        strcpy(lpszBuf, "Issuer not found");
        if (mi.getSubjectDN())
        {
            strcat(lpszBuf, ", ");
            strcat(lpszBuf, *mi.getSubjectDN());
        }
		throw ACL_EXCEPT(ACL_AC_VAL_ERROR, lpszBuf);
    }       // END IF pCCList (no issuer(s))
	
	// Create auto_ptr to automatically free the list
	std::auto_ptr<CCList> apCCList(pCCList);
	
	// If more than one issuer is returned, throw an exception
	if (pCCList->size() > 1)
    {
		char errorBuf[1024];
        strcpy(errorBuf, "Multiple issuers found");
        if (mi.getSubjectDN())
        {
            strcat(errorBuf, ", ");
            strcat(errorBuf, *mi.getSubjectDN());
        }
		throw ACL_EXCEPT(ACL_AC_VAL_ERROR, errorBuf);
    }
	
	// Validate the issuer's clearance cert
	CML::ValidatedKey validKey;
    CML::ErrorInfoList Errors;

	CML::CertPath certPath(pCCList->front().getEncodedCC(), false);
	short cml_status = certPath.BuildAndValidate(s->getCMLHandle(),
        CM_SEARCH_UNTIL_FOUND, &Errors, 0, &validKey);
	if (cml_status != CM_NO_ERROR)
	{
		char errorBuf[1024];
		sprintf(errorBuf, "Issuer failed to validate: CML error %d: %s",
			cml_status, CMU_GetErrorString(cml_status));
        if (mi.getSubjectDN())
        {
            strcat(errorBuf, ", ");
            strcat(errorBuf, *mi.getSubjectDN());
        }
		throw ACL_EXCEPT(ACL_VAL_ERROR, errorBuf);
	}
	
	// Perform any object specific path validation logic first
	vPathRules(s, certPath.base());
	
	// Validate the object
	return validate(s, validKey.pubKeyInfo());
}
Beispiel #13
0
				if (phoneme == 0x03 || phoneme == 0x3e) strcat(phonemes," ");
				else strcat(phonemes,PhonemeTable[phoneme]);
			}

			mame_printf_debug("Votrax played '%s'\n", phonemes);
			play_sample(samples, phonemes);
#if 0
			popmessage("%s", phonemes);
#endif
		}

		state->m_votrax_queuepos = 0;
	}

	/* generate a NMI after a while to make the CPU continue to send data */
	space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(gottlieb_nmi_generate));
}

static WRITE8_HANDLER( speech_clock_dac_w )
{
	gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
if (data != state->m_last)
	mame_printf_debug("clock = %02X\n", data);
state->m_last = data;
}


/*************************************
 *
 *  Rev 1. initialization
 *
Beispiel #14
0
void konendev_state::konendev_map(address_map &map)
{
	map(0x00000000, 0x00ffffff).ram();
	map(0x78000000, 0x78000003).r(FUNC(konendev_state::mcu2_r));
	map(0x78080000, 0x7808000f).rw(FUNC(konendev_state::rtc_r), FUNC(konendev_state::rtc_w));
	map(0x780c0000, 0x780c0003).rw(FUNC(konendev_state::sound_data_r), FUNC(konendev_state::sound_data_w));
	map(0x78100000, 0x78100003).w(FUNC(konendev_state::eeprom_w));
	map(0x78800000, 0x78800003).r(FUNC(konendev_state::ifu2_r));
	map(0x78800004, 0x78800007).r(FUNC(konendev_state::ctrl0_r));
	map(0x78a00000, 0x78a0001f).r(FUNC(konendev_state::ctrl1_r));
	map(0x78e00000, 0x78e00003).r(FUNC(konendev_state::ctrl2_r));
	map(0x79000000, 0x79000003).w(m_gcu, FUNC(k057714_device::fifo_w));
	map(0x79800000, 0x798000ff).rw(m_gcu, FUNC(k057714_device::read), FUNC(k057714_device::write));
	map(0x7a000000, 0x7a01ffff).ram().share("nvram0");
	map(0x7a100000, 0x7a11ffff).ram().share("nvram1");
	map(0x7e000000, 0x7f7fffff).rom().region("flash", 0);
	map(0x7ff00000, 0x7fffffff).rom().region("program", 0);
}
Beispiel #15
0
void good_state::video_start()
{
	m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(good_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
	m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(good_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
	m_fg_tilemap->set_transparent_pen(0xf);
}
Beispiel #16
0
void v6809_state::v6809_mem(address_map &map)
{
	map.unmap_value_high();
	map(0x0000, 0xefff).ram();
	map(0xf000, 0xf000).mirror(0xfe).r(m_crtc, FUNC(mc6845_device::status_r)).w(FUNC(v6809_state::v6809_address_w));
	map(0xf001, 0xf001).mirror(0xfe).r(m_crtc, FUNC(mc6845_device::register_r)).w(FUNC(v6809_state::v6809_register_w));
	map(0xf200, 0xf200).mirror(0xff).w(FUNC(v6809_state::videoram_w));
	map(0xf500, 0xf501).mirror(0x36).rw("acia0", FUNC(acia6850_device::read), FUNC(acia6850_device::write)); // modem
	map(0xf508, 0xf509).mirror(0x36).rw("acia1", FUNC(acia6850_device::read), FUNC(acia6850_device::write)); // printer
	map(0xf600, 0xf603).mirror(0x3c).rw(m_fdc, FUNC(mb8876_device::read), FUNC(mb8876_device::write));
	map(0xf640, 0xf64f).mirror(0x30).rw("rtc", FUNC(mm58274c_device::read), FUNC(mm58274c_device::write));
	map(0xf680, 0xf683).mirror(0x3c).rw(m_pia0, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
	map(0xf6c0, 0xf6c7).mirror(0x08).rw("ptm", FUNC(ptm6840_device::read), FUNC(ptm6840_device::write));
	map(0xf6d0, 0xf6d3).mirror(0x0c).rw("pia1", FUNC(pia6821_device::read), FUNC(pia6821_device::write));
	map(0xf800, 0xffff).rom();
}
Beispiel #17
0
DRIVER_INIT_MEMBER(exprraid_state,wexpressb3)
{
	m_maincpu->space(AS_PROGRAM).install_read_handler(0xFFC0, 0xFFC0, read8_delegate(FUNC(exprraid_state::vblank_r),this));
	exprraid_gfx_expand();
}
Beispiel #18
0
void triplhnt_state::video_start()
{
	m_screen->register_screen_bitmap(m_helper);

	m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(triplhnt_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
}
Beispiel #19
0
void allied_state::allied_map(address_map &map)
{
	map(0x0000, 0x003f).ram(); // ic6
	map(0x0044, 0x0047).rw(m_ic2, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
	map(0x0048, 0x004b).rw(m_ic1, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
	map(0x0050, 0x0053).rw(m_ic7, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
	map(0x0060, 0x0063).rw(m_ic4, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
	map(0x0080, 0x008f).rw(m_ic5, FUNC(mos6530_device::read), FUNC(mos6530_device::write));
	map(0x0840, 0x084f).rw(m_ic6, FUNC(mos6530_device::read), FUNC(mos6530_device::write));
	map(0x00c0, 0x00c3).rw(m_ic8, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
	map(0x0100, 0x013f).ram(); // ic5
	map(0x1400, 0x1fff).rom();
}
Beispiel #20
0
int
listener::auth(int client_sock, 
	uid_t 		*uid_out, 
	gid_t 		*gid_out, 
	char 		*complete_name, int namelen
#ifdef USE_KRB
	,
	unsigned long ttime, // time ticket issued
	C_Block		*sessionkey
#endif
)
{
	FUNC(listener::auth);
	c_uid_t 			uid;
	int				remoteness=::same_process;


#ifdef DEBUG
	dumpaddrs(client_sock, "listener::run");
#endif
	(void) max_sock_opt(client_sock, SO_RCVBUF);

	get_remoteness(client_sock, remoteness);

#ifdef USE_KRB
	{
	// KERBEROS AUTHENTICATION
	/* specific to RPC 4.0 */ /* grot */
	int             krb_status;
	KTEXT_ST        ticket;
	AUTH_DAT        auth_data;
	char			version[20];
	Key_schedule    sched;
	INSTANCE		inst;
	struct sockaddr_in peer, me;

	// instance = '*' means authenticator will fill it in.
	memset(inst, '\0', sizeof(inst)); 
	inst[0] = '*';

#	ifdef MUTUAL
#	define kopt	KOPT_DO_MUTUAL
#	else
#	define kopt	0
#	endif

	krb_status = krb_recvauth(kopt, client_sock,
		&ticket, "rcmd", inst, &peer, &me, &auth_data,
		"" /* use /etc/srvtab */,  sched, version);

	if(krb_status != KSUCCESS) {
		ShoreVasLayer.client_service->log->log(log_error, 
		 "Kerberos error %s ", (char *)krb_err_txt[krb_status]);
		return ::error_remoteness;
	}

	// who's it from?
	uid = (c_uid_t) SVAS_OK;

	if (krb_kntoln(&auth_data, complete_name) != KSUCCESS) {
		strcpy(complete_name, "*No local name returned by krb_kntoln*");
		ShoreVasLayer.client_service->log->log(log_error, 
		 "Kerberos error %s ", (char *)krb_err_txt[krb_status]);
		return ::error_remoteness;
	}

#	ifdef DEBUG
	// print the info filled in by krb
	DBG(
		<< "KRB connect: version " << version  << "client krb-connect OK"
	)
#	endif 

	dassert(strcmp(auth_data.pname,complete_name)==0);
	}
	ttime = auth_data.time_sec, 
	*sessionkey = auth_data.session;
#else
	// NO KERBEROS: just read name and return uid
	{
		int cc; 

		if( (cc = ::read(client_sock, complete_name, namelen)) <0) {
			// TODO: Shouldn't this use log instead of perror?
			perror("read login complete_name");
			return ::error_remoteness;
		}
		complete_name[cc]='\0';
	}
#endif /* NO KERBEROS */

	{
		*uid_out = uid = uname2uid(complete_name, gid_out);
		if(uid==BAD_UID) {
			DBG(<<"NO SUCH USER!");
			ShoreVasLayer.client_service->
				log->log(log_error, "Authentication error: no such user: %s", complete_name);
			
			return ::error_remoteness;
		}
	}
Beispiel #21
0
void  model1io_device::device_add_mconfig(machine_config &config)
{
	z80_device &iocpu(Z80(config, "iocpu", 32_MHz_XTAL/8));
	iocpu.set_addrmap(AS_PROGRAM, &model1io_device::mem_map);

	EEPROM_93C46_16BIT(config, m_eeprom); // 93C45

	sega_315_5338a_device &io(SEGA_315_5338A(config, "io", 32_MHz_XTAL));
	io.read_callback().set(FUNC(model1io_device::io_r));
	io.write_callback().set(FUNC(model1io_device::io_w));
	io.out_pa_callback().set(FUNC(model1io_device::io_pa_w));
	io.in_pb_callback().set(FUNC(model1io_device::io_pb_r));
	io.in_pc_callback().set(FUNC(model1io_device::io_pc_r));
	io.in_pd_callback().set(FUNC(model1io_device::io_pd_r));
	io.in_pe_callback().set(FUNC(model1io_device::io_pe_r));
	io.out_pe_callback().set(FUNC(model1io_device::io_pe_w));
	io.out_pf_callback().set(FUNC(model1io_device::io_pf_w));
	io.in_pg_callback().set(FUNC(model1io_device::io_pg_r));

	msm6253_device &adc(MSM6253(config, "adc", 0));
	adc.set_input_cb<0>(FUNC(model1io_device::analog0_r));
	adc.set_input_cb<1>(FUNC(model1io_device::analog1_r));
	adc.set_input_cb<2>(FUNC(model1io_device::analog2_r));
	adc.set_input_cb<3>(FUNC(model1io_device::analog3_r));
}
Beispiel #22
0
video_manager::video_manager(running_machine &machine)
	: m_machine(machine),
	  m_screenless_frame_timer(NULL),
	  m_throttle_last_ticks(0),
	  m_throttle_realtime(attotime::zero),
	  m_throttle_emutime(attotime::zero),
	  m_throttle_history(0),
	  m_speed_last_realtime(0),
	  m_speed_last_emutime(attotime::zero),
	  m_speed_percent(1.0),
	  m_overall_real_seconds(0),
	  m_overall_real_ticks(0),
	  m_overall_emutime(attotime::zero),
	  m_overall_valid_counter(0),
	  m_throttle(machine.options().throttle()),
	  m_fastforward(false),
	  m_seconds_to_run(machine.options().seconds_to_run()),
	  m_auto_frameskip(machine.options().auto_frameskip()),
	  m_speed(original_speed_setting()),
	  m_empty_skip_count(0),
	  m_frameskip_level(machine.options().frameskip()),
	  m_frameskip_counter(0),
	  m_frameskip_adjust(0),
	  m_skipping_this_frame(false),
	  m_average_oversleep(0),
	  m_snap_target(NULL),
	  m_snap_bitmap(NULL),
	  m_snap_native(true),
	  m_snap_width(0),
	  m_snap_height(0),
	  m_mngfile(NULL),
	  m_avifile(NULL),
	  m_movie_frame_period(attotime::zero),
	  m_movie_next_frame_time(attotime::zero),
	  m_movie_frame(0)
{
	// request a callback upon exiting
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(video_manager::exit), this));
	machine.save().register_postload(save_prepost_delegate(FUNC(video_manager::postload), this));

	// extract initial execution state from global configuration settings
	update_refresh_speed();

	// create a render target for snapshots
	const char *viewname = machine.options().snap_view();
	m_snap_native = (machine.primary_screen != NULL && (viewname[0] == 0 || strcmp(viewname, "native") == 0));

	// the native target is hard-coded to our internal layout and has all options disabled
	if (m_snap_native)
	{
		m_snap_target = machine.render().target_alloc(layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
		m_snap_target->set_backdrops_enabled(false);
		m_snap_target->set_overlays_enabled(false);
		m_snap_target->set_bezels_enabled(false);
		m_snap_target->set_cpanels_enabled(false);
		m_snap_target->set_marquees_enabled(false);
		m_snap_target->set_screen_overlay_enabled(false);
		m_snap_target->set_zoom_to_screen(false);
	}

	// other targets select the specified view and turn off effects
	else
	{
		m_snap_target = machine.render().target_alloc(NULL, RENDER_CREATE_HIDDEN);
		m_snap_target->set_view(m_snap_target->configured_view(viewname, 0, 1));
		m_snap_target->set_screen_overlay_enabled(false);
	}

	// extract snap resolution if present
	if (sscanf(machine.options().snap_size(), "%dx%d", &m_snap_width, &m_snap_height) != 2)
		m_snap_width = m_snap_height = 0;

	// start recording movie if specified
	const char *filename = machine.options().mng_write();
	if (filename[0] != 0)
		begin_recording(filename, MF_MNG);

	filename = machine.options().avi_write();
	if (filename[0] != 0)
		begin_recording(filename, MF_AVI);

	// if no screens, create a periodic timer to drive updates
	if (machine.primary_screen == NULL)
	{
		m_screenless_frame_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(video_manager::screenless_update_callback), this));
		m_screenless_frame_timer->adjust(screen_device::DEFAULT_FRAME_PERIOD, 0, screen_device::DEFAULT_FRAME_PERIOD);
	}
}
Beispiel #23
0
void chanbara_state::video_start()
{
	m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(chanbara_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,8, 8, 32, 32);
	m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(chanbara_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS,16, 16, 16, 32);
	m_bg_tilemap->set_transparent_pen(0);
}
Beispiel #24
0
void aquarius_state::video_start()
{
	m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(aquarius_state::aquarius_gettileinfo),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25);
}
Beispiel #25
0
static void vendetta_video_banking( running_machine &machine, int select )
{
	vendetta_state *state = machine.driver_data<vendetta_state>();
	address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);

	if (select & 1)
	{
		space.install_read_bank(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, "bank4" );
		space.install_write_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, write8_delegate(FUNC(vendetta_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state) );
		space.install_legacy_readwrite_handler(*state->m_k053246, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k053247_r), FUNC(k053247_w) );
		state->membank("bank4")->set_base(state->m_generic_paletteram_8);
	}
	else
	{
		space.install_readwrite_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, read8_delegate(FUNC(vendetta_state::vendetta_K052109_r),state), write8_delegate(FUNC(vendetta_state::vendetta_K052109_w),state) );
		space.install_legacy_readwrite_handler(*state->m_k052109, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k052109_r), FUNC(k052109_w) );
	}
}
Beispiel #26
0
void neogeo_state::create_interrupt_timers()
{
    m_display_position_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::display_position_interrupt_callback),this));
    m_display_position_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::display_position_vblank_callback),this));
    m_vblank_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::vblank_interrupt_callback),this));
}
Beispiel #27
0
void bwidow_state::bwidowp_map(address_map &map)
{
	map(0x0000, 0x07ff).ram();
	map(0x0800, 0x080f).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write));
	map(0x0810, 0x081f).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write));
	map(0x1000, 0x1000).r(FUNC(bwidow_state::bwidowp_in_r));
	map(0x1800, 0x1800).portr("IN0");
	map(0x2000, 0x2000).w("avg", FUNC(avg_device::go_w));
	map(0x2800, 0x2800).w("avg", FUNC(avg_device::reset_w));
	map(0x3000, 0x3000).w("watchdog", FUNC(watchdog_timer_device::reset_w));
	map(0x3800, 0x3800).w(FUNC(bwidow_state::bwidow_misc_w)); /* coin counters, leds */
	map(0x4000, 0x47ff).ram().share("vectorram").region("maincpu", 0x4000);
	map(0x4800, 0x6fff).rom();
	map(0x6000, 0x6000).w(FUNC(bwidow_state::irq_ack_w)); /* interrupt acknowledge */
	map(0x8000, 0x803f).w(FUNC(bwidow_state::earom_write));
	map(0x8800, 0x8800).w(FUNC(bwidow_state::earom_control_w));
	map(0x9000, 0x9000).r(FUNC(bwidow_state::earom_read));
	map(0x9800, 0x9800).nopw(); /* ? written once at startup */
	map(0xa000, 0xffff).rom();
}
Beispiel #28
0
void calorie_state::calorie_sound_map(address_map &map)
{
	map(0x0000, 0x3fff).rom();
	map(0x8000, 0x87ff).ram();
	map(0xc000, 0xc000).r(FUNC(calorie_state::calorie_soundlatch_r));
}
Beispiel #29
0
void ddealer_state::video_start()
{
	m_flipscreen = 0;
	m_back_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ddealer_state::get_back_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
}
Beispiel #30
0
void gstriker_state::mcu_init()
{
    m_dmmy_8f_ret = 0xFFFF;
    m_pending_command = 0;
    m_mcu_data = 0;

    m_maincpu->space(AS_PROGRAM).install_write_handler(0x20008a, 0x20008b, write16_delegate(FUNC(gstriker_state::twrldc94_mcu_w),this));
    m_maincpu->space(AS_PROGRAM).install_read_handler(0x20008a, 0x20008b, read16_delegate(FUNC(gstriker_state::twrldc94_mcu_r),this));

    m_maincpu->space(AS_PROGRAM).install_write_handler(0x20008e, 0x20008f, write16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_w),this));
    m_maincpu->space(AS_PROGRAM).install_read_handler(0x20008e, 0x20008f, read16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_r),this));

    save_item(NAME(m_mcu_data));
    save_item(NAME(m_prot_reg));
}