public static konami_cpu_setlines_callbackPtr k88games_banking = new konami_cpu_setlines_callbackPtr() { public void handler(int lines)
        {
		UBytePtr RAM = memory_region(REGION_CPU1);
		int offs;
	
                if (errorlog!=null) fprintf(errorlog,"%04x: bank select %02x\n",cpu_get_pc(),lines);
	
		/* bits 0-2 select ROM bank for 0000-1fff */
		/* bit 3: when 1, palette RAM at 1000-1fff */
		/* bit 4: when 0, 051316 RAM at 3800-3fff; when 1, work RAM at 2000-3fff (NVRAM 3370-37ff) */
		offs = 0x10000 + (lines & 0x07) * 0x2000;
		
                for(int i=0; i<0x1000; i++) RAM.write(RAM.offset+i,RAM.read(offs+i));//memcpy(RAM,&RAM[offs],0x1000);
		if ((lines & 0x08)!=0)
		{
			if (paletteram.read() != RAM.read(0x1000))
			{
                                int base = paletteram.offset;
				for(int i=0; i<0x1000; i++) RAM.write(i+0x1000,paletteram.read(i));//memcpy(&RAM[0x1000],paletteram,0x1000);
				paletteram = new UBytePtr(RAM,0x1000);//paletteram = &RAM[0x1000];
			}
		}
		else
		{
			if (paletteram.read() != RAM.read(0x20000))
			{
                                int base = paletteram.offset;
				for(int i=0; i<0x1000; i++) RAM.write(i+0x20000,paletteram.read(base+i));//memcpy(&RAM[0x20000],paletteram,0x1000);
				paletteram = new UBytePtr(RAM,0x20000);//paletteram = &RAM[0x20000];
			}
			for(int i=0; i<0x1000; i++) RAM.write(i+0x1000,RAM.read(i+offs+0x1000));//memcpy(&RAM[0x1000],&RAM[offs+0x1000],0x1000);
		}
		videobank = lines & 0x10;
	
		/* bit 5 = enable char ROM reading through the video RAM */
		K052109_set_RMRD_line((lines & 0x20)!=0 ? ASSERT_LINE : CLEAR_LINE);
	
		/* bit 6 is unknown, 1 most of the time */
	
		/* bit 7 controls layer priority */
		k88games_priority = lines & 0x80;
	}}