public static WriteHandlerPtr get_bg_tile_info = new WriteHandlerPtr() { public void handler(int col, int row){
		UShortPtr source = new UShortPtr(sys16_tileram);
	
		if( row<32 ){
			if( col<64 ){
				source.offset += (64*32*sys16_bg_page[0])*2;
			}
			else {
				source.offset += (64*32*sys16_bg_page[1])*2;
			}
		}
		else {
			if( col<64 ){
				source.offset += (64*32*sys16_bg_page[2])*2;
			}
			else {
				source.offset += (64*32*sys16_bg_page[3])*2;
			}
		}
		row = row%32;
		col = col%64;
	
		{
			int data = source.read(row*64+col);
			int tile_number = (data&0xfff) +
					0x1000*((data&sys16_tilebank_switch)!=0?sys16_tile_bank1:sys16_tile_bank0);
	
			if(sys16_textmode==0)
			{
				SET_TILE_INFO( 0, tile_number, (data>>6)&0x7f );
			}
			else
			{
				SET_TILE_INFO( 0, tile_number, (data>>5)&0x7f );
			}
			switch(sys16_bg_priority_mode) {
				case 1:		// Alien Syndrome
					tile_info.priority = (data&0x8000)!=0?(char)1:(char)0;
					break;
				case 2:		// Body Slam / wrestwar
					if((data&0xff00) >= sys16_bg_priority_value)
						tile_info.priority = 1;
					else
						tile_info.priority = 0;
					break;
				case 3:		// sys18 games
					if ((data & 0x8000) != 0)
						tile_info.priority = 2;
					else if((data&0xff00) >= sys16_bg_priority_value)
						tile_info.priority = 1;
					else
						tile_info.priority = 0;
					break;
			}
		}
	} }