예제 #1
0
파일: tms9927.c 프로젝트: nitrologic/emu
static void generic_access(const device_config *device, offs_t offset)
{
	tms9927_state *tms = get_safe_token(device);

	switch (offset)
	{
		case 0x07:	/* Processor Self Load */
		case 0x0f:	/* Non-processor self-load */
			if (tms->selfload != NULL)
			{
				int cur;

				for (cur = 0; cur < 7; cur++)
					tms9927_w(device, cur, tms->selfload[cur]);
				for (cur = 0; cur < 1; cur++)
					tms9927_w(device, cur + 0xc, tms->selfload[cur + 7]);
			}
			else
				popmessage("tms9927: self-load initiated with no PROM!");

			/* processor self-load waits with reset enabled;
               non-processor just goes ahead */
			tms->reset = (offset == 0x07);
			break;

		case 0x0a:	/* Reset */
			if (!tms->reset)
			{
				video_screen_update_now(tms->screen);
				tms->reset = TRUE;
			}
			break;

		case 0x0b:	/* Up scroll */
mame_printf_debug("Up scroll\n");
			video_screen_update_now(tms->screen);
			tms->start_datarow = (tms->start_datarow + 1) % DATA_ROWS_PER_FRAME(tms);
			break;

		case 0x0e:	/* Start timing chain */
			if (tms->reset)
			{
				video_screen_update_now(tms->screen);
				tms->reset = FALSE;
				recompute_parameters(tms, FALSE);
			}
			break;
	}
}
예제 #2
0
static WRITE8_HANDLER( palette_w )
{
	int co;

	video_screen_update_now(space->machine->primary_screen);
	data &= 0x0f;

	co = ((ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
	ram_palette[co] = data;

}
예제 #3
0
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
	int scanline = param;

	/* update the video */
	video_screen_update_now(timer->machine->primary_screen);

	/* on scanline zero, clear any halt condition */
	if (scanline == 0)
		cputag_set_input_line(timer->machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE);

	/* wrap around at 262 */
	scanline++;
	if (scanline >= MAX_SCANLINES)
		scanline = 0;

	/* set the scanline IRQ */
	irq_state[2] = 1;
	update_interrupts(timer->machine);

	/* set the timer for the next one */
	timer_device_adjust_oneshot(timer, double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(timer->machine->primary_screen, scanline, 0)) - hblank_offset), scanline);
}
예제 #4
0
static WRITE_LINE_DEVICE_HANDLER(hsync_changed)
{
	/* update any video up to the current scanline */
	video_screen_update_now(device->machine->primary_screen);
}