static void get_sprite_info(  ){
	//	const struct rectangle *clip = &Machine.drv.visible_area;
		CharPtr base_pal = new CharPtr(Machine.gfx[0].colortable, 1024);
		UBytePtr base_gfx = memory_region(REGION_GFX2);
	
		UShortPtr source = new UShortPtr(sys16_spriteram);
		sprite sprite[] = sprite_list.sprite;
                int sprite_ptr=0;
		int finish = sprite_ptr + NUM_SPRITES;//const struct sprite *finish = sprite + NUM_SPRITES;
	
		int passshot_y=0;
		int passshot_width=0;

		switch( sys16_spritesystem  ){
			case 1: /* standard sprite hardware (Shinobi, Altered Beast, Golden Axe, ...) */
	/*
		0	bottom--	top-----	(screen coordinates)
		1	???????X	XXXXXXXX	(screen coordinate)
		2	???????F	FWWWWWWW	(flipx, flipy, logical width)
		3	TTTTTTTT	TTTTTTTT	(pen data)
		4	????BBBB	PPCCCCCC	(attributes: bank, priority, color)
		5	??????ZZ	ZZZZZZZZ	zoomx
		6	??????ZZ	ZZZZZZZZ	zoomy (defaults to zoomx)
		7	?						"sprite offset"
	*/
			while( sprite_ptr<finish ){
				char ypos = source.read(0);
				char width = source.read(2);
				int top = ypos&0xff;
				int bottom = ypos>>8;
	
				if( bottom == 0xff || width ==sys16_spritelist_end){ /* end of spritelist marker */
					do {
						sprite[sprite_ptr].flags = 0;
						sprite_ptr++;
					} while( sprite_ptr<finish );
					break;
				}
				sprite[sprite_ptr].flags = 0;
	
				if(bottom !=0 && bottom > top)
				{
					char attributes = source.read(4);
					char zoomx = (char)(source.read(5)&0x3ff);
					char zoomy = (char)((source.read(6)&0x3ff));
					int gfx = source.read(3)*4;
	
					if( zoomy==0 || source.read(6)==0xffff ) zoomy = zoomx; /* if zoomy is 0, use zoomx instead */
	
					sprite[sprite_ptr].x = source.read(1) + sys16_sprxoffset;
					sprite[sprite_ptr].y = top;
					sprite[sprite_ptr].priority = 3-((attributes>>6)&0x3);
					sprite[sprite_ptr].pal_data = new CharPtr(base_pal, ((attributes&0x3f)<<4));
	
					sprite[sprite_ptr].total_height = bottom-top;
					sprite[sprite_ptr].tile_height = sprite[sprite_ptr].total_height*(0x400+zoomy)/0x400;
	
					sprite[sprite_ptr].line_offset = (width&0x7f)*4;
	
					sprite[sprite_ptr].flags = SPRITE_VISIBLE;
					if ((width & 0x100) != 0) sprite[sprite_ptr].flags |= SPRITE_FLIPX;
					if ((width & 0x080) != 0) sprite[sprite_ptr].flags |= SPRITE_FLIPY;
	
					if ((attributes&0x3f)==0x3f)	// shadow sprite
						sprite[sprite_ptr].flags|= SPRITE_SHADOW;
						
					if(( sprite[sprite_ptr].flags&SPRITE_FLIPY )!=0){
						sprite[sprite_ptr].line_offset = 512-sprite[sprite_ptr].line_offset;
						if(( sprite[sprite_ptr].flags&SPRITE_FLIPX )!=0){
							gfx += 4 - sprite[sprite_ptr].line_offset*(sprite[sprite_ptr].tile_height+1);
						}
						else {
							gfx -= sprite[sprite_ptr].line_offset*sprite[sprite_ptr].tile_height;
						}
					}
					else {
						if(( sprite[sprite_ptr].flags&SPRITE_FLIPX )!=0){
							gfx += 4;
						}
						else {
							gfx += sprite[sprite_ptr].line_offset;
						}
					}
	
					sprite[sprite_ptr].tile_width = sprite[sprite_ptr].line_offset;
					sprite[sprite_ptr].total_width = sprite[sprite_ptr].tile_width*(0x800-zoomx)/0x800;
					sprite[sprite_ptr].pen_data = new UBytePtr(base_gfx , (gfx &0x3ffff) + (sys16_obj_bank[(attributes>>8)&0xf] << 17));
	
				}
	
				sprite_ptr++;
				source.offset += 8*2;
			}
			break;
/*TODO*///	
/*TODO*///			case 8: /* Passing shot 4p */
/*TODO*///				passshot_y=-0x23;
/*TODO*///				passshot_width=1;
/*TODO*///			case 0: /* Passing shot */
/*TODO*///	/*
/*TODO*///		0	???????X	XXXXXXXX	(screen coordinate)
/*TODO*///		1	bottom--	top-----	(screen coordinates)
/*TODO*///		2	XTTTTTTT	YTTTTTTT	(pen data, flipx, flipy)
/*TODO*///		3	????????	?WWWWWWW	(logical width)
/*TODO*///		4	??????ZZ	ZZZZZZZZ	zoom
/*TODO*///		5	PP???CCC	BBBB????	(attributes: bank, priority, color)
/*TODO*///		6,7	(unused)
/*TODO*///	*/
/*TODO*///			while( sprite<finish ){
/*TODO*///				UINT16 attributes = source[5];
/*TODO*///				UINT16 ypos = source[1];
/*TODO*///				int bottom = (ypos>>8)+passshot_y;
/*TODO*///				int top = (ypos&0xff)+passshot_y;
/*TODO*///				sprite.flags = 0;
/*TODO*///	
/*TODO*///				if( bottom>top && ypos!=0xffff ){
/*TODO*///					int bank = (attributes>>4)&0xf;
/*TODO*///					UINT16 number = source[2];
/*TODO*///					UINT16 width = source[3];
/*TODO*///	
/*TODO*///					int zoom = source[4]&0x3ff;
/*TODO*///					int xpos = source[0] + sys16_sprxoffset;
/*TODO*///	
/*TODO*///					sprite.priority = 3-((attributes>>14)&0x3);
/*TODO*///					if (passshot_width != 0) /* 4 player bootleg version */
/*TODO*///					{
/*TODO*///						width=-width;
/*TODO*///						number-=width*(bottom-top-1)-1;
/*TODO*///					}
/*TODO*///	
/*TODO*///					if ((number & 0x8000) != 0) sprite.flags |= SPRITE_FLIPX;
/*TODO*///					if ((width & 0x0080) != 0) sprite.flags |= SPRITE_FLIPY;
/*TODO*///					sprite.flags |= SPRITE_VISIBLE;
/*TODO*///					sprite.pal_data = base_pal + ((attributes>>4)&0x3f0);
/*TODO*///					sprite.total_height = bottom - top;
/*TODO*///					sprite.tile_height = sprite.total_height*(0x400+zoom)/0x400;
/*TODO*///	
/*TODO*///					if (((attributes>>8)&0x3f)==0x3f)	// shadow sprite
/*TODO*///						sprite.flags|= SPRITE_SHADOW;
/*TODO*///						
/*TODO*///					width &= 0x7f;
/*TODO*///	
/*TODO*///					if( sprite.flags&SPRITE_FLIPY ) width = 0x80-width;
/*TODO*///	
/*TODO*///					sprite.tile_width = sprite.line_offset = width*4;
/*TODO*///	
/*TODO*///					if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///						bank = (bank-1) & 0xf;
/*TODO*///						if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///							xpos += 4;
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							number += 1-width;
/*TODO*///						}
/*TODO*///					}
/*TODO*///					sprite.pen_data = base_gfx + number*4 + (sys16_obj_bank[bank] << 17);
/*TODO*///	
/*TODO*///					if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///						sprite.pen_data -= sprite.tile_height*sprite.tile_width;
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ) sprite.pen_data += 2;
/*TODO*///					}
/*TODO*///	
/*TODO*///					sprite.x = xpos;
/*TODO*///					sprite.y = top+2;
/*TODO*///	
/*TODO*///					if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							sprite.tile_width-=4;
/*TODO*///							sprite.pen_data+=4;
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							sprite.pen_data += sprite.line_offset;
/*TODO*///						}
/*TODO*///					}
/*TODO*///	
/*TODO*///					sprite.total_width = sprite.tile_width*(0x800-zoom)/0x800;
/*TODO*///				}
/*TODO*///				sprite++;
/*TODO*///				source += 8;
/*TODO*///			}
/*TODO*///			break;
/*TODO*///	
/*TODO*///			case 4: // Aurail
/*TODO*///	/*
/*TODO*///		0	bottom--	top-----	(screen coordinates)
/*TODO*///		1	???????X	XXXXXXXX	(screen coordinate)
/*TODO*///		2	???????F	FWWWWWWW	(flipx, flipy, logical width)
/*TODO*///		3	TTTTTTTT	TTTTTTTT	(pen data)
/*TODO*///		4	????BBBB	PPCCCCCC	(attributes: bank, priority, color)
/*TODO*///		5	??????ZZ	ZZZZZZZZ	zoomx
/*TODO*///		6	??????ZZ	ZZZZZZZZ	zoomy (defaults to zoomx)
/*TODO*///		7	?						"sprite offset"
/*TODO*///	*/
/*TODO*///			while( sprite<finish ){
/*TODO*///				UINT16 ypos = source[0];
/*TODO*///				UINT16 width = source[2];
/*TODO*///				UINT16 attributes = source[4];
/*TODO*///				int top = ypos&0xff;
/*TODO*///				int bottom = ypos>>8;
/*TODO*///	
/*TODO*///				if( width == sys16_spritelist_end) {
/*TODO*///					do {
/*TODO*///						sprite.flags = 0;
/*TODO*///						sprite++;
/*TODO*///					} while( sprite<finish );
/*TODO*///					break;
/*TODO*///				}
/*TODO*///				sprite.flags = 0;
/*TODO*///				if(bottom !=0 && bottom > top)
/*TODO*///				{
/*TODO*///					UINT16 zoomx = source[5]&0x3ff;
/*TODO*///					UINT16 zoomy = (source[6]&0x3ff);
/*TODO*///					int gfx = source[3]*4;
/*TODO*///		
/*TODO*///					if( zoomy==0 ) zoomy = zoomx; /* if zoomy is 0, use zoomx instead */
/*TODO*///					sprite.pal_data = base_pal + ((attributes&0x3f)<<4);
/*TODO*///	
/*TODO*///					sprite.x = source[1] + sys16_sprxoffset;;
/*TODO*///					sprite.y = top;
/*TODO*///					sprite.priority = 3-((attributes>>6)&0x3);
/*TODO*///	
/*TODO*///					sprite.total_height = bottom-top;
/*TODO*///					sprite.tile_height = sprite.total_height*(0x400+zoomy)/0x400;
/*TODO*///	
/*TODO*///					sprite.line_offset = (width&0x7f)*4;
/*TODO*///	
/*TODO*///					sprite.flags = SPRITE_VISIBLE;
/*TODO*///					if ((width & 0x100) != 0) sprite.flags |= SPRITE_FLIPX;
/*TODO*///					if ((width & 0x080) != 0) sprite.flags |= SPRITE_FLIPY;
/*TODO*///
/*TODO*///					if ((attributes&0x3f)==0x3f)	// shadow sprite
/*TODO*///						sprite.flags|= SPRITE_SHADOW;
/*TODO*///
/*TODO*///					if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///						sprite.line_offset = 512-sprite.line_offset;
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4 - sprite.line_offset*(sprite.tile_height+1);
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx -= sprite.line_offset*sprite.tile_height;
/*TODO*///						}
/*TODO*///					}
/*TODO*///					else {
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4;
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx += sprite.line_offset;
/*TODO*///						}
/*TODO*///					}
/*TODO*///	
/*TODO*///					sprite.tile_width = sprite.line_offset;
/*TODO*///					sprite.total_width = sprite.tile_width*(0x800-zoomx)/0x800;
/*TODO*///					sprite.pen_data = base_gfx + (gfx &0x3ffff) + (sys16_obj_bank[(attributes>>8)&0xf] << 17);
/*TODO*///	
/*TODO*///				}
/*TODO*///				sprite++;
/*TODO*///				source += 8;
/*TODO*///			}
/*TODO*///			break;
/*TODO*///			case 3:	// Fantzone
/*TODO*///				{
/*TODO*///					int spr_no=0;
/*TODO*///					while( sprite<finish ){
/*TODO*///						UINT16 ypos = source[0];
/*TODO*///						UINT16 pal=(source[4]>>8)&0x3f;
/*TODO*///						int top = ypos&0xff;
/*TODO*///						int bottom = ypos>>8;
/*TODO*///	
/*TODO*///						if( bottom == 0xff ){ /* end of spritelist marker */
/*TODO*///							do {
/*TODO*///								sprite.flags = 0;
/*TODO*///								sprite++;
/*TODO*///							} while( sprite<finish );
/*TODO*///							break;
/*TODO*///						}
/*TODO*///						sprite.flags = 0;
/*TODO*///
/*TODO*///						if(bottom !=0 && bottom > top)
/*TODO*///						{
/*TODO*///							UINT16 spr_pri=(source[4])&0xf;
/*TODO*///							UINT16 bank=(source[4]>>4) &0xf;
/*TODO*///							UINT16 tsource[4];
/*TODO*///							UINT16 width;
/*TODO*///							int gfx;
/*TODO*///	
/*TODO*///							if (spr_no==5 && (source[4]&0x00ff) == 0x0021 &&
/*TODO*///								((source[3]&0xff00) == 0x5200 || (source[3]&0xff00) == 0x5300)) spr_pri=2; // tears fix for ending boss
/*TODO*///	
/*TODO*///							tsource[2]=source[2];
/*TODO*///							tsource[3]=source[3];
/*TODO*///	
/*TODO*///							if((tsource[3] & 0x7f80) == 0x7f80)
/*TODO*///							{
/*TODO*///								bank=(bank-1)&0xf;
/*TODO*///								tsource[3]^=0x8000;
/*TODO*///							}
/*TODO*///	
/*TODO*///							tsource[2] &= 0x00ff;
/*TODO*///							if (tsource[3]&0x8000)
/*TODO*///							{ // reverse
/*TODO*///								tsource[2] |= 0x0100;
/*TODO*///								tsource[3] &= 0x7fff;
/*TODO*///							}
/*TODO*///	
/*TODO*///							gfx = tsource[3]*4;
/*TODO*///							width = tsource[2];
/*TODO*///							top++;
/*TODO*///							bottom++;
/*TODO*///	
/*TODO*///							sprite.x = source[1] + sys16_sprxoffset;
/*TODO*///							if(sprite.x > 0x140) sprite.x-=0x200;
/*TODO*///							sprite.y = top;
/*TODO*///							sprite.priority = 3-spr_pri;
/*TODO*///							sprite.pal_data = base_pal + (pal<<4);
/*TODO*///	
/*TODO*///							sprite.total_height = bottom-top;
/*TODO*///							sprite.tile_height = sprite.total_height;
/*TODO*///	
/*TODO*///							sprite.line_offset = (width&0x7f)*4;
/*TODO*///	
/*TODO*///							sprite.flags = SPRITE_VISIBLE;
/*TODO*///							if ((width & 0x100) != 0) sprite.flags |= SPRITE_FLIPX;
/*TODO*///							if ((width & 0x080) != 0) sprite.flags |= SPRITE_FLIPY;
/*TODO*///
/*TODO*///							if (pal==0x3f)	// shadow sprite
/*TODO*///								sprite.flags|= SPRITE_SHADOW;
/*TODO*///	
/*TODO*///							if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///								sprite.line_offset = 512-sprite.line_offset;
/*TODO*///								if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///									gfx += 4 - sprite.line_offset*(sprite.tile_height+1);
/*TODO*///								}
/*TODO*///								else {
/*TODO*///									gfx -= sprite.line_offset*sprite.tile_height;
/*TODO*///								}
/*TODO*///							}
/*TODO*///							else {
/*TODO*///								if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///									gfx += 4;
/*TODO*///								}
/*TODO*///								else {
/*TODO*///									gfx += sprite.line_offset;
/*TODO*///								}
/*TODO*///							}
/*TODO*///	
/*TODO*///							sprite.tile_width = sprite.line_offset;
/*TODO*///							if(width==0) sprite.tile_width=320;			// fixes laser
/*TODO*///							sprite.total_width = sprite.tile_width;
/*TODO*///							sprite.pen_data = base_gfx + (gfx &0x3ffff) + (sys16_obj_bank[bank] << 17);
/*TODO*///	
/*TODO*///						}
/*TODO*///	
/*TODO*///						source+=8;
/*TODO*///						sprite++;
/*TODO*///						spr_no++;
/*TODO*///					}
/*TODO*///				}
/*TODO*///				break;
/*TODO*///			case 2: // Quartet2 /Alexkidd + others
/*TODO*///			while( sprite<finish ){
/*TODO*///				UINT16 ypos = source[0];
/*TODO*///				int top = ypos&0xff;
/*TODO*///				int bottom = ypos>>8;
/*TODO*///	
/*TODO*///				if( bottom == 0xff ){ /* end of spritelist marker */
/*TODO*///					do {
/*TODO*///						sprite.flags = 0;
/*TODO*///						sprite++;
/*TODO*///					} while( sprite<finish );
/*TODO*///					break;
/*TODO*///				}
/*TODO*///				sprite.flags = 0;
/*TODO*///	
/*TODO*///				if(bottom !=0 && bottom > top)
/*TODO*///				{
/*TODO*///					UINT16 spr_pri=(source[4])&0xf;
/*TODO*///					UINT16 bank=(source[4]>>4) &0xf;
/*TODO*///					UINT16 pal=(source[4]>>8)&0x3f;
/*TODO*///					UINT16 tsource[4];
/*TODO*///					UINT16 width;
/*TODO*///					int gfx;
/*TODO*///	
/*TODO*///					tsource[2]=source[2];
/*TODO*///					tsource[3]=source[3];
/*TODO*///	
/*TODO*///					if((tsource[3] & 0x7f80) == 0x7f80)
/*TODO*///					{
/*TODO*///						bank=(bank-1)&0xf;
/*TODO*///						tsource[3]^=0x8000;
/*TODO*///					}
/*TODO*///	
/*TODO*///					tsource[2] &= 0x00ff;
/*TODO*///					if (tsource[3]&0x8000)
/*TODO*///					{ // reverse
/*TODO*///						tsource[2] |= 0x0100;
/*TODO*///						tsource[3] &= 0x7fff;
/*TODO*///					}
/*TODO*///	
/*TODO*///					gfx = tsource[3]*4;
/*TODO*///					width = tsource[2];
/*TODO*///					top++;
/*TODO*///					bottom++;
/*TODO*///	
/*TODO*///					sprite.x = source[1] + sys16_sprxoffset;
/*TODO*///					if(sprite.x > 0x140) sprite.x-=0x200;
/*TODO*///					sprite.y = top;
/*TODO*///					sprite.priority = 3 - spr_pri;
/*TODO*///					sprite.pal_data = base_pal + (pal<<4);
/*TODO*///	
/*TODO*///					sprite.total_height = bottom-top;
/*TODO*///					sprite.tile_height = sprite.total_height;
/*TODO*///	
/*TODO*///					sprite.line_offset = (width&0x7f)*4;
/*TODO*///	
/*TODO*///					sprite.flags = SPRITE_VISIBLE;
/*TODO*///					if ((width & 0x100) != 0) sprite.flags |= SPRITE_FLIPX;
/*TODO*///					if ((width & 0x080) != 0) sprite.flags |= SPRITE_FLIPY;
/*TODO*///
/*TODO*///					if (pal==0x3f)	// shadow sprite
/*TODO*///						sprite.flags|= SPRITE_SHADOW;
/*TODO*///
/*TODO*///					if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///						sprite.line_offset = 512-sprite.line_offset;
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4 - sprite.line_offset*(sprite.tile_height+1);
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx -= sprite.line_offset*sprite.tile_height;
/*TODO*///						}
/*TODO*///					}
/*TODO*///					else {
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4;
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx += sprite.line_offset;
/*TODO*///						}
/*TODO*///					}
/*TODO*///	
/*TODO*///					sprite.tile_width = sprite.line_offset;
/*TODO*///					sprite.total_width = sprite.tile_width;
/*TODO*///					sprite.pen_data = base_gfx + (gfx &0x3ffff) + (sys16_obj_bank[bank] << 17);
/*TODO*///				}
/*TODO*///	
/*TODO*///				source+=8;
/*TODO*///				sprite++;
/*TODO*///			}
/*TODO*///			break;
/*TODO*///			case 5: // Hang-On
/*TODO*///			while( sprite<finish ){
/*TODO*///				UINT16 ypos = source[0];
/*TODO*///				int top = ypos&0xff;
/*TODO*///				int bottom = ypos>>8;
/*TODO*///	
/*TODO*///				if( bottom == 0xff ){ /* end of spritelist marker */
/*TODO*///					do {
/*TODO*///						sprite.flags = 0;
/*TODO*///						sprite++;
/*TODO*///					} while( sprite<finish );
/*TODO*///					break;
/*TODO*///				}
/*TODO*///				sprite.flags = 0;
/*TODO*///	
/*TODO*///				if(bottom !=0 && bottom > top)
/*TODO*///				{
/*TODO*///					UINT16 bank=(source[1]>>12);
/*TODO*///					UINT16 pal=(source[4]>>8)&0x3f;
/*TODO*///					UINT16 tsource[4];
/*TODO*///					UINT16 width;
/*TODO*///					int gfx;
/*TODO*///					int zoomx,zoomy;
/*TODO*///	
/*TODO*///					tsource[2]=source[2];
/*TODO*///					tsource[3]=source[3];
/*TODO*///	
/*TODO*///					zoomx=((source[4]>>2) & 0x3f) *(1024/64);
/*TODO*///			        zoomy = (1060*zoomx)/(2048-zoomx);
/*TODO*///	
/*TODO*///	//				if (pal==0x3f)	// ????????????
/*TODO*///	//					pal=(bank<<1);
/*TODO*///	
/*TODO*///					if((tsource[3] & 0x7f80) == 0x7f80)
/*TODO*///					{
/*TODO*///						bank=(bank-1)&0xf;
/*TODO*///						tsource[3]^=0x8000;
/*TODO*///					}
/*TODO*///	
/*TODO*///					if (tsource[3]&0x8000)
/*TODO*///					{ // reverse
/*TODO*///						tsource[2] |= 0x0100;
/*TODO*///						tsource[3] &= 0x7fff;
/*TODO*///					}
/*TODO*///	
/*TODO*///					gfx = tsource[3]*4;
/*TODO*///					width = tsource[2];
/*TODO*///	
/*TODO*///					sprite.x = ((source[1] & 0x3ff) + sys16_sprxoffset);
/*TODO*///					if(sprite.x >= 0x200) sprite.x-=0x200;
/*TODO*///					sprite.y = top;
/*TODO*///					sprite.priority = 0;
/*TODO*///					sprite.pal_data = base_pal + (pal<<4);
/*TODO*///	
/*TODO*///					sprite.total_height = bottom-top;
/*TODO*///					sprite.tile_height = sprite.total_height*(0x400+zoomy)/0x400;
/*TODO*///	
/*TODO*///					sprite.line_offset = (width&0x7f)*4;
/*TODO*///	
/*TODO*///					sprite.flags = SPRITE_VISIBLE;
/*TODO*///					if ((width & 0x100) != 0) sprite.flags |= SPRITE_FLIPX;
/*TODO*///					if ((width & 0x080) != 0) sprite.flags |= SPRITE_FLIPY;
/*TODO*///	
/*TODO*///	
/*TODO*///	//				sprite.flags|= SPRITE_PARTIAL_SHADOW;
/*TODO*///	//				sprite.shadow_pen=10;
/*TODO*///	
/*TODO*///					if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///						sprite.line_offset = 512-sprite.line_offset;
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4 - sprite.line_offset*(sprite.tile_height+1);
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx -= sprite.line_offset*sprite.tile_height;
/*TODO*///						}
/*TODO*///					}
/*TODO*///					else {
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4;
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx += sprite.line_offset;
/*TODO*///						}
/*TODO*///					}
/*TODO*///	
/*TODO*///					sprite.tile_width = sprite.line_offset;
/*TODO*///					sprite.total_width = sprite.tile_width*(0x0800 - zoomx)/0x800;
/*TODO*///					sprite.pen_data = base_gfx + (gfx &0x3ffff) + (sys16_obj_bank[bank] << 17);
/*TODO*///	
/*TODO*///				}
/*TODO*///	
/*TODO*///				source+=8;
/*TODO*///				sprite++;
/*TODO*///			}
/*TODO*///			break;
/*TODO*///			case 6: // Space Harrier
/*TODO*///			while( sprite<finish ){
/*TODO*///				UINT16 ypos = source[0];
/*TODO*///				int top = ypos&0xff;
/*TODO*///				int bottom = ypos>>8;
/*TODO*///	
/*TODO*///				if( bottom == 0xff ){ /* end of spritelist marker */
/*TODO*///					do {
/*TODO*///						sprite.flags = 0;
/*TODO*///						sprite++;
/*TODO*///					} while( sprite<finish );
/*TODO*///					break;
/*TODO*///				}
/*TODO*///				sprite.flags = 0;
/*TODO*///	
/*TODO*///				if(bottom !=0 && bottom > top)
/*TODO*///				{
/*TODO*///					UINT16 bank=(source[1]>>12);
/*TODO*///					UINT16 pal=(source[2]>>8)&0x3f;
/*TODO*///					UINT16 tsource[4];
/*TODO*///					UINT16 width;
/*TODO*///					int gfx;
/*TODO*///					int zoomx,zoomy;
/*TODO*///	
/*TODO*///					tsource[2]=source[2]&0xff;
/*TODO*///					tsource[3]=source[3];
/*TODO*///	
/*TODO*///					zoomx=(source[4] & 0x3f) *(1024/64);
/*TODO*///			        zoomy = (1024*zoomx)/(2048-zoomx);
/*TODO*///	
/*TODO*///					if((tsource[3] & 0x7f80) == 0x7f80)
/*TODO*///					{
/*TODO*///						bank=(bank-1)&0xf;
/*TODO*///						tsource[3]^=0x8000;
/*TODO*///					}
/*TODO*///	
/*TODO*///					if (tsource[3]&0x8000)
/*TODO*///					{ // reverse
/*TODO*///						tsource[2] |= 0x0100;
/*TODO*///						tsource[3] &= 0x7fff;
/*TODO*///					}
/*TODO*///	
/*TODO*///					gfx = tsource[3]*4;
/*TODO*///					width = tsource[2];
/*TODO*///	
/*TODO*///					sprite.x = ((source[1] & 0x3ff) + sys16_sprxoffset);
/*TODO*///					if(sprite.x >= 0x200) sprite.x-=0x200;
/*TODO*///					sprite.y = top+1;
/*TODO*///					sprite.priority = 0;
/*TODO*///					sprite.pal_data = base_pal + (pal<<4);
/*TODO*///	
/*TODO*///					sprite.total_height = bottom-top;
/*TODO*///	//				sprite.tile_height = sprite.total_height*(0x400+zoomy)/0x400;
/*TODO*///					sprite.tile_height = ((sprite.total_height)<<4|0xf)*(0x400+zoomy)/0x4000;
/*TODO*///	
/*TODO*///					sprite.line_offset = (width&0x7f)*4;
/*TODO*///	
/*TODO*///					sprite.flags = SPRITE_VISIBLE;
/*TODO*///					if ((width & 0x100) != 0) sprite.flags |= SPRITE_FLIPX;
/*TODO*///					if ((width & 0x080) != 0) sprite.flags |= SPRITE_FLIPY;
/*TODO*///	
/*TODO*///					if (sys16_sh_shadowpal == 0)		// space harrier
/*TODO*///					{
/*TODO*///						if (pal==sys16_sh_shadowpal)	// shadow sprite
/*TODO*///							sprite.flags|= SPRITE_SHADOW;
/*TODO*///						// I think this looks better, but I'm sure it's wrong.
/*TODO*///	//					else if(READ_WORD(&paletteram[2048+pal*2+20]) == 0)
/*TODO*///	//					{
/*TODO*///	//						sprite.flags|= SPRITE_PARTIAL_SHADOW;
/*TODO*///	//						sprite.shadow_pen=10;
/*TODO*///	//					}
/*TODO*///					}
/*TODO*///					else								// enduro
/*TODO*///					{
/*TODO*///						sprite.flags|= SPRITE_PARTIAL_SHADOW;
/*TODO*///						sprite.shadow_pen=10;
/*TODO*///					}
/*TODO*///					if( sprite.flags&SPRITE_FLIPY ){
/*TODO*///						sprite.line_offset = 512-sprite.line_offset;
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4 - sprite.line_offset*(sprite.tile_height+1) /*+4*/;
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx -= sprite.line_offset*sprite.tile_height;
/*TODO*///						}
/*TODO*///					}
/*TODO*///					else {
/*TODO*///						if( sprite.flags&SPRITE_FLIPX ){
/*TODO*///							gfx += 4 /*+ 4*/;		// +2 ???
/*TODO*///						}
/*TODO*///						else {
/*TODO*///							gfx += sprite.line_offset;
/*TODO*///						}
/*TODO*///					}
/*TODO*///	
/*TODO*///					sprite.line_offset<<=1;
/*TODO*///					sprite.tile_width = sprite.line_offset;
/*TODO*///					sprite.total_width = sprite.tile_width*(0x0800 - zoomx)/0x800;
/*TODO*///	
/*TODO*///					sprite.pen_data = base_gfx + (((gfx &0x3ffff) + (sys16_obj_bank[bank] << 17)) << 1);
/*TODO*///				}
/*TODO*///	
/*TODO*///				source+=8;
/*TODO*///				sprite++;
/*TODO*///			}
/*TODO*///			break;
/*TODO*///			case 7: // Out Run
/*TODO*///			while( sprite<finish ){
/*TODO*///	
/*TODO*///				if( source[0] == 0xffff ){ /* end of spritelist marker */
/*TODO*///					do {
/*TODO*///						sprite.flags = 0;
/*TODO*///						sprite++;
/*TODO*///					} while( sprite<finish );
/*TODO*///					break;
/*TODO*///				}
/*TODO*///				sprite.flags = 0;
/*TODO*///	
/*TODO*///				if (!(source[0]&0x4000))
/*TODO*///				{
/*TODO*///					UINT16 bank=(source[0]>>8)&7;
/*TODO*///					UINT16 pal=(source[5])&0x7f;
/*TODO*///					UINT16 width;
/*TODO*///					int gfx;
/*TODO*///					int zoom;
/*TODO*///					int x;
/*TODO*///	
/*TODO*///					zoom=source[4]&0xfff;
/*TODO*///	//				if (zoom==0x32c) zoom=0x3cf;	//???
/*TODO*///	
/*TODO*///					if(zoom==0) zoom=1;
/*TODO*///	
/*TODO*///					if (source[1]&0x8000) bank=(bank+1)&0x7;
/*TODO*///	
/*TODO*///					gfx = (source[1]&0x7fff)*4;
/*TODO*///					width = source[2]>>9;
/*TODO*///	
/*TODO*///					x = (source[2] & 0x1ff);
/*TODO*///	
/*TODO*///					// patch misplaced sprite on map
/*TODO*///	//				if(zoom == 0x3f0 && source[1]==0x142e && (source[0]&0xff)==0x19)
/*TODO*///	//					x-=2;
/*TODO*///	
/*TODO*///					sprite.y = source[0]&0xff;
/*TODO*///					sprite.priority = 0;
/*TODO*///					sprite.pal_data = base_pal + (pal<<4) + 1024;
/*TODO*///	
/*TODO*///					sprite.total_height = (source[5]>>8)+1;
/*TODO*///					sprite.tile_height = ((sprite.total_height<<4)| 0xf)*(zoom)/0x2000;
/*TODO*///	
/*TODO*///					sprite.line_offset = (width&0x7f)*4;
/*TODO*///	
/*TODO*///					sprite.flags = SPRITE_VISIBLE;
/*TODO*///					if(pal==0)
/*TODO*///						sprite.flags|= SPRITE_SHADOW;
/*TODO*///					else if(source[3]&0x4000)
/*TODO*///	//				if(pal==0 || source[3]&0x4000)
/*TODO*///					{
/*TODO*///						sprite.flags|= SPRITE_PARTIAL_SHADOW;
/*TODO*///						sprite.shadow_pen=10;
/*TODO*///					}
/*TODO*///					if(!(source[4]&0x2000))
/*TODO*///					{
/*TODO*///						if(!(source[4]&0x4000))
/*TODO*///						{
/*TODO*///							// Should be drawn right to left, but this should be ok.
/*TODO*///							x-=(sprite.line_offset*2)*0x200/zoom;
/*TODO*///							gfx+=4-sprite.line_offset;
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							int ofs=(sprite.line_offset*2)*0x200/zoom;
/*TODO*///							x-=ofs;
/*TODO*///							sprite.flags |= SPRITE_FLIPX;
/*TODO*///	
/*TODO*///							// x position compensation for rocks in round2R and round4RRR
/*TODO*///	/*						if((source[0]&0xff00)==0x0300)
/*TODO*///							{
/*TODO*///								if (source[1]==0xc027)
/*TODO*///								{
/*TODO*///									if ((source[2]>>8)==0x59) x += ofs/2;
/*TODO*///									else if ((source[2]>>8)>0x59) x += ofs;
/*TODO*///								}
/*TODO*///								else if (source[1]==0xcf73)
/*TODO*///								{
/*TODO*///									if ((source[2]>>8)==0x2d) x += ofs/2;
/*TODO*///									else if ((source[2]>>8)>0x2d) x += ofs;
/*TODO*///								}
/*TODO*///								else if (source[1]==0xd3046)
/*TODO*///								{
/*TODO*///									if ((source[2]>>8)==0x19) x += ofs/2;
/*TODO*///									else if ((source[2]>>8)>0x19) x += ofs;
/*TODO*///								}
/*TODO*///								else if (source[1]==0xd44e)
/*TODO*///								{
/*TODO*///									if ((source[2]>>8)==0x0d) x += ofs/2;
/*TODO*///									else if ((source[2]>>8)>0x0d) x += ofs;
/*TODO*///								}
/*TODO*///								else if (source[1]==0xd490)
/*TODO*///								{
/*TODO*///									if ((source[2]>>8)==0x09) x += ofs/2;
/*TODO*///									else if ((source[2]>>8)>0x09) x += ofs;
/*TODO*///								}
/*TODO*///							}
/*TODO*///	*/
/*TODO*///						}
/*TODO*///					}
/*TODO*///					else
/*TODO*///					{
/*TODO*///						if(!(source[4]&0x4000))
/*TODO*///						{
/*TODO*///							gfx-=sprite.line_offset-4;
/*TODO*///							sprite.flags |= SPRITE_FLIPX;
/*TODO*///						}
/*TODO*///						else
/*TODO*///						{
/*TODO*///							if (source[4]&0x8000)
/*TODO*///							{ // patch for car shadow position
/*TODO*///								if (source[4]==0xe1a9 && source[1]==0x5817)
/*TODO*///									x-=2;
/*TODO*///							}
/*TODO*///						}
/*TODO*///					}
/*TODO*///	
/*TODO*///					sprite.x = x + sys16_sprxoffset;
/*TODO*///	
/*TODO*///					sprite.line_offset<<=1;
/*TODO*///					sprite.tile_width = sprite.line_offset;
/*TODO*///					sprite.total_width = sprite.tile_width*0x200/zoom;
/*TODO*///					sprite.pen_data = base_gfx + (((gfx &0x3ffff) + (sys16_obj_bank[bank] << 17)) << 1);
/*TODO*///				}
/*TODO*///				source+=8;
/*TODO*///				sprite++;
/*TODO*///			}
/*TODO*///			break;
		}
	}