final void drawBitmapQuad(int x, int y, int width, int height, int inactiveColor, int activeColor, byte[] bitmap, int ratio, int mode) {
	if (width > 0 && height > 0) {
	    int i_106_ = 0;
	    int i_107_ = 0;
	    int i_108_ = (ratio << 16) / width;
	    int i_109_ = (bitmap.length / ratio << 16) / height;
	    int destOff = x + y * ((SoftwareToolkit) this).maxWidth;
	    int i_111_ = ((SoftwareToolkit) this).maxWidth - width;
	    if (y + height > ((SoftwareToolkit) this).height)
		height -= y + height - ((SoftwareToolkit) this).height;
	    if (y < ((SoftwareToolkit) this).heightOffset) {
		int i_112_ = ((SoftwareToolkit) this).heightOffset - y;
		height -= i_112_;
		destOff += i_112_ * ((SoftwareToolkit) this).maxWidth;
		i_107_ += i_109_ * i_112_;
	    }
	    if (x + width > ((SoftwareToolkit) this).width) {
		int i_113_ = x + width - ((SoftwareToolkit) this).width;
		width -= i_113_;
		i_111_ += i_113_;
	    }
	    if (x < ((SoftwareToolkit) this).widthOffset) {
		int i_114_ = ((SoftwareToolkit) this).widthOffset - x;
		width -= i_114_;
		destOff += i_114_;
		i_106_ += i_108_ * i_114_;
		i_111_ += i_114_;
	    }
	    int inactiveAlpha = inactiveColor >>> 24;
	    int activeAlpha = activeColor >>> 24;
	    if (mode == 0 || mode == 1 && inactiveAlpha == 255 && activeAlpha == 255) {
		int i_117_ = i_106_;
		for (int i_118_ = -height; i_118_ < 0; i_118_++) {
		    int i_119_ = (i_107_ >> 16) * ratio;
		    for (int i_120_ = -width; i_120_ < 0; i_120_++) {
			if (bitmap[(i_106_ >> 16) + i_119_] != 0)
			    ((SoftwareToolkit) this).pixelBuffer[destOff++] = activeColor;
			else
			    ((SoftwareToolkit) this).pixelBuffer[destOff++] = inactiveColor;
			i_106_ += i_108_;
		    }
		    i_107_ += i_109_;
		    i_106_ = i_117_;
		    destOff += i_111_;
		}
	    } else if (mode == 1) {
		int i_121_ = i_106_;
		for (int cury = -height; cury < 0; cury++) {
		    int i_123_ = (i_107_ >> 16) * ratio;
		    for (int curx = -width; curx < 0; curx++) {
			int color = inactiveColor;
			if (bitmap[(i_106_ >> 16) + i_123_] != 0)
			    color = activeColor;
			int alpha = color >>> 24;
			int compAlpha = 255 - alpha;
			int pixelColor = ((SoftwareToolkit) this).pixelBuffer[destOff];
			((SoftwareToolkit) this).pixelBuffer[destOff++] = ((((color & 0xff00ff) * alpha + (pixelColor & 0xff00ff) * compAlpha) & ~0xff00ff) + (((color & 0xff00) * alpha + (pixelColor & 0xff00) * compAlpha) & 0xff0000)) >> 8;
			i_106_ += i_108_;
		    }
		    i_107_ += i_109_;
		    i_106_ = i_121_;
		    destOff += i_111_;
		}
	    } else if (mode == 2) {
		int i_129_ = i_106_;
		for (int i_130_ = -height; i_130_ < 0; i_130_++) {
		    int i_131_ = (i_107_ >> 16) * ratio;
		    for (int i_132_ = -width; i_132_ < 0; i_132_++) {
			int i_133_ = inactiveColor;
			if (bitmap[(i_106_ >> 16) + i_131_] != 0)
			    i_133_ = activeColor;
			if (i_133_ != 0) {
			    int i_134_
				= ((SoftwareToolkit) this).pixelBuffer[destOff];
			    int i_135_ = i_133_ + i_134_;
			    int i_136_
				= (i_133_ & 0xff00ff) + (i_134_ & 0xff00ff);
			    i_134_ = (i_136_ & 0x1000100) + (i_135_ - i_136_
							     & 0x10000);
			    ((SoftwareToolkit) this).pixelBuffer[destOff++]
				= i_135_ - i_134_ | i_134_ - (i_134_ >>> 8);
			} else
			    destOff++;
			i_106_ += i_108_;
		    }
		    i_107_ += i_109_;
		    i_106_ = i_129_;
		    destOff += i_111_;
		}
	    } else
		throw new IllegalArgumentException();
	}
    }