static void ldrun_draw_background(osd_bitmap bitmap, int prioritylayer)
	{
		int offs;
	
	
		/* for every character in the Video RAM, check if it has been modified */
		/* since last time and update it accordingly. */
		for (offs = videoram_size[0]-2;offs >= 0;offs -= 2)
		{
			if ((dirtybuffer[offs]!=0 || dirtybuffer[offs+1]!=0) && !(prioritylayer==0 && (videoram.read(offs+1) & 0x04)!=0))
			{
				int sx,sy,flipx;
	
	
				dirtybuffer[offs] = 0;
				dirtybuffer[offs+1] = 0;
	
				sx = (offs/2) % 64;
				sy = (offs/2) / 64;
				flipx = videoram.read(offs+1) & 0x20;
	
				if (flipscreen != 0)
				{
					sx = 63 - sx;
					sy = 31 - sy;
					flipx = NOT(flipx);
				}
	
				drawgfx(tmpbitmap,Machine.gfx[0],
						videoram.read(offs) + ((videoram.read(offs+1) & 0xc0) << 2),
						videoram.read(offs+1) & 0x1f,
						flipx,flipscreen,
						8*sx,8*sy,
						null,TRANSPARENCY_NONE,0);
			}
		}
	
	
		{
			int scrolly;	/* ldrun3 only */
	
			if (flipscreen != 0)
				scrolly = irem_background_vscroll;
			else
				scrolly = -irem_background_vscroll;
	
			if (prioritylayer != 0)
			{
				copyscrollbitmap(bitmap,tmpbitmap,0,null,1,new int[]{scrolly},Machine.drv.visible_area,TRANSPARENCY_PEN,Machine.pens[0]);
			}
			else
			{
				copyscrollbitmap(bitmap,tmpbitmap,0,null,1,new int[] {scrolly},Machine.drv.visible_area,TRANSPARENCY_NONE,0);
			}
		}
	}