- (void)loadTiles:(int)set
{
	if (tiles != nil) [tiles release];
	tiles = [[NSMutableArray alloc] initWithCapacity:64];
	
	[self renewRows:1 columns:64];
	[self sizeToCells];
	
	int max;
	switch (set) {
		case 1: max = 15;
	}
	
	NSImage *tt;
	
	int sr = mapScale;		// Scale Ratio
	int wh = sr * 8 * 2;
	
	NSImage *tileFinal;
	NSBitmapImageRep *tileRep;
	
	unsigned char *pf;
	const unsigned char *ptr;
	const unsigned char *palPtr;
	const unsigned char *tm;
	int os;
	
	int i,j,k;
	int x,y,z;
	for (i=0; i<max; i++) {
		
		palPtr = [rom bytes] + 0x402A;
		tm = [rom bytes] + tmos[0][i];
		
		tileFinal = [[NSImage alloc] initWithSize:NSMakeSize(wh,wh)];
		tileRep = [[NSBitmapImageRep alloc] 
				initWithBitmapDataPlanes:NULL
							  pixelsWide:wh
							  pixelsHigh:wh
						   bitsPerSample:8
						 samplesPerPixel:4
								hasAlpha:YES
								isPlanar:NO
						  colorSpaceName:NSCalibratedRGBColorSpace
							 bytesPerRow:NULL
							bitsPerPixel:NULL];
		
		pf = [tileRep bitmapData];
		//NSLog(@"OK! - pforig = %X",pf);
		
		struct sCol tp[4];		// = { nesPal[0x0F] , nesPal[0x30] , nesPal[0x27] , nesPal[0x2A] };
		for (x=0; x<4; x++) {
			tp[x] = nesPal[*(palPtr + x)];
			NSLog(@"Color %d = %X",x,*(palPtr + x));
		}
		
		for (j=0; j<2; j++) {
			for (k=0; k<2; k++) {
				
				os = 0x20010 + (0x2000 * set) + ((*tm + 0x100) * 0x10); NSLog(@"os : %X",os);
				tt = [self tileWithOffset:os palette:tp];
				ptr = [[[tt representations] lastObject] bitmapData];
				
				tm++;
				
				for (y=0; y<(8 * sr); y++) {
					for (z=0; z<(8 * 4 * sr); z++) {
						*pf++ = *ptr++;
					}
					pf += (8 * 4 * sr);
				}
			}
			
			pf = [tileRep bitmapData] + (8 * 4 * sr);
			
		}
		
		[tileFinal addRepresentation:tileRep];
		[tiles addObject:tileFinal];
		[tt release];
		
		[tileFinal release];
		[tileRep release];
		
		[[self cellAtRow:0 column:i] setImage:[tiles lastObject]];
		
	}
}