public static ReadHandlerPtr z80_port_r = new ReadHandlerPtr() { public int handler(int offset)
	{
		switch (offset & 0xff)
		{
			case 0x00:
				pending_command = 0;
				return soundlatch_r.handler(0);				
			case 0x04:
				return YM2610_status_port_0_A_r.handler(0);
	
			case 0x05:
				return YM2610_read_port_0_r.handler(0);
	
			case 0x06:
				return YM2610_status_port_0_B_r.handler(0);	
			case 0x08:
				{
					UBytePtr RAM = memory_region(REGION_CPU2);
					z80_bank[3] = 0x0800 * ((offset >> 8) & 0x7f);
					cpu_setbank(8,new UBytePtr(RAM,z80_bank[3]));
					return 0;
					
				}
	
			case 0x09:
				{
					UBytePtr RAM = memory_region(REGION_CPU2);
					z80_bank[2] = 0x1000 * ((offset >> 8) & 0x3f);
					cpu_setbank(7,new UBytePtr(RAM,z80_bank[2]));
					return 0;
					
				}
	
			case 0x0a:
				{
					UBytePtr RAM = memory_region(REGION_CPU2);
					z80_bank[1] = 0x2000 * ((offset >> 8) & 0x1f);
					cpu_setbank(6,new UBytePtr(RAM,z80_bank[1]));
					return 0;
					
				}
	
			case 0x0b:
				{
					UBytePtr RAM = memory_region(REGION_CPU2);
					z80_bank[0] = 0x4000 * ((offset >> 8) & 0x0f);
					cpu_setbank(5,new UBytePtr(RAM,z80_bank[0]));
					return 0;
					
				}
	
			default:
	if (errorlog!=null) fprintf(errorlog,"CPU #1 PC %04x: read unmapped port %02x\n",cpu_get_pc(),offset&0xff);
				return 0;
				
		}
	} }