public static WriteHandlerPtr neo_bankswitch_w = new WriteHandlerPtr() { public void handler(int offset, int data)
	{
		UBytePtr RAM = memory_region(REGION_CPU1);
		int bankaddress;
	
	
		if (memory_region_length(REGION_CPU1) <= 0x100000)
		{
	if (errorlog!=null) fprintf(errorlog,"warning: bankswitch to %02x but no banks available\n",data);
			return;
		}
	
		data = data&0x7;
		bankaddress = (data+1)*0x100000;
		if (bankaddress >= memory_region_length(REGION_CPU1))
		{
	if (errorlog!=null) fprintf(errorlog,"PC %06x: warning: bankswitch to empty bank %02x\n",cpu_get_pc(),data);
			bankaddress = 0x100000;
		}
	
		cpu_setbank(4,new UBytePtr(RAM,bankaddress));
	} }