Example #1
0
static INTERRUPT_GEN( m107_raster_interrupt )
{
	int line = 256 - cpu_getiloops();

	if (code_pressed_memory(KEYCODE_F1)) {
		raster_enable ^= 1;
		if (raster_enable)
			popmessage("Raster IRQ enabled");
		else
			popmessage("Raster IRQ disabled");
	}

	/* Raster interrupt */
	if (raster_enable && line==m107_raster_irq_position) {
		video_screen_update_partial(0, line);
		cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_2);
	}

	/* Kludge to get Fire Barrel running */
	else if (line==118)
	{
		cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_3);
	}

	/* Redraw screen, then set vblank and trigger the VBL interrupt */
	else if (line==248) {
		video_screen_update_partial(0, 248);
		m107_vblank=1;
		cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_0);
	}

	/* End of vblank */
	else if (line==255)
		m107_vblank=0;
}
Example #2
0
void slapfght_log_vram(void)
{
	if ( code_pressed_memory(KEYCODE_B) )
	{
		int i;
		for (i=0; i<0x800; i++)
		{
			logerror("Offset:%03x   TileRAM:%02x   AttribRAM:%02x   SpriteRAM:%02x\n",i, videoram[i],colorram[i],spriteram[i]);
		}
	}
}
Example #3
0
InputCode code_read_async(void)
{
	unsigned i;

	profiler_mark(PROFILER_INPUT);

	/* update the table */
	internal_code_update();

	for(i=0;i<code_mac;++i)
		if (code_pressed_memory(i))
			return i;

	profiler_mark(PROFILER_END);

	return CODE_NONE;
}
Example #4
0
static INTERRUPT_GEN( m107_raster_interrupt )
{
	static int last_line=0;
	int line = 256 - cpu_getiloops();

	if (code_pressed_memory(KEYCODE_F1)) {
		raster_enable ^= 1;
		if (raster_enable)
			usrintf_showmessage("Raster IRQ enabled");
		else
			usrintf_showmessage("Raster IRQ disabled");
	}

	/* Raster interrupt */
	if (raster_enable && line==m107_raster_irq_position) {
		if (osd_skip_this_frame()==0)
			m107_vh_raster_partial_refresh(Machine->scrbitmap,last_line,line);
		last_line=line+1;

		cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_2);
	}

	/* Kludge to get Fire Barrel running */
	else if (line==118)
	{
		cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_3);
	}

	/* Redraw screen, then set vblank and trigger the VBL interrupt */
	else if (line==248) {
		if (osd_skip_this_frame()==0)
			m107_vh_raster_partial_refresh(Machine->scrbitmap,last_line,248);
		last_line=0;
		m107_vblank=1;
		cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_0);
	}

	/* End of vblank */
	else if (line==255)
		m107_vblank=0;
}
Example #5
0
/* returns the numerical value of a typed hex digit, or -1 if none */
INT8 code_read_hex_async(void)
{
	unsigned i;

	profiler_mark(PROFILER_INPUT);

	/* update the table */
	internal_code_update();

	for(i=0;i<code_mac;++i)
		if (code_pressed_memory(i))
		{
			if ((i >= KEYCODE_A) && (i <= KEYCODE_F))
				return i - KEYCODE_A + 10;
			else if ((i >= KEYCODE_0) && (i <= KEYCODE_9))
				return i - KEYCODE_0;
			else
				return -1;
		}

	profiler_mark(PROFILER_END);

	return -1;
}