public static VhUpdatePtr sys16_vh_screenrefresh = new VhUpdatePtr() { public void handler(osd_bitmap bitmap,int full_refresh) {
		if (sys16_update_proc != null) sys16_update_proc.handler();
		update_page();
	
	
		// from sys16 emu (Not sure if this is the best place for this?)
		{
			if (sys16_refreshenable==0)
			{
				freeze_counter_sys16=4;
				sys16_freezepalette=1;
			}
			if (freeze_counter_sys16 != 0)
			{
				if (sys16_clear_screen != 0)
					fillbitmap(bitmap,palette_transparent_color,Machine.drv.visible_area);
				freeze_counter_sys16--;
				return;
			}
			else if (sys16_freezepalette != 0)
			{
				sys16_refresh_palette();
				sys16_freezepalette=0;
			}
		}
	
		if (sys16_refreshenable != 0){
	
			if (sys18_splittab_bg_x != null)
			{
				if((sys16_bg_scrollx&0xff00)  != sys16_rowscroll_scroll)
				{
					tilemap_set_scroll_rows( background , 1 );
					tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
				}
				else
				{
					int offset, scroll,i;
	
					tilemap_set_scroll_rows( background , 64 );
					offset = 32+((sys16_bg_scrolly&0x1f8) >> 3);
	
					for(i=0;i<29;i++)
					{
						scroll = sys18_splittab_bg_x.READ_WORD(i*2);
						tilemap_set_scrollx( background , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_bgxoffset );
					}
				}
			}
			else
			{
				tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
			}
	
			if (sys18_splittab_bg_y != null)
			{
				if((sys16_bg_scrolly&0xff00)  != sys16_rowscroll_scroll)
				{
					tilemap_set_scroll_cols( background , 1 );
					tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly );
				}
				else
				{
					int offset, scroll,i;
	
					tilemap_set_scroll_cols( background , 128 );
					offset = 127-((sys16_bg_scrollx&0x3f8) >> 3)-40+2;
	
					for(i=0;i<41;i++)
					{
						scroll = sys18_splittab_bg_y.READ_WORD((i+24)&0xfffe);
						tilemap_set_scrolly( background , (i+offset)&0x7f, -256+(scroll&0x3ff) );
					}
				}
			}
			else
			{
				tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly );
			}
	
			if (sys18_splittab_fg_x != null)
			{
				if((sys16_fg_scrollx&0xff00)  != sys16_rowscroll_scroll)
				{
					tilemap_set_scroll_rows( foreground , 1 );
					tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
				}
				else
				{
					int offset, scroll,i;
	
					tilemap_set_scroll_rows( foreground , 64 );
					offset = 32+((sys16_fg_scrolly&0x1f8) >> 3);
	
					for(i=0;i<29;i++)
					{
						scroll = sys18_splittab_fg_x.READ_WORD(i*2);
	
	
						tilemap_set_scrollx( foreground , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_fgxoffset );
					}
				}
			}
			else
			{
				tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
			}
	
			if (sys18_splittab_fg_y != null)
			{
				if((sys16_fg_scrolly&0xff00)  != sys16_rowscroll_scroll)
				{
					tilemap_set_scroll_cols( foreground , 1 );
					tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly );
				}
				else
				{
					int offset, scroll,i;
	
					tilemap_set_scroll_cols( foreground , 128 );
					offset = 127-((sys16_fg_scrollx&0x3f8) >> 3)-40+2;
	
					for(i=0;i<41;i++)
					{
						scroll = sys18_splittab_fg_y.READ_WORD((i+24)&0xfffe);
						tilemap_set_scrolly( foreground , (i+offset)&0x7f, -256+(scroll&0x3ff) );
					}
				}
			}
			else
			{
				tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly );
			}
	
			if (sys16_quartet_title_kludge != 0)
			{
				int top,bottom,left,right;
				int top2,bottom2,left2,right2;
				rectangle clip=new rectangle();
	
				left = background.clip_left;
				right = background.clip_right;
				top = background.clip_top;
				bottom = background.clip_bottom;
	
				left2 = foreground.clip_left;
				right2 = foreground.clip_right;
				top2 = foreground.clip_top;
				bottom2 = foreground.clip_bottom;
	
				clip.min_x=0;
				clip.min_y=0;
				clip.max_x=1024;
				clip.max_y=512;
	
				tilemap_set_clip( background, clip );
				tilemap_set_clip( foreground, clip );
	
				tilemap_update(  ALL_TILEMAPS  );
	
				background.clip_left = left;
				background.clip_right = right;
				background.clip_top = top;
				background.clip_bottom = bottom;
	
				foreground.clip_left = left2;
				foreground.clip_right = right2;
				foreground.clip_top = top2;
				foreground.clip_bottom = bottom2;
	
			}
			else
				tilemap_update(  ALL_TILEMAPS  );
	
			get_sprite_info();
	
			palette_init_used_colors();
			mark_sprite_colors(); // custom; normally this would be handled by the sprite manager
			sprite_update();
	
			if( palette_recalc()!=null ) tilemap_mark_all_pixels_dirty( ALL_TILEMAPS );
			build_shadow_table();
			tilemap_render(  ALL_TILEMAPS  );
	
			if(sys16_quartet_title_kludge==0)
			{
				tilemap_draw( bitmap, background, TILEMAP_IGNORE_TRANSPARENCY );
				if (sys16_bg_priority_mode != 0) tilemap_draw( bitmap, background, TILEMAP_IGNORE_TRANSPARENCY | 1 );
			}
/*TODO*///			else
/*TODO*///				draw_quartet_title_screen( bitmap, 0 );
/*TODO*///	
			sprite_draw(sprite_list,3); // needed for Aurail
			if(sys16_bg_priority_mode==2) tilemap_draw( bitmap, background, 1 );		// body slam (& wrestwar??)
			sprite_draw(sprite_list,2);
			if(sys16_bg_priority_mode==1) tilemap_draw( bitmap, background, 1 );		// alien syndrome / aurail
	
			if(sys16_quartet_title_kludge==0)
			{
				tilemap_draw( bitmap, foreground, 0 );
				sprite_draw(sprite_list,1);
				tilemap_draw( bitmap, foreground, 1 );
			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				draw_quartet_title_screen( bitmap, 1 );
/*TODO*///				sprite_draw(sprite_list,1);
/*TODO*///			}
	
			if(sys16_textlayer_lo_max!=0) tilemap_draw( bitmap, text_layer, 1 ); // needed for Body Slam
			sprite_draw(sprite_list,0);
			tilemap_draw( bitmap, text_layer, 0 );
		}
	} };
/*TODO*///	
/*TODO*///	public static VhUpdatePtr sys18_vh_screenrefresh = new VhUpdatePtr() { public void handler(osd_bitmap bitmap,int full_refresh) {
/*TODO*///		int i;
/*TODO*///		if (sys16_update_proc != 0) sys16_update_proc();
/*TODO*///		update_page();
/*TODO*///	
/*TODO*///		// from sys16 emu (Not sure if this is the best place for this?)
/*TODO*///		{
/*TODO*///			static int freeze_counter=0;
/*TODO*///			if (!sys16_refreshenable)
/*TODO*///			{
/*TODO*///				freeze_counter=4;
/*TODO*///				sys16_freezepalette=1;
/*TODO*///			}
/*TODO*///			if (freeze_counter != 0)
/*TODO*///			{
/*TODO*///	//			if (sys16_clear_screen != 0)
/*TODO*///	//				fillbitmap(bitmap,palette_transparent_color,&Machine.drv.visible_area);
/*TODO*///				freeze_counter--;
/*TODO*///				return;
/*TODO*///			}
/*TODO*///			else if (sys16_freezepalette != 0)
/*TODO*///			{
/*TODO*///				sys16_refresh_palette();
/*TODO*///				sys16_freezepalette=0;
/*TODO*///			}
/*TODO*///		}
/*TODO*///	
/*TODO*///		if (sys16_refreshenable != 0){
/*TODO*///	
/*TODO*///			if (sys18_splittab_bg_x != 0)
/*TODO*///			{
/*TODO*///				int offset,offset2, scroll,scroll2,orig_scroll;
/*TODO*///	
/*TODO*///				offset = 32+((sys16_bg_scrolly&0x1f8) >> 3);
/*TODO*///				offset2 = 32+((sys16_bg2_scrolly&0x1f8) >> 3);
/*TODO*///	
/*TODO*///				for(i=0;i<29;i++)
/*TODO*///				{
/*TODO*///					orig_scroll = scroll2 = scroll = READ_WORD(&sys18_splittab_bg_x[i*2]);
/*TODO*///	
/*TODO*///					if((sys16_bg_scrollx &0xff00) != 0x8000)
/*TODO*///						scroll = sys16_bg_scrollx;
/*TODO*///	
/*TODO*///					if((sys16_bg2_scrollx &0xff00) != 0x8000)
/*TODO*///						scroll2 = sys16_bg2_scrollx;
/*TODO*///	
/*TODO*///					if ((orig_scroll & 0x8000) != 0)
/*TODO*///					{
/*TODO*///						tilemap_set_scrollx( background , (i+offset)&0x3f, TILE_LINE_DISABLED );
/*TODO*///						tilemap_set_scrollx( background2, (i+offset2)&0x3f, -320-(scroll2&0x3ff)+sys16_bgxoffset );
/*TODO*///					}
/*TODO*///					else
/*TODO*///					{
/*TODO*///						tilemap_set_scrollx( background , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_bgxoffset );
/*TODO*///						tilemap_set_scrollx( background2 , (i+offset2)&0x3f, TILE_LINE_DISABLED );
/*TODO*///					}
/*TODO*///				}
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				tilemap_set_scrollx( background , 0, -320-(sys16_bg_scrollx&0x3ff)+sys16_bgxoffset );
/*TODO*///				tilemap_set_scrollx( background2, 0, -320-(sys16_bg2_scrollx&0x3ff)+sys16_bgxoffset );
/*TODO*///			}
/*TODO*///	
/*TODO*///			tilemap_set_scrolly( background , 0, -256+sys16_bg_scrolly );
/*TODO*///			tilemap_set_scrolly( background2, 0, -256+sys16_bg2_scrolly );
/*TODO*///	
/*TODO*///			if (sys18_splittab_fg_x != 0)
/*TODO*///			{
/*TODO*///				int offset,offset2, scroll,scroll2,orig_scroll;
/*TODO*///	
/*TODO*///				offset = 32+((sys16_fg_scrolly&0x1f8) >> 3);
/*TODO*///				offset2 = 32+((sys16_fg2_scrolly&0x1f8) >> 3);
/*TODO*///	
/*TODO*///				for(i=0;i<29;i++)
/*TODO*///				{
/*TODO*///					orig_scroll = scroll2 = scroll = READ_WORD(&sys18_splittab_fg_x[i*2]);
/*TODO*///	
/*TODO*///					if((sys16_fg_scrollx &0xff00) != 0x8000)
/*TODO*///						scroll = sys16_fg_scrollx;
/*TODO*///	
/*TODO*///					if((sys16_fg2_scrollx &0xff00) != 0x8000)
/*TODO*///						scroll2 = sys16_fg2_scrollx;
/*TODO*///	
/*TODO*///					if ((orig_scroll & 0x8000) != 0)
/*TODO*///					{
/*TODO*///						tilemap_set_scrollx( foreground , (i+offset)&0x3f, TILE_LINE_DISABLED );
/*TODO*///						tilemap_set_scrollx( foreground2, (i+offset2)&0x3f, -320-(scroll2&0x3ff)+sys16_fgxoffset );
/*TODO*///					}
/*TODO*///					else
/*TODO*///					{
/*TODO*///						tilemap_set_scrollx( foreground , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_fgxoffset );
/*TODO*///						tilemap_set_scrollx( foreground2 , (i+offset2)&0x3f, TILE_LINE_DISABLED );
/*TODO*///					}
/*TODO*///				}
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				tilemap_set_scrollx( foreground , 0, -320-(sys16_fg_scrollx&0x3ff)+sys16_fgxoffset );
/*TODO*///				tilemap_set_scrollx( foreground2, 0, -320-(sys16_fg2_scrollx&0x3ff)+sys16_fgxoffset );
/*TODO*///			}
/*TODO*///	
/*TODO*///	
/*TODO*///			tilemap_set_scrolly( foreground , 0, -256+sys16_fg_scrolly );
/*TODO*///			tilemap_set_scrolly( foreground2, 0, -256+sys16_fg2_scrolly );
/*TODO*///	
/*TODO*///			tilemap_set_enable( background2, sys18_bg2_active );
/*TODO*///			tilemap_set_enable( foreground2, sys18_fg2_active );
/*TODO*///	
/*TODO*///			tilemap_update(  ALL_TILEMAPS  );
/*TODO*///			get_sprite_info();
/*TODO*///	
/*TODO*///			palette_init_used_colors();
/*TODO*///			mark_sprite_colors(); // custom; normally this would be handled by the sprite manager
/*TODO*///			sprite_update();
/*TODO*///	
/*TODO*///			if( palette_recalc() ) tilemap_mark_all_pixels_dirty( ALL_TILEMAPS );
/*TODO*///			build_shadow_table();
/*TODO*///			tilemap_render(  ALL_TILEMAPS  );
/*TODO*///	
/*TODO*///			if (sys18_bg2_active != 0)
/*TODO*///				tilemap_draw( bitmap, background2, 0 );
/*TODO*///			else
/*TODO*///				fillbitmap(bitmap,palette_transparent_color,&Machine.drv.visible_area);
/*TODO*///	
/*TODO*///			tilemap_draw( bitmap, background, TILEMAP_IGNORE_TRANSPARENCY );
/*TODO*///			tilemap_draw( bitmap, background, TILEMAP_IGNORE_TRANSPARENCY | 1 );	//??
/*TODO*///			tilemap_draw( bitmap, background, TILEMAP_IGNORE_TRANSPARENCY | 2 );	//??
/*TODO*///	
/*TODO*///			sprite_draw(sprite_list,3);
/*TODO*///			tilemap_draw( bitmap, background, 1 );
/*TODO*///			sprite_draw(sprite_list,2);
/*TODO*///			tilemap_draw( bitmap, background, 2 );
/*TODO*///	
/*TODO*///			if (sys18_fg2_active != 0) tilemap_draw( bitmap, foreground2, 0 );
/*TODO*///			tilemap_draw( bitmap, foreground, 0 );
/*TODO*///			sprite_draw(sprite_list,1);
/*TODO*///			if (sys18_fg2_active != 0) tilemap_draw( bitmap, foreground2, 1 );
/*TODO*///			tilemap_draw( bitmap, foreground, 1 );
/*TODO*///	
/*TODO*///			tilemap_draw( bitmap, text_layer, 1 );
/*TODO*///			sprite_draw(sprite_list,0);
/*TODO*///			tilemap_draw( bitmap, text_layer, 0 );
/*TODO*///		}
/*TODO*///	} };
/*TODO*///	
/*TODO*///	extern int gr_bitmap_width;
/*TODO*///	
/*TODO*///	static void gr_colors(void)
/*TODO*///	{
/*TODO*///		int i;
/*TODO*///		UINT16 ver_data;
/*TODO*///		int colorflip;
/*TODO*///		UINT8 *data_ver=gr_ver;
/*TODO*///	
/*TODO*///		for(i=0;i<224;i++)
/*TODO*///		{
/*TODO*///			ver_data=READ_WORD(data_ver);
/*TODO*///			palette_used_colors[(READ_WORD(&gr_pal[(ver_data<<1)&0x1fe])&0xff) + gr_palette] = PALETTE_COLOR_USED;
/*TODO*///	
/*TODO*///			if(!((ver_data & 0x500) == 0x100 || (ver_data & 0x300) == 0x200))
/*TODO*///			{
/*TODO*///				ver_data=ver_data & 0x00ff;
/*TODO*///				colorflip = (READ_WORD(&gr_flip[ver_data<<1]) >> 3) & 1;
/*TODO*///	
/*TODO*///				palette_used_colors[ gr_colorflip[colorflip][0] + gr_palette_default ] = PALETTE_COLOR_USED;
/*TODO*///				palette_used_colors[ gr_colorflip[colorflip][1] + gr_palette_default ] = PALETTE_COLOR_USED;
/*TODO*///				palette_used_colors[ gr_colorflip[colorflip][2] + gr_palette_default ] = PALETTE_COLOR_USED;
/*TODO*///				palette_used_colors[ gr_colorflip[colorflip][3] + gr_palette_default ] = PALETTE_COLOR_USED;
/*TODO*///			}
/*TODO*///			data_ver+=2;
/*TODO*///		}
/*TODO*///	}
/*TODO*///	
/*TODO*///	static void render_gr(struct osd_bitmap *bitmap,int priority)
/*TODO*///	{
/*TODO*///		int i,j;
/*TODO*///		UINT8 *data = memory_region(REGION_GFX3);
/*TODO*///		UINT8 *source;
/*TODO*///		UINT8 *line;
/*TODO*///		UINT16 *line16;
/*TODO*///		UINT32 *line32;
/*TODO*///		UINT8 *data_ver=gr_ver;
/*TODO*///		UINT32 ver_data,hor_pos;
/*TODO*///		UINT16 colors[5];
/*TODO*///	//	UINT8 colors[5];
/*TODO*///		UINT32 fastfill;
/*TODO*///		int colorflip;
/*TODO*///		int yflip=0,ypos;
/*TODO*///		int dx=1,xoff=0;
/*TODO*///	
/*TODO*///		UINT16 *paldata1 = Machine.gfx[0].colortable + gr_palette;
/*TODO*///		UINT16 *paldata2 = Machine.gfx[0].colortable + gr_palette_default;
/*TODO*///	
/*TODO*///		priority=priority << 10;
/*TODO*///	
/*TODO*///		if (Machine.scrbitmap.depth == 16) /* 16 bit */
/*TODO*///		{
/*TODO*///			if( Machine.orientation & ORIENTATION_SWAP_XY )
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x400) == priority)
/*TODO*///					{
/*TODO*///						colors[0] = paldata1[ READ_WORD(&gr_pal[(ver_data<<1)&0x1fe])&0xff ];
/*TODO*///	
/*TODO*///						if((ver_data & 0x500) == 0x100 || (ver_data & 0x300) == 0x200)
/*TODO*///						{
/*TODO*///							// fill line
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								line16=(UINT16 *)bitmap.line[j]+ypos;
/*TODO*///								*line16=colors[0];
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							ver_data=ver_data & 0x00ff;
/*TODO*///							colorflip = (READ_WORD(&gr_flip[ver_data<<1]) >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///							colors[4] = paldata2[ gr_colorflip[colorflip][3] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							ver_data = ver_data << gr_bitmap_width;
/*TODO*///	
/*TODO*///							if ((hor_pos & 0xf000) != 0)
/*TODO*///							{
/*TODO*///								// reverse
/*TODO*///								hor_pos=((0-((hor_pos&0x7ff)^7))+0x9f8)&0x3ff;
/*TODO*///							}
/*TODO*///							else
/*TODO*///							{
/*TODO*///								// normal
/*TODO*///								hor_pos=(hor_pos+0x200) & 0x3ff;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source = data + hor_pos + ver_data + 18 + 8;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								line16=(UINT16 *)bitmap.line[xoff+j*dx]+ypos;
/*TODO*///								*line16 = colors[*source++];
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x400) == priority)
/*TODO*///					{
/*TODO*///						colors[0] = paldata1[ READ_WORD(&gr_pal[(ver_data<<1)&0x1fe])&0xff ];
/*TODO*///	
/*TODO*///						if((ver_data & 0x500) == 0x100 || (ver_data & 0x300) == 0x200)
/*TODO*///						{
/*TODO*///							line16=(UINT16 *)bitmap.line[ypos];
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								*line16++=colors[0];
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							line16 = (UINT16 *)bitmap.line[ypos]+xoff;
/*TODO*///							ver_data=ver_data & 0x00ff;
/*TODO*///							colorflip = (READ_WORD(&gr_flip[ver_data<<1]) >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///							colors[4] = paldata2[ gr_colorflip[colorflip][3] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							ver_data = ver_data << gr_bitmap_width;
/*TODO*///	
/*TODO*///							if ((hor_pos & 0xf000) != 0)
/*TODO*///							{
/*TODO*///								// reverse
/*TODO*///								hor_pos=((0-((hor_pos&0x7ff)^7))+0x9f8)&0x3ff;
/*TODO*///							}
/*TODO*///							else
/*TODO*///							{
/*TODO*///								// normal
/*TODO*///								hor_pos=(hor_pos+0x200) & 0x3ff;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source = data + hor_pos + ver_data + 18 + 8;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								*line16 = colors[*source++];
/*TODO*///								line16+=dx;
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///		}
/*TODO*///		else /* 8 bit */
/*TODO*///		{
/*TODO*///			if( Machine.orientation & ORIENTATION_SWAP_XY )
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x400) == priority)
/*TODO*///					{
/*TODO*///						colors[0] = paldata1[ READ_WORD(&gr_pal[(ver_data<<1)&0x1fe])&0xff ];
/*TODO*///	
/*TODO*///						if((ver_data & 0x500) == 0x100 || (ver_data & 0x300) == 0x200)
/*TODO*///						{
/*TODO*///							// fill line
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								bitmap.line[j][ypos]=colors[0];
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							ver_data=ver_data & 0x00ff;
/*TODO*///							colorflip = (READ_WORD(&gr_flip[ver_data<<1]) >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///							colors[4] = paldata2[ gr_colorflip[colorflip][3] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							ver_data = ver_data << gr_bitmap_width;
/*TODO*///	
/*TODO*///							if ((hor_pos & 0xf000) != 0)
/*TODO*///							{
/*TODO*///								// reverse
/*TODO*///								hor_pos=((0-((hor_pos&0x7ff)^7))+0x9f8)&0x3ff;
/*TODO*///							}
/*TODO*///							else
/*TODO*///							{
/*TODO*///								// normal
/*TODO*///								hor_pos=(hor_pos+0x200) & 0x3ff;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source = data + hor_pos + ver_data + 18 + 8;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								bitmap.line[xoff+j*dx][ypos] = colors[*source++];
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x400) == priority)
/*TODO*///					{
/*TODO*///						colors[0] = paldata1[ READ_WORD(&gr_pal[(ver_data<<1)&0x1fe])&0xff ];
/*TODO*///	
/*TODO*///						if((ver_data & 0x500) == 0x100 || (ver_data & 0x300) == 0x200)
/*TODO*///						{
/*TODO*///							// fill line
/*TODO*///							line32 = (UINT32 *)bitmap.line[ypos];
/*TODO*///							fastfill = colors[0] + (colors[0] << 8) + (colors[0] << 16) + (colors[0] << 24);
/*TODO*///							for(j=0;j<320;j+=4)
/*TODO*///							{
/*TODO*///								*line32++ = fastfill;
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							line = bitmap.line[ypos]+xoff;
/*TODO*///							ver_data=ver_data & 0x00ff;
/*TODO*///							colorflip = (READ_WORD(&gr_flip[ver_data<<1]) >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///							colors[4] = paldata2[ gr_colorflip[colorflip][3] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							ver_data = ver_data << gr_bitmap_width;
/*TODO*///	
/*TODO*///							if ((hor_pos & 0xf000) != 0)
/*TODO*///							{
/*TODO*///								// reverse
/*TODO*///								hor_pos=((0-((hor_pos&0x7ff)^7))+0x9f8)&0x3ff;
/*TODO*///							}
/*TODO*///							else
/*TODO*///							{
/*TODO*///								// normal
/*TODO*///								hor_pos=(hor_pos+0x200) & 0x3ff;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source = data + hor_pos + ver_data + 18 + 8;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								*line = colors[*source++];
/*TODO*///								line+=dx;
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///		}
/*TODO*///	}
/*TODO*///	
/*TODO*///	
/*TODO*///	
/*TODO*///	
/*TODO*///	// Refresh for hang-on, etc.
/*TODO*///	public static VhUpdatePtr sys16_ho_vh_screenrefresh = new VhUpdatePtr() { public void handler(osd_bitmap bitmap,int full_refresh) {
/*TODO*///		if (sys16_update_proc != 0) sys16_update_proc();
/*TODO*///		update_page();
/*TODO*///	
/*TODO*///		// from sys16 emu (Not sure if this is the best place for this?)
/*TODO*///		{
/*TODO*///			static int freeze_counter=0;
/*TODO*///			if (!sys16_refreshenable)
/*TODO*///			{
/*TODO*///				freeze_counter=4;
/*TODO*///				sys16_freezepalette=1;
/*TODO*///			}
/*TODO*///			if (freeze_counter != 0)
/*TODO*///			{
/*TODO*///				freeze_counter--;
/*TODO*///				return;
/*TODO*///			}
/*TODO*///			else if (sys16_freezepalette != 0)
/*TODO*///			{
/*TODO*///				sys16_refresh_palette();
/*TODO*///				sys16_freezepalette=0;
/*TODO*///			}
/*TODO*///		}
/*TODO*///	
/*TODO*///		if (sys16_refreshenable != 0){
/*TODO*///	
/*TODO*///			tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
/*TODO*///			tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
/*TODO*///	
/*TODO*///			tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly );
/*TODO*///			tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly );
/*TODO*///	
/*TODO*///			tilemap_update(  ALL_TILEMAPS  );
/*TODO*///			get_sprite_info();
/*TODO*///	
/*TODO*///			palette_init_used_colors();
/*TODO*///			mark_sprite_colors(); // custom; normally this would be handled by the sprite manager
/*TODO*///			sprite_update();
/*TODO*///			gr_colors();
/*TODO*///	
/*TODO*///			if( palette_recalc() ) tilemap_mark_all_pixels_dirty( ALL_TILEMAPS );
/*TODO*///			build_shadow_table();
/*TODO*///			tilemap_render(  ALL_TILEMAPS  );
/*TODO*///	
/*TODO*///			render_gr(bitmap,0);
/*TODO*///	
/*TODO*///			tilemap_draw( bitmap, background, 0 );
/*TODO*///			tilemap_draw( bitmap, foreground, 0 );
/*TODO*///	
/*TODO*///			render_gr(bitmap,1);
/*TODO*///	
/*TODO*///			sprite_draw(sprite_list,0);
/*TODO*///			tilemap_draw( bitmap, text_layer, 0 );
/*TODO*///	
/*TODO*///		}
/*TODO*///	} };
/*TODO*///	
/*TODO*///	
/*TODO*///	static void grv2_colors(void)
/*TODO*///	{
/*TODO*///		int i;
/*TODO*///		UINT16 ver_data;
/*TODO*///		int colorflip,colorflip_info;
/*TODO*///		UINT8 *data_ver=gr_ver;
/*TODO*///	
/*TODO*///		for(i=0;i<224;i++)
/*TODO*///		{
/*TODO*///			ver_data=READ_WORD(data_ver);
/*TODO*///	
/*TODO*///			if(!(ver_data & 0x800))
/*TODO*///			{
/*TODO*///				ver_data=ver_data & 0x01ff;
/*TODO*///				colorflip_info = READ_WORD(&gr_flip[ver_data<<1]);
/*TODO*///	
/*TODO*///				palette_used_colors[ (((colorflip_info >> 8) & 0x1f) + 0x20) + gr_palette_default] = PALETTE_COLOR_USED;
/*TODO*///	
/*TODO*///				colorflip = (colorflip_info >> 3) & 1;
/*TODO*///	
/*TODO*///				palette_used_colors[ gr_colorflip[colorflip][0] + gr_palette_default ] = PALETTE_COLOR_USED;
/*TODO*///				palette_used_colors[ gr_colorflip[colorflip][1] + gr_palette_default ] = PALETTE_COLOR_USED;
/*TODO*///				palette_used_colors[ gr_colorflip[colorflip][2] + gr_palette_default ] = PALETTE_COLOR_USED;
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				palette_used_colors[(ver_data&0x3f) + gr_palette] = PALETTE_COLOR_USED;
/*TODO*///			}
/*TODO*///			data_ver+=2;
/*TODO*///		}
/*TODO*///	}
/*TODO*///	
/*TODO*///	static void render_grv2(struct osd_bitmap *bitmap,int priority)
/*TODO*///	{
/*TODO*///		int i,j;
/*TODO*///		UINT8 *data = memory_region(REGION_GFX3);
/*TODO*///		UINT8 *source,*source2,*temp;
/*TODO*///		UINT8 *line;
/*TODO*///		UINT16 *line16;
/*TODO*///		UINT32 *line32;
/*TODO*///		UINT8 *data_ver=gr_ver;
/*TODO*///		UINT32 ver_data,hor_pos,hor_pos2;
/*TODO*///		UINT16 colors[5];
/*TODO*///		UINT32 fastfill;
/*TODO*///		int colorflip,colorflip_info;
/*TODO*///		int yflip=0,ypos;
/*TODO*///		int dx=1,xoff=0;
/*TODO*///	
/*TODO*///		int second_road = READ_WORD(gr_second_road);
/*TODO*///	
/*TODO*///		UINT16 *paldata1 = Machine.gfx[0].colortable + gr_palette;
/*TODO*///		UINT16 *paldata2 = Machine.gfx[0].colortable + gr_palette_default;
/*TODO*///	
/*TODO*///		priority=priority << 11;
/*TODO*///	
/*TODO*///		if (Machine.scrbitmap.depth == 16) /* 16 bit */
/*TODO*///		{
/*TODO*///			if( Machine.orientation & ORIENTATION_SWAP_XY )
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x800) == priority)
/*TODO*///					{
/*TODO*///	
/*TODO*///						if ((ver_data & 0x800) != 0)
/*TODO*///						{
/*TODO*///							colors[0] = paldata1[ ver_data&0x3f ];
/*TODO*///							// fill line
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								line16=(UINT16 *)bitmap.line[j]+ypos;
/*TODO*///								*line16=colors[0];
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							ver_data=ver_data & 0x01ff;		//???
/*TODO*///							colorflip_info = READ_WORD(&gr_flip[ver_data<<1]);
/*TODO*///	
/*TODO*///							colors[0] = paldata2[ ((colorflip_info >> 8) & 0x1f) + 0x20 ];		//??
/*TODO*///	
/*TODO*///							colorflip = (colorflip_info >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							hor_pos2= (READ_WORD(&gr_hor[(ver_data<<1)+0x400]) );
/*TODO*///	
/*TODO*///							ver_data=ver_data>>1;
/*TODO*///							if( ver_data != 0 )
/*TODO*///							{
/*TODO*///								ver_data = (ver_data-1) << gr_bitmap_width;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source  = data + ((hor_pos +0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///							source2 = data + ((hor_pos2+0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///	
/*TODO*///							switch(second_road)
/*TODO*///							{
/*TODO*///								case 0:	source2=source;	break;
/*TODO*///								case 2:	temp=source;source=source2;source2=temp; break;
/*TODO*///								case 3:	source=source2;	break;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source2++;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								line16=(UINT16 *)bitmap.line[xoff+j*dx]+ypos;
/*TODO*///								if(*source2 <= *source)
/*TODO*///									*line16 = colors[*source];
/*TODO*///								else
/*TODO*///									*line16 = colors[*source2];
/*TODO*///								source++;
/*TODO*///								source2++;
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x800) == priority)
/*TODO*///					{
/*TODO*///	
/*TODO*///						if ((ver_data & 0x800) != 0)
/*TODO*///						{
/*TODO*///							colors[0] = paldata1[ ver_data&0x3f ];
/*TODO*///							// fill line
/*TODO*///							line16 = (UINT16 *)bitmap.line[ypos];
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								*line16++ = colors[0];
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							line16 = (UINT16 *)bitmap.line[ypos]+xoff;
/*TODO*///							ver_data=ver_data & 0x01ff;		//???
/*TODO*///							colorflip_info = READ_WORD(&gr_flip[ver_data<<1]);
/*TODO*///	
/*TODO*///							colors[0] = paldata2[ ((colorflip_info >> 8) & 0x1f) + 0x20 ];		//??
/*TODO*///	
/*TODO*///							colorflip = (colorflip_info >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							hor_pos2= (READ_WORD(&gr_hor[(ver_data<<1)+0x400]) );
/*TODO*///	
/*TODO*///							ver_data=ver_data>>1;
/*TODO*///							if( ver_data != 0 )
/*TODO*///							{
/*TODO*///								ver_data = (ver_data-1) << gr_bitmap_width;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source  = data + ((hor_pos +0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///							source2 = data + ((hor_pos2+0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///	
/*TODO*///							switch(second_road)
/*TODO*///							{
/*TODO*///								case 0:	source2=source;	break;
/*TODO*///								case 2:	temp=source;source=source2;source2=temp; break;
/*TODO*///								case 3:	source=source2;	break;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source2++;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								if(*source2 <= *source)
/*TODO*///									*line16 = colors[*source];
/*TODO*///								else
/*TODO*///									*line16 = colors[*source2];
/*TODO*///								source++;
/*TODO*///								source2++;
/*TODO*///								line16+=dx;
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///		}
/*TODO*///		else
/*TODO*///		{
/*TODO*///			if( Machine.orientation & ORIENTATION_SWAP_XY )
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x800) == priority)
/*TODO*///					{
/*TODO*///	
/*TODO*///						if ((ver_data & 0x800) != 0)
/*TODO*///						{
/*TODO*///							colors[0] = paldata1[ ver_data&0x3f ];
/*TODO*///							// fill line
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								bitmap.line[j][ypos]=colors[0];
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							ver_data=ver_data & 0x01ff;		//???
/*TODO*///							colorflip_info = READ_WORD(&gr_flip[ver_data<<1]);
/*TODO*///	
/*TODO*///							colors[0] = paldata2[ ((colorflip_info >> 8) & 0x1f) + 0x20 ];		//??
/*TODO*///	
/*TODO*///							colorflip = (colorflip_info >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							hor_pos2= (READ_WORD(&gr_hor[(ver_data<<1)+0x400]) );
/*TODO*///	
/*TODO*///							ver_data=ver_data>>1;
/*TODO*///							if( ver_data != 0 )
/*TODO*///							{
/*TODO*///								ver_data = (ver_data-1) << gr_bitmap_width;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source  = data + ((hor_pos +0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///							source2 = data + ((hor_pos2+0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///	
/*TODO*///							switch(second_road)
/*TODO*///							{
/*TODO*///								case 0:	source2=source;	break;
/*TODO*///								case 2:	temp=source;source=source2;source2=temp; break;
/*TODO*///								case 3:	source=source2;	break;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source2++;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								if(*source2 <= *source)
/*TODO*///									bitmap.line[xoff+j*dx][ypos] = colors[*source];
/*TODO*///								else
/*TODO*///									bitmap.line[xoff+j*dx][ypos] = colors[*source2];
/*TODO*///								source++;
/*TODO*///								source2++;
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_X ){
/*TODO*///					dx=-1;
/*TODO*///					xoff=319;
/*TODO*///				}
/*TODO*///				if( Machine.orientation & ORIENTATION_FLIP_Y ){
/*TODO*///					yflip=1;
/*TODO*///				}
/*TODO*///	
/*TODO*///				for(i=0;i<224;i++)
/*TODO*///				{
/*TODO*///					if (yflip != 0) ypos=223-i;
/*TODO*///					else ypos=i;
/*TODO*///					ver_data=READ_WORD(data_ver);
/*TODO*///					if((ver_data & 0x800) == priority)
/*TODO*///					{
/*TODO*///	
/*TODO*///						if ((ver_data & 0x800) != 0)
/*TODO*///						{
/*TODO*///							colors[0] = paldata1[ ver_data&0x3f ];
/*TODO*///							// fill line
/*TODO*///							line32 = (UINT32 *)bitmap.line[ypos];
/*TODO*///							fastfill = colors[0] + (colors[0] << 8) + (colors[0] << 16) + (colors[0] << 24);
/*TODO*///							for(j=0;j<320;j+=4)
/*TODO*///							{
/*TODO*///								*line32++ = fastfill;
/*TODO*///							}
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							// copy line
/*TODO*///							line = bitmap.line[ypos]+xoff;
/*TODO*///							ver_data=ver_data & 0x01ff;		//???
/*TODO*///							colorflip_info = READ_WORD(&gr_flip[ver_data<<1]);
/*TODO*///	
/*TODO*///							colors[0] = paldata2[ ((colorflip_info >> 8) & 0x1f) + 0x20 ];		//??
/*TODO*///	
/*TODO*///							colorflip = (colorflip_info >> 3) & 1;
/*TODO*///	
/*TODO*///							colors[1] = paldata2[ gr_colorflip[colorflip][0] ];
/*TODO*///							colors[2] = paldata2[ gr_colorflip[colorflip][1] ];
/*TODO*///							colors[3] = paldata2[ gr_colorflip[colorflip][2] ];
/*TODO*///	
/*TODO*///							hor_pos = (READ_WORD(&gr_hor[ver_data<<1]) );
/*TODO*///							hor_pos2= (READ_WORD(&gr_hor[(ver_data<<1)+0x400]) );
/*TODO*///	
/*TODO*///							ver_data=ver_data>>1;
/*TODO*///							if( ver_data != 0 )
/*TODO*///							{
/*TODO*///								ver_data = (ver_data-1) << gr_bitmap_width;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source  = data + ((hor_pos +0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///							source2 = data + ((hor_pos2+0x200) & 0x7ff) + 768 + ver_data + 8;
/*TODO*///	
/*TODO*///							switch(second_road)
/*TODO*///							{
/*TODO*///								case 0:	source2=source;	break;
/*TODO*///								case 2:	temp=source;source=source2;source2=temp; break;
/*TODO*///								case 3:	source=source2;	break;
/*TODO*///							}
/*TODO*///	
/*TODO*///							source2++;
/*TODO*///	
/*TODO*///							for(j=0;j<320;j++)
/*TODO*///							{
/*TODO*///								if(*source2 <= *source)
/*TODO*///									*line = colors[*source];
/*TODO*///								else
/*TODO*///									*line = colors[*source2];
/*TODO*///								source++;
/*TODO*///								source2++;
/*TODO*///								line+=dx;
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///					data_ver+=2;
/*TODO*///				}
/*TODO*///			}
/*TODO*///		}
/*TODO*///	}
/*TODO*///	
/*TODO*///	// Refresh for Outrun
/*TODO*///	public static VhUpdatePtr sys16_or_vh_screenrefresh = new VhUpdatePtr() { public void handler(osd_bitmap bitmap,int full_refresh) {
/*TODO*///		if (sys16_update_proc != 0) sys16_update_proc();
/*TODO*///		update_page();
/*TODO*///	
/*TODO*///		// from sys16 emu (Not sure if this is the best place for this?)
/*TODO*///		{
/*TODO*///			static int freeze_counter=0;
/*TODO*///			if (!sys16_refreshenable)
/*TODO*///			{
/*TODO*///				freeze_counter=4;
/*TODO*///				sys16_freezepalette=1;
/*TODO*///			}
/*TODO*///			if (freeze_counter != 0)
/*TODO*///			{
/*TODO*///				freeze_counter--;
/*TODO*///				return;
/*TODO*///			}
/*TODO*///			else if (sys16_freezepalette != 0)
/*TODO*///			{
/*TODO*///				sys16_refresh_palette();
/*TODO*///				sys16_freezepalette=0;
/*TODO*///			}
/*TODO*///		}
/*TODO*///	
/*TODO*///		if (sys16_refreshenable != 0){
/*TODO*///	
/*TODO*///			tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
/*TODO*///			tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
/*TODO*///	
/*TODO*///			tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly );
/*TODO*///			tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly );
/*TODO*///	
/*TODO*///			tilemap_update(  ALL_TILEMAPS  );
/*TODO*///			get_sprite_info();
/*TODO*///	
/*TODO*///			palette_init_used_colors();
/*TODO*///			mark_sprite_colors(); // custom; normally this would be handled by the sprite manager
/*TODO*///			sprite_update();
/*TODO*///			grv2_colors();
/*TODO*///	
/*TODO*///			if( palette_recalc() ) tilemap_mark_all_pixels_dirty( ALL_TILEMAPS );
/*TODO*///			build_shadow_table();
/*TODO*///			tilemap_render(  ALL_TILEMAPS  );
/*TODO*///	
/*TODO*///			render_grv2(bitmap,1);
/*TODO*///	
/*TODO*///			tilemap_draw( bitmap, background, 0 );
/*TODO*///			tilemap_draw( bitmap, foreground, 0 );
/*TODO*///	
/*TODO*///			render_grv2(bitmap,0);
/*TODO*///	
/*TODO*///			sprite_draw(sprite_list,0);
/*TODO*///	
/*TODO*///			tilemap_draw( bitmap, text_layer, 0 );
/*TODO*///	
/*TODO*///		}
/*TODO*///	} };
/*TODO*///	
/*TODO*///	
/*TODO*///	// hideous kludge to display quartet title screen correctly
/*TODO*///	static void draw_quartet_title_screen( struct osd_bitmap *bitmap,int playfield )
/*TODO*///	{
/*TODO*///		unsigned char *xscroll,*yscroll;
/*TODO*///		int r,c,scroll;
/*TODO*///		struct tilemap *tilemap;
/*TODO*///		struct rectangle clip;
/*TODO*///	
/*TODO*///		int top,bottom,left,right;
/*TODO*///	
/*TODO*///	
/*TODO*///		if(playfield==0) // background
/*TODO*///		{
/*TODO*///			xscroll=&sys16_textram[0x0fc0];
/*TODO*///			yscroll=&sys16_textram[0x0f58];
/*TODO*///			tilemap=background;
/*TODO*///		}
/*TODO*///		else
/*TODO*///		{
/*TODO*///			xscroll=&sys16_textram[0x0f80];
/*TODO*///			yscroll=&sys16_textram[0x0f30];
/*TODO*///			tilemap=foreground;
/*TODO*///		}
/*TODO*///	
/*TODO*///		left = tilemap.clip_left;
/*TODO*///		right = tilemap.clip_right;
/*TODO*///		top = tilemap.clip_top;
/*TODO*///		bottom = tilemap.clip_bottom;
/*TODO*///	
/*TODO*///		for(r=0;r<14;r++)
/*TODO*///		{
/*TODO*///			clip.min_y=r*16;
/*TODO*///			clip.max_y=r*16+15;
/*TODO*///			for(c=0;c<10;c++)
/*TODO*///			{
/*TODO*///				clip.min_x=c*32;
/*TODO*///				clip.max_x=c*32+31;
/*TODO*///				tilemap_set_clip( tilemap, &clip );
/*TODO*///				scroll = READ_WORD(&xscroll[r*4])&0x3ff;
/*TODO*///				tilemap_set_scrollx( tilemap, 0, (-320-scroll+sys16_bgxoffset)&0x3ff );
/*TODO*///				scroll = READ_WORD(&yscroll[c*4])&0x1ff;
/*TODO*///				tilemap_set_scrolly( tilemap, 0, (-256+scroll)&0x1ff );
/*TODO*///				tilemap_draw( bitmap, tilemap, 0 );
/*TODO*///			}
/*TODO*///		}
/*TODO*///	/*
/*TODO*///		for(r=0;r<28;r++)
/*TODO*///		{
/*TODO*///			clip.min_y=r*8;
/*TODO*///			clip.max_y=r*8+7;
/*TODO*///			for(c=0;c<20;c++)
/*TODO*///			{
/*TODO*///				clip.min_x=c*16;
/*TODO*///				clip.max_x=c*16+15;
/*TODO*///				tilemap_set_clip( tilemap, &clip );
/*TODO*///				scroll = READ_WORD(&xscroll[r*2])&0x3ff;
/*TODO*///				tilemap_set_scrollx( tilemap, 0, (-320-scroll+sys16_bgxoffset)&0x3ff );
/*TODO*///				scroll = READ_WORD(&yscroll[c*2])&0x1ff;
/*TODO*///				tilemap_set_scrolly( tilemap, 0, (-256+scroll)&0x1ff );
/*TODO*///				tilemap_draw( bitmap, tilemap, 0 );
/*TODO*///			}
/*TODO*///		}
/*TODO*///	*/
/*TODO*///		tilemap.clip_left = left;
/*TODO*///		tilemap.clip_right = right;
/*TODO*///		tilemap.clip_top = top;
/*TODO*///		tilemap.clip_bottom = bottom;
/*TODO*///	}