public void updateImage(byte[] videoRam, int offset, int attribs) {
			int px, py;
			int rgbValue;

			if (image[attribs] == null) {
				allocateImage(attribs);
			}

			GameboyPalette pal;

			if (offset == 0x31E0) {
				//	 System.out.println("window updated with " + JavaBoy.hexByte(attribs) + " xflip = " + (attribs & TILE_FLIPX) + "  yflip = " + (attribs & TILE_FLIPY));
			}

			if (dmgcpu.isGbcFeatures()) {
				if (attribs < 32) {
					pal = gbcBackground[attribs >> 2];
				} else {
					pal = gbcSprite[(attribs >> 2) - 8];
				}
			} else {
				if ((attribs & TILE_OBJ1) != 0) {
					pal = obj1Palette;
				} else if ((attribs & TILE_OBJ2) != 0) {
					pal = obj2Palette;
				} else {
					pal = backgroundPalette;
				}
			}

			for (int y = 0; y < 8; y++) {
				for (int x = 0; x < 8; x++) {

					if ((attribs & TILE_FLIPX) != 0) {
						px = 7 - x;
					} else {
						px = x;
					}
					if ((attribs & TILE_FLIPY) != 0) {
						py = 7 - y;
					} else {
						py = y;
					}

					int pixelColorLower = (videoRam[offset + (py * 2)] & (0x80 >> px)) >> (7 - px);
						int pixelColorUpper = (videoRam[offset + (py * 2) + 1] & (0x80 >> px)) >> (7 - px);

			int entryNumber = (pixelColorUpper * 2) + pixelColorLower;
			int pixelColor = pal.getEntry(entryNumber);

			/*     switch (pixelColor) {
      case 0 : rgbValue = 0xFFFFFFFF;
               break;
      case 1 : rgbValue = 0xFFAAAAAA;
               break;
      case 2 : rgbValue = 0xFF555555;
               break;
      default :
      case 3 : rgbValue = 0xFF000000;
               break;
     }*/
			rgbValue = pal.getRgbEntry(entryNumber);

			/* Turn on transparency for background */

			if ((!dmgcpu.isGbcFeatures()) || ((attribs >> 2) > 7)) {
				if (entryNumber == 0) {
					rgbValue &= 0x00FFFFFF;
				}
			}
			/*     if ((entryNumber == 0) &&  ( ( (attribs & TILE_OBJ1) != 0) ||
                                  ( (attribs & TILE_OBJ2) != 0) ) ) {
      rgbValue &= 0x00FFFFFF;
     } else if ((entryNumber == 0) &&
         ((attribs & (TILE_OBJ1 | TILE_OBJ2)) == 0)) {
      rgbValue &= 0x00FFFFFF;
     } */

			for (int cy = 0; cy < magnify; cy++) {
				for (int cx = 0; cx < magnify; cx++) {
					imageData[(y * 8 * magnify * magnify) + (cy * 8 * magnify) +
					          (x * magnify) + cx] = rgbValue;
				}
			}

				}
			}

			source[attribs].newPixels();
			valid[attribs] = true;
		}