public static void m92_screenrefresh(osd_bitmap bitmap,rectangle clip)
	{
		if (pf3_shape != 0) /* Updating all tilemaps causes palette overflow */
			tilemap_update(pf3_wide_layer);
		else
			tilemap_update(pf3_layer);
		tilemap_update(pf2_layer);
		if (pf1_shape != 0)
			tilemap_update(pf1_wide_layer);
		else
			tilemap_update(pf1_layer);
	
		if (RYPELEO_SPEEDUP() != 0) tilemap_update(pf1_hlayer);
	
		/* This should be done once a frame only... but we can almost get away with it */
		palette_init_used_colors();
		mark_sprite_colours();
		if (palette_recalc()!=null)
			tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);
	
		tilemap_render(ALL_TILEMAPS);
	
		if (pf3_enable != 0) {
			tilemap_draw(bitmap,pf3_wide_layer,TILEMAP_BACK);
			tilemap_draw(bitmap,pf3_layer,TILEMAP_BACK);
		}
		else
			fillbitmap(bitmap,palette_transparent_pen,clip);
	
		tilemap_draw(bitmap,pf2_layer,TILEMAP_BACK);
		tilemap_draw(bitmap,pf1_wide_layer,TILEMAP_BACK);
		if (RYPELEO_SPEEDUP()!=0 && pf1_vram_ptr==0xc000)
			tilemap_draw(bitmap,pf1_hlayer,TILEMAP_BACK);
		else
			tilemap_draw(bitmap,pf1_layer,TILEMAP_BACK);
	
		m92_drawsprites(bitmap,clip,0);
	
		tilemap_draw(bitmap,pf3_wide_layer,TILEMAP_FRONT);
		tilemap_draw(bitmap,pf3_layer,TILEMAP_FRONT);
		tilemap_draw(bitmap,pf2_layer,TILEMAP_FRONT);
		tilemap_draw(bitmap,pf1_wide_layer,TILEMAP_FRONT);
		if (RYPELEO_SPEEDUP()!=0 && pf1_vram_ptr==0xc000)
			tilemap_draw(bitmap,pf1_hlayer,TILEMAP_FRONT);
		else
			tilemap_draw(bitmap,pf1_layer,TILEMAP_FRONT);
	
		m92_drawsprites(bitmap,clip,1); /* These sprites are over all playfields */
	}