Exemple #1
0
void pang_gfxctrl_w(int offset, int data)
{
if (errorlog) fprintf(errorlog,"PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(),data);
{
	char baf[40];
	sprintf(baf,"%02x",data);
//	usrintf_showmessage(baf);
}

	/* bit 0 is unknown (used, maybe back color enable?) */

	/* bit 1 is coin counter */
	coin_counter_w(0,data & 2);

	/* bit 2 is flip screen */
	if (flipscreen != (data & 0x04))
	{
		flipscreen = data & 0x04;
		tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
	}

	/* bit 3 is unknown (used, e.g. marukin pulses it on the title screen) */

	/* bit 4 selects OKI M6295 bank */
	OKIM6295_set_bank_base(0, ALL_VOICES, (data & 0x10) ? 0x40000 : 0x00000);

	/* bit 5 is palette RAM bank selector (doesn't apply to mgakuen) */
	paletteram_bank = data & 0x20;

	/* bits 6 and 7 are unknown, used in several places. At first I thought */
	/* they were bg and sprites enable, but this screws up spang (screen flickers */
	/* every time you pop a bubble). However, not using them as enable bits screws */
	/* up marukin - you can see partially built up screens during attract mode. */
}
Exemple #2
0
static void updateflip(void)
{
	int min_x,max_x,min_y,max_y;

	tilemap_set_flip(ALL_TILEMAPS,(TILEMAP_FLIPX & flip_screen_x) | (TILEMAP_FLIPY & flip_screen_y));

	min_x = Machine->drv->default_visible_area.min_x;
	max_x = Machine->drv->default_visible_area.max_x;
	min_y = Machine->drv->default_visible_area.min_y;
	max_y = Machine->drv->default_visible_area.max_y;

	if (flip_screen_x)
	{
		int temp;

		temp = Machine->drv->screen_width - min_x - 1;
		min_x = Machine->drv->screen_width - max_x - 1;
		max_x = temp;
	}
	if (flip_screen_y)
	{
		int temp;

		temp = Machine->drv->screen_height - min_y - 1;
		min_y = Machine->drv->screen_height - max_y - 1;
		max_y = temp;
	}

	set_visible_area(min_x,max_x,min_y,max_y);
}
Exemple #3
0
static void namcos1_set_flipscreen(int flip)
{
	int i;

	int pos_x[] = {0x0b0,0x0b2,0x0b3,0x0b4};
	int pos_y[] = {0x108,0x108,0x108,0x008};
	int neg_x[] = {0x1d0,0x1d2,0x1d3,0x1d4};
	int neg_y[] = {0x1e8,0x1e8,0x1e8,0x0e8};

	flipscreen = flip;
	if(!flip)
	{
		for ( i = 0; i < 4; i++ ) {
			scrolloffsX[i] = pos_x[i];
			scrolloffsY[i] = pos_y[i];
		}
	}
	else
	{
		for ( i = 0; i < 4; i++ ) {
			scrolloffsX[i] = neg_x[i];
			scrolloffsY[i] = neg_y[i];
		}
	}
	tilemap_set_flip(ALL_TILEMAPS,flipscreen ? TILEMAP_FLIPX|TILEMAP_FLIPY : 0);
}
Exemple #4
0
void cave_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int pri;
	int layers_ctrl = -1;

	int	glob_flipx	=	READ_WORD(&cave_videoregs[0]) & 0x8000;
	int	glob_flipy	=	READ_WORD(&cave_videoregs[2]) & 0x8000;

	tilemap_set_flip(ALL_TILEMAPS, (glob_flipx ? TILEMAP_FLIPX : 0) | (glob_flipy ? TILEMAP_FLIPY : 0) );

	tilemap_set_enable( tilemap_0, READ_WORD(&cave_vctrl_0[4]) & 1 );
	tilemap_set_scrollx(tilemap_0, 0, READ_WORD(&cave_vctrl_0[0]) );
	tilemap_set_scrolly(tilemap_0, 0, READ_WORD(&cave_vctrl_0[2]) );

	if (tilemap_1)
	{
		tilemap_set_enable( tilemap_1, READ_WORD(&cave_vctrl_1[4]) & 1 );
		tilemap_set_scrollx(tilemap_1, 0, READ_WORD(&cave_vctrl_1[0]) );
		tilemap_set_scrolly(tilemap_1, 0, READ_WORD(&cave_vctrl_1[2]) );
	}

	if (tilemap_2)
	{
		tilemap_set_enable( tilemap_2, READ_WORD(&cave_vctrl_2[4]) & 1 );
		tilemap_set_scrollx(tilemap_2, 0, READ_WORD(&cave_vctrl_2[0]) );
		tilemap_set_scrolly(tilemap_2, 0, READ_WORD(&cave_vctrl_2[2]) );
	}

	tilemap_update(ALL_TILEMAPS);

	palette_init_used_colors();

	get_sprite_info();

	sprite_update();

	if (palette_recalc())	tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);

	/* Clear the background if at least one of layer 0's tile priorities
	   is lacking */

	if ((layers_ctrl & 0xf) != 0xf)	osd_clearbitmap(Machine->scrbitmap);

	/* Pen 0 of layer 0's tiles (any priority) goes below anything else */

	for ( pri = 0; pri < 4; pri++ )
		if ((layers_ctrl&(1<<(pri+0)))&&tilemap_0)	tilemap_draw(bitmap, tilemap_0, TILEMAP_IGNORE_TRANSPARENCY | pri);

	/* Draw the rest with transparency */

	for ( pri = 0; pri < 4; pri++ )
	{
		if ((layers_ctrl&(1<<(pri+12))))			sprite_draw(sprite_list, pri);
		if ((layers_ctrl&(1<<(pri+0)))&&tilemap_0)	tilemap_draw(bitmap, tilemap_0, pri);
		if ((layers_ctrl&(1<<(pri+4)))&&tilemap_1)	tilemap_draw(bitmap, tilemap_1, pri);
		if ((layers_ctrl&(1<<(pri+8)))&&tilemap_2)	tilemap_draw(bitmap, tilemap_2, pri);
	}
}
Exemple #5
0
static WRITE8_HANDLER( pacland_flipscreen_w )
{
	int bit = !BIT(offset,11);
	/* can't use flip_screen_set() because the visible area is asymmetrical */
	flip_screen = bit;
	tilemap_set_flip(ALL_TILEMAPS,flip_screen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
Exemple #6
0
void karnov_flipscreen_w(int data)
{
	static int last_flip;
	flipscreen=data;
	if (flipscreen!=last_flip)
		memset(dirty_f,1,0x800);
	last_flip=flipscreen;
	tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
Exemple #7
0
void raiden_control_w(int offset, int data)
{
	/* All other bits unknown - could be playfield enables */

	/* Flipscreen */
	if (offset==6) {
		flipscreen=data&0x2;
		tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
	}
}
Exemple #8
0
static void taitob_video_control (unsigned char data)
{
#if 0
	if (data != video_control)
		usrintf_showmessage("video control = %02x",data);
#endif

	video_control = data;

	if (video_control & 0x80)
		framebuffer_page = (~video_control & 0x40) >> 6;

	tilemap_set_flip(ALL_TILEMAPS, (video_control & 0x10) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0 );
}
Exemple #9
0
void twincobr_flipscreen(int flip)
{
	tilemap_set_flip(ALL_TILEMAPS, (flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0));
	twincobr_flip_screen = flip;
	if (flip) {
		scroll_x = -58;
		scroll_y = -29;
		if (toaplan_main_cpu == 1) scroll_y += 256;		/* Wardner */
	}
	else {
		scroll_x = 55;
		scroll_y = 30;
	}
}
Exemple #10
0
static void draw_edges(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
{
	madalien_state *state = machine->driver_data<madalien_state>();
	rectangle clip_edge1;
	rectangle clip_edge2;

	clip_edge1 = *cliprect;
	clip_edge2 = *cliprect;

	if (flip)
	{
		clip_edge1.min_y = *state->edge1_pos | 0x80;
		clip_edge2.max_y = (*state->edge2_pos & 0x7f) ^ 0x7f;
	}
	else
	{
		clip_edge1.max_y = (*state->edge1_pos & 0x7f) ^ 0x7f;
		clip_edge2.min_y = *state->edge2_pos | 0x80;
	}

	sect_rect(&clip_edge1, cliprect);
	sect_rect(&clip_edge2, cliprect);

	tilemap_mark_all_tiles_dirty(state->tilemap_edge1[scroll_mode]);
	tilemap_mark_all_tiles_dirty(state->tilemap_edge2[scroll_mode]);

	tilemap_set_flip(state->tilemap_edge1[scroll_mode], flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
	tilemap_set_scrollx(state->tilemap_edge1[scroll_mode], 0, -(*state->scroll & 0xfc));
	tilemap_set_scrolly(state->tilemap_edge1[scroll_mode], 0, *state->edge1_pos & 0x7f);

	tilemap_set_flip(state->tilemap_edge2[scroll_mode], flip ? TILEMAP_FLIPX : TILEMAP_FLIPY);
	tilemap_set_scrollx(state->tilemap_edge2[scroll_mode], 0, -(*state->scroll & 0xfc));
	tilemap_set_scrolly(state->tilemap_edge2[scroll_mode], 0, *state->edge2_pos & 0x7f);

	tilemap_draw(bitmap, &clip_edge1, state->tilemap_edge1[scroll_mode], 0, 0);
	tilemap_draw(bitmap, &clip_edge2, state->tilemap_edge2[scroll_mode], 0, 0);
}
Exemple #11
0
static void draw_edges(bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
{
	rectangle clip_edge1;
	rectangle clip_edge2;

	clip_edge1 = *cliprect;
	clip_edge2 = *cliprect;

	if (flip)
	{
		clip_edge1.min_y = *madalien_edge1_pos | 0x80;
		clip_edge2.max_y = (*madalien_edge2_pos & 0x7f) ^ 0x7f;
	}
	else
	{
		clip_edge1.max_y = (*madalien_edge1_pos & 0x7f) ^ 0x7f;
		clip_edge2.min_y = *madalien_edge2_pos | 0x80;
	}

	sect_rect(&clip_edge1, cliprect);
	sect_rect(&clip_edge2, cliprect);

	tilemap_mark_all_tiles_dirty(tilemap_edge1[scroll_mode]);
	tilemap_mark_all_tiles_dirty(tilemap_edge2[scroll_mode]);

	tilemap_set_flip(tilemap_edge1[scroll_mode], flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
	tilemap_set_scrollx(tilemap_edge1[scroll_mode], 0, -(*madalien_scroll & 0xfc));
	tilemap_set_scrolly(tilemap_edge1[scroll_mode], 0, *madalien_edge1_pos & 0x7f);

	tilemap_set_flip(tilemap_edge2[scroll_mode], flip ? TILEMAP_FLIPX : TILEMAP_FLIPY);
	tilemap_set_scrollx(tilemap_edge2[scroll_mode], 0, -(*madalien_scroll & 0xfc));
	tilemap_set_scrolly(tilemap_edge2[scroll_mode], 0, *madalien_edge2_pos & 0x7f);

	tilemap_draw(bitmap, &clip_edge1, tilemap_edge1[scroll_mode], 0, 0);
	tilemap_draw(bitmap, &clip_edge2, tilemap_edge2[scroll_mode], 0, 0);
}
Exemple #12
0
static WRITE8_HANDLER( sprcros2_m_port7_w )
{
	UINT8 *RAM = memory_region(REGION_CPU1);

	//76543210
	//x------- unused
	//-x------ bankswitch halves of scm-01.10k into c000-dfff
	//--xx---- unused
    //----x--- irq enable
	//-----x-- ?? off with title flash and screen clears, possibly layer/sprite enable
	//------x- flip screen
	//-------x nmi enable

	if((sprcros2_m_port7^data)&0x40)
		memory_set_bankptr(1,&RAM[0x10000+((data&0x40)<<7)]);

	tilemap_set_flip( ALL_TILEMAPS,data&0x02?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 );

	sprcros2_m_port7 = data;
}
Exemple #13
0
static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
	madalien_state *state = machine->driver_data<madalien_state>();
	tilemap_set_flip(state->tilemap_fg, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
	tilemap_draw(bitmap, cliprect, state->tilemap_fg, 0, 0);
}
Exemple #14
0
static void tx_tilemap_mark_all_dirty(void)
{
	tilemap_mark_all_tiles_dirty(tx_tilemap);
	tilemap_set_flip(tx_tilemap, flip_x | flip_y);
}
Exemple #15
0
void karnov_flipscreen_w(int data)
{
	flipscreen=data;
	tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
void renegade_flipscreen_w( int offset, int data ){
	flipscreen = !data;
	tilemap_set_flip( ALL_TILEMAPS, flipscreen?(TILEMAP_FLIPY|TILEMAP_FLIPX):0);
}
Exemple #17
0
static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
	tilemap_set_flip(tilemap_fg, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
	tilemap_draw(bitmap, cliprect, tilemap_fg, 0, 0);
}