public static ReadHandlerPtr inputport_r = new ReadHandlerPtr() { public int handler(int offset)
	{
		int data = 0;
	
		switch (inputport_selected){
			case 0x00:	/* DSW A (bits 0-4) */
				data = ~(reverse_bitstrm(readinputport(0) & 0x1f)); break;
			case 0x01:	/* DSW A (bits 5-7), DSW B (bits 0-1) */
				data = ~(reverse_bitstrm((((readinputport(0) & 0xe0) >> 5) | ((readinputport(1) & 0x03) << 3)))); break;
			case 0x02:	/* DSW B (bits 2-6) */
				data = ~(reverse_bitstrm(((readinputport(1) & 0x7c) >> 2))); break;
			case 0x03:	/* DSW B (bit 7), DSW C (bits 0-3) */
				data = ~(reverse_bitstrm((((readinputport(1) & 0x80) >> 7) | ((readinputport(2) & 0x0f) << 1)))); break;
			case 0x04:	/* coins, start */
				data = ~(readinputport(3)); break;
			case 0x05:	/* 2P controls */
				data = ~(readinputport(5)); break;
			case 0x06:	/* 1P controls */
				data = ~(readinputport(4)); break;
			default:
				data = 0xff;
		}
	
		return data;
	} }