- (void)drawCF:(unsigned char)x code:(unsigned char)cfCode offset:(unsigned char)os
{
	int i,j;
	
	unsigned char nc;		// No Ceiling Flag
	unsigned char flags;
	unsigned char layerGroup;
	unsigned char mask;
	unsigned char b,v;
	unsigned char start,end;
	
	// This needs the bank calculation for shared tileLayer data (cw used for now)
	
	// add i as other parameter
	// get the next 0D object's x offset and stop the CF loop at this offset
	
	end = x;
	os += 2;
	unsigned char nb = areaData[cw][cd][0];
	for (i=os; i<nb; i+=2) {
		if (areaData[cw][cd][i+1] == 0xF0 && (areaData[cw][cd][i] & 0xF0) < 0xD0) {
			end += areaData[cw][cd][i] & 0x0F;
			i++; continue;
		}
		if ((areaData[cw][cd][i] & 0xF0) == 0xD0) break;
		end += areaData[cw][cd][i] & 0x0F;
	}
	
	if (x == 0) end = 0x40;
	NSLog(@"Start End : %X %X",x,end);
	
	flags = areaData[cw][cd][2]; //NSLog(@"cfCode : %02X",cfCode);
	nc = (flags >> 7); //NSLog(@"nc : %X",nc);
	layerGroup = (flags & 0x70) >> 4; //NSLog(@"layerGroup : %02X",layerGroup);
	
	ptr = [rom bytes] + 0x1C735 + (cfCode * 2) + 0x10; //NSLog(@"maskCode : %02X",*ptr);
	
	if (nc == 0) { mask = 0xE0; start = 0; }
	else { mask = 0x38; start = 2; }
	b = *ptr;
	for (i=start; i<6; i++) {
		v = (b & mask) >> (5 - i);
		mask >>= 1;
		//NSLog(@"Row %X : %02X (%02X)",i,v,tileLayers[cw][layerGroup][v]);
		for (j=x; j<end; j++) {
			if (tileLayers[cw][layerGroup][v] == 0x40) continue;
			[[self cellAtRow:i column:j] setImage:[tiles objectAtIndex:tileLayers[cw][layerGroup][v]]]; [self display];
		}
	}
	
	mask = 0xE0;
	b = *(ptr + 1);
	for (i=0; i<6; i++) {
		v = (b & mask) >> (5 - i);
		mask >>= 1;
		//NSLog(@"Row %X : %02X (%02X)",i+6,v,tileLayers[cw][layerGroup][v]);
		for (j=x; j<end; j++) {
			if (tileLayers[cw][layerGroup][v] == 0x40) continue;
			[[self cellAtRow:i+6 column:j] setImage:[tiles objectAtIndex:tileLayers[cw][layerGroup][v]]]; [self display];
		}
	}
	
	for (i=x; i<0x40; i++) {
		[[self cellAtRow:0xC column:i] setImage:[tiles objectAtIndex:tileLayers[cw][layerGroup][8]]]; [self display];
	}
	//NSLog(@"----");
}