add src files decompiled via jad
[rsa2client.git] / src / mcsClient / ColorPalette.java
diff --git a/src/mcsClient/ColorPalette.java b/src/mcsClient/ColorPalette.java
new file mode 100644 (file)
index 0000000..5c1fbb8
--- /dev/null
@@ -0,0 +1,89 @@
+// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
+// Jad home page: http://www.kpdus.com/jad.html
+// Decompiler options: packimports(3) fieldsfirst nonlb space 
+
+package mcsClient;
+
+import java.io.*;
+
+public class ColorPalette {
+
+    private int javaColors[];
+    int hardwareColors[];
+    private int microsoftColors[];
+    private final int colorMap[] = {
+        0, 70, 127, 191, 255
+    };
+    private final byte hardwareMap[] = {
+        0, 25, 50, 75, 5, 30, 55, 80, 10, 35, 
+        60, 85, 15, 40, 65, 90, 1, 26, 51, 76, 
+        6, 31, 56, 81, 11, 36, 61, 86, 16, 41, 
+        66, 91, 2, 27, 52, 77, 7, 32, 57, 82, 
+        12, 37, 62, 87, 17, 42, 67, 92, 3, 28, 
+        53, 78, 8, 33, 58, 83, 13, 38, 63, 88, 
+        18, 43, 68, 93, 100, 101, 102, 103, 105, 106, 
+        107, 108, 110, 111, 112, 113, 115, 116, 117, 118, 
+        20, 45, 70, 95, 21, 46, 71, 96, 22, 47, 
+        72, 97, 23, 48, 73, 98, 4, 29, 54, 79, 
+        9, 34, 59, 84, 14, 39, 64, 89, 19, 44, 
+        69, 94, 120, 121, 122, 123, 104, 109, 114, 119, 
+        24, 49, 74, 99, 124, 125, 126, 127
+    };
+
+    public ColorPalette() {
+        javaColors = new int[128];
+        hardwareColors = new int[128];
+        microsoftColors = new int[256];
+        for (int i = 0; i < 125; i += 25) {
+            for (int k = 0; k < 25; k += 5) {
+                for (int i1 = 0; i1 < 5; i1++)
+                    microsoftColors[i + k + i1] = colorMap[i / 25] << 24 | colorMap[k / 5] << 16 | colorMap[i1] << 8;
+
+            }
+
+        }
+
+        microsoftColors[125] = 0x5f5f5f5f;
+        microsoftColors[126] = 0x9f9f9f9f;
+        microsoftColors[127] = 0xdfdfdfdf;
+        for (int j = 0; j < 125; j += 25) {
+            for (int l = 0; l < 25; l += 5) {
+                for (int j1 = 0; j1 < 5; j1++)
+                    javaColors[j + l + j1] = 0xff000000 | colorMap[j / 25] << 0 | colorMap[l / 5] << 8 | colorMap[j1] << 16;
+
+            }
+
+        }
+
+        javaColors[125] = 0xff5f5f5f;
+        javaColors[126] = 0xff9f9f9f;
+        javaColors[127] = 0xffdfdfdf;
+        for (int k1 = 0; k1 < 128; k1++)
+            hardwareColors[k1] = javaColors[hardwareMap[k1]];
+
+    }
+
+    public static void main(String args[]) throws IOException {
+        ColorPalette colorpalette = new ColorPalette();
+        colorpalette.printColorPalette();
+        System.exit(0);
+    }
+
+    public void writeColorPalette(DataOutputStream dataoutputstream) throws IOException {
+        for (int i = 0; i < microsoftColors.length; i++)
+            dataoutputstream.writeInt(microsoftColors[i]);
+
+    }
+
+    private void printColorPalette() throws IOException {
+        System.out.println();
+        System.out.println("Graphical Console Server Custom 128 Color Palette");
+        System.out.println("-------------------------------------------------");
+        System.out.println();
+        System.out.println("\tIndex\tRed\t\tGreen\tBlue");
+        System.out.println("\t-----\t---\t\t-----\t----");
+        for (int i = 0; i < hardwareColors.length; i++)
+            System.out.println("\t" + i + "\t\t" + ((hardwareColors[i] & 0xff0000) >> 16) + "\t\t" + ((hardwareColors[i] & 0xff00) >> 8) + "\t\t" + (hardwareColors[i] & 0xff));
+
+    }
+}