+/*
+ * panic_blit_rect_30 decodes the RLE encoded image data on the fly, and fills
+ * in each of the three pixel values from the clut (RGB) for each pixel and
+ * writes it to the screen.
+ */
+
+static void
+panic_blit_rect_30(unsigned int x, unsigned int y, unsigned int width,
+ unsigned int height, __unused int transparent,
+ const unsigned char *dataPtr)
+{
+ volatile unsigned int * dst;
+ unsigned int line, col, i;
+ unsigned int quantity, index, data, depth;
+ const unsigned char *value;
+ unsigned int in;
+
+ dst = (volatile unsigned int *) (vinfo.v_baseaddr +
+ (y * vinfo.v_rowbytes) +
+ (x * 4));
+
+ quantity = 0;
+ i = 0;
+
+ for( line = 0; line < height; line++) {
+ for( col = 0; col < width; col++) {
+
+ if (quantity == 0) {
+ dataPtr += decode_rle(dataPtr, &quantity, &depth, &value);
+ i = 0;
+ }
+
+ index = value[i++] * 3;
+ in = panic_dialog_clut[index + 0];
+ data = (in << 2) | (in >> 6);
+
+ in = panic_dialog_clut[index + 1];
+ data |= (in << (2 + 10)) | ((3 << 10) & (in << 4));
+
+ in = panic_dialog_clut[index + 2];
+ data |= (in << (2 + 20)) | ((3 << 20) & (in << 14));
+
+ *(dst + col) = data;
+
+ if ( i == depth ) {
+ i = 0;
+ quantity--;
+ }
+ }
+
+ dst = (volatile unsigned int *) (((uintptr_t)dst) + vinfo.v_rowbytes);
+ }
+}
+
+