public static WriteHandlerPtr astinvad_sh_port_5_w = new WriteHandlerPtr() { public void handler(int offset, int data)
	{

		int bitsChanged;
		int bitsGoneHigh;
		int bitsGoneLow;
	
	
		bitsChanged  = port5State ^ data;
		bitsGoneHigh = bitsChanged & data;
		bitsGoneLow  = bitsChanged & ~data;
	
		port5State = data;
	
	
		if ((bitsGoneHigh & OUT_PORT_5_FLEET1) != 0)  PLAY( SND_FLEET1, 0 );
	
		if ((bitsGoneHigh & OUT_PORT_5_FLEET2) != 0)  PLAY( SND_FLEET2, 0 );
	
		if ((bitsGoneHigh & OUT_PORT_5_FLEET3) != 0)  PLAY( SND_FLEET3, 0 );
	
		if ((bitsGoneHigh & OUT_PORT_5_FLEET4) != 0)  PLAY( SND_FLEET4, 0 );
	
		if ((bitsGoneHigh & OUT_PORT_5_UFO2) != 0)  PLAY( SND_UFO2, 0 );
		if ((bitsGoneLow & OUT_PORT_5_UFO2) != 0)  STOP( SND_UFO2 );
	
		if ((bitsChanged & OUT_PORT_5_FLIP) != 0)  invaders_flipscreen_w(data & 0x20);
	
		if (((bitsChanged  & OUT_PORT_5_UNUSED)!=0) && errorlog!=null)  fprintf(errorlog, "Snd Port 5 = %02X\n", data & OUT_PORT_5_UNUSED);
	} }