public static WriteHandlerPtr galaga_customio_w = new WriteHandlerPtr() { public void handler(int offset, int data)
	{
	//if (errorlog && data != 0x10 && data != 0x71) fprintf(errorlog,"%04x: custom IO command %02x\n",cpu_get_pc(),data);
	
		customio_command = data;
	
		switch (data)
		{
			case 0x10:
				if (nmi_timer != null) timer_remove (nmi_timer);
				nmi_timer = null;
				return;
	
			case 0xa1:	/* go into switch mode */
				mode = 1;
				break;
	
			case 0xe1:	/* go into credit mode */
				credits = 0;	/* this is a good time to reset the credits counter */
				mode = 0;
				break;
		}
	
		nmi_timer = timer_pulse (TIME_IN_USEC (50), 0, galaga_nmi_generate);
	} }