f.java

来自「用J2ME开发的一个类似于帝国游戏的小游戏软件。」· Java 代码 · 共 369 行

JAVA
369
字号
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 

import com.nokia.mid.sound.Sound;
import com.nokia.mid.sound.SoundListener;
import javax.microedition.lcdui.Image;

public final class f
    implements SoundListener
{

    public static boolean a;
    public static boolean b = false;
    public static boolean c = false;
    public static int d[];
    public static byte e[];
    public static int f;
    public static long g[];
    private static Sound h;
    private static byte i[];

    public f()
    {
    }

    public static final void a()
    {
        d = new int[513];
        for(int j = 0; j < 513; j++)
            d[j] = a(j >> 2) << 4;

    }

    public static final int a(int j)
    {
        int k;
        j = (k = j & 0x1ff) & 0x7f;
        k >>= 7;
        if(j == 0 && (k & 0x1) == 1)
        {
            k--;
            j = 128;
        }
        switch(k)
        {
        case 0: // '\0'
            j = 128 - j;
            return (49152 - j * j) * j >> 10;

        case 1: // '\001'
            return -((49152 - j * j) * j) >> 10;

        case 2: // '\002'
            j = 128 - j;
            return -((49152 - j * j) * j >> 10);

        case 3: // '\003'
            return (49152 - j * j) * j >> 10;
        }
        return 0;
    }

    public static final int b(int j)
    {
        return c(j -= 512);
    }

    public static final int c(int j)
    {
        if((j &= 0x7ff) < 1024)
            if(j < 512)
                return d[j];
            else
                return -d[1024 - j];
        if(j < 1536)
            return -d[j - 1024];
        else
            return d[2048 - j];
    }

    public static final int d(int j)
    {
        if(j < 0)
            return -j;
        else
            return j;
    }

    public static final Image a(byte abyte0[], int j, int k)
    {
        if(abyte0 == null)
            return null;
        if(abyte0.length == 1)
            return null;
        if(g == null)
            b();
        f = 0;
        e = abyte0;
        int l = e(8) + 1;
        int i1 = e(8) + 1;
        int j1 = e(16) + 1;
        int k1 = e(16) + 1;
        int l1;
        int ai[] = new int[l1 = e(8) + 1];
        int i4 = 0;
        int j4 = -1;
        for(int i2 = 0; i2 < i1; i2++)
        {
            if(j != i2)
            {
                int k3 = e(4);
                if(e(4) == 1)
                    f(8);
                g(l1 * (1 + k3));
                continue;
            }
            int l3 = e(4);
            if((i4 = e(4)) == 1)
                j4 = e(8);
            for(int i3 = 0; i3 < l1; i3++)
                ai[i3] = a(e(1 + l3 << 3), l3);

        }

        int j2;
        int l4;
        byte abyte1[];
        byte abyte2[];
        switch(k)
        {
        case 4: // '\004'
            for(int j3 = 1; j3 < l1; j3++)
            {
                int i5;
                int j5 = ((i5 = ai[j3]) & 0xff00) >> 8;
                int k5 = i5 & 0xff;
                i5 = (i5 & 0xff0000) >> 16;
                int k4 = (k5 + j5 * 6 + i5 * 3) / 10;
                ai[j3] = k4 << 16;
            }

            // fall through

        default:
            abyte1 = h(l4 = e(16));
            abyte2 = new byte[69 + i4 * (12 + j4 + 1) + l1 * 3 + l4];
            boolean flag = false;
            a(abyte2, 0, 32, 0x89504e47);
            a(abyte2, 32, 32, 0xd0a1a0a);
            a(abyte2, 64, 32, 13);
            a(abyte2, 96, 32, 0x49484452);
            a(abyte2, 128, 32, j1);
            a(abyte2, 160, 32, k1);
            a(abyte2, 192, 8, l);
            a(abyte2, 200, 32, 0x3000000);
            int i6 = b(abyte2, 12, 29);
            a(abyte2, 232, 32, i6);
            a(abyte2, 264, 32, l1 * 3);
            a(abyte2, 296, 32, 0x504c5445);
            j2 = 0;
            break;
        }
        for(; j2 < l1; j2++)
            a(abyte2, 328 + j2 * 24, 24, ai[j2]);

        int j6 = b(abyte2, 37, 41 + l1 * 3);
        a(abyte2, 264 + (8 + l1 * 3 << 3), 32, j6);
        int l5 = 264 + (8 + l1 * 3 + 4 << 3);
        if(i4 == 1)
        {
            a(abyte2, l5, 32, j4 + 1);
            a(abyte2, l5 + 32, 32, 0x74524e53);
            int k2;
            for(k2 = 0; k2 < j4; k2++)
                a(abyte2, l5 + 64 + (k2 << 3), 8, 255);

            a(abyte2, l5 + 64 + (k2 << 3), 8, 0);
            j6 = b(abyte2, (l5 >> 3) + 4, (l5 >> 3) + 4 + 4 + (j4 + 1));
            a(abyte2, l5 + (8 + (j4 + 1) << 3), 32, j6);
            l5 += 8 + (j4 + 1) + 4 << 3;
        }
        a(abyte2, l5, 32, l4);
        a(abyte2, l5 + 32, 32, 0x49444154);
        for(int l2 = 0; l2 < l4; l2++)
            a(abyte2, l5 + 64 + (l2 << 3), 8, abyte1[l2]);

        j6 = b(abyte2, (l5 >> 3) + 4, (l5 >> 3) + 4 + 4 + l4);
        a(abyte2, l5 + (8 + l4 << 3), 32, j6);
        l5 += 8 + l4 + 4 << 3;
        a(abyte2, l5, 32, 0);
        a(abyte2, l5 + 32, 32, 0x49454e44);
        j6 = b(abyte2, (l5 >> 3) + 4, (l5 >> 3) + 4 + 4 + 0);
        a(abyte2, l5 + 64, 32, j6);
        e = null;
        return Image.createImage(abyte2, 0, abyte2.length);
    }

    public static final int a(int j, int k)
    {
        int l;
        int i1;
        int j1;
        switch(k)
        {
        case 0: // '\0'
            l = ((j >> 5) * 255) / 7;
            i1 = ((j >> 2 & 0x7) * 255) / 7;
            j1 = ((j & 0x3) * 255) / 3;
            break;

        case 1: // '\001'
            l = ((j >> 11) * 255) / 31;
            i1 = ((j >> 5 & 0x3f) * 255) / 63;
            j1 = ((j & 0x1f) * 255) / 31;
            break;

        default:
            return j;
        }
        return l << 16 | i1 << 8 | j1;
    }

    public static final void b()
    {
        g = new long[256];
        for(int j = 0; j < 256; j++)
        {
            long l = j;
            for(int k = 0; k < 8; k++)
                if((l & 1L) == 1L)
                    l = 0xedb88320L ^ l >> 1;
                else
                    l >>= 1;

            g[j] = l;
        }

    }

    public static final int b(byte abyte0[], int j, int k)
    {
        long l = 0xffffffffL;
        for(int i1 = j; i1 < k; i1++)
            l = g[(int)((l ^ (long)abyte0[i1]) & 255L)] ^ l >> 8;

        return (int)(l ^ 0xffffffffL);
    }

    public static final int c(byte abyte0[], int j, int k)
    {
        int l = 0;
        if((j & 0x7) == 0 && (k & 0x7) == 0)
        {
            int i1 = k >> 3;
            for(int k1 = 0; k1 < i1; k1++)
            {
                l = (l <<= 8) + (abyte0[j >> 3] & 0xff);
                j += 8;
            }

        } else
        {
            for(int l1 = 1; l1 <= k; l1++)
            {
                int j1 = j >> 3;
                l += (abyte0[j1] >> 7 - (j - (j1 << 3)) & 0x1) << k - l1;
                j++;
            }

        }
        return l;
    }

    public static final void a(byte abyte0[], int j, int k, int l)
    {
        boolean flag = false;
        boolean flag1 = false;
        int j1 = j;
        int k1 = 1 << k - 1;
        for(int l1 = 0; l1 < k; l1++)
        {
            int i1 = j1 >> 3;
            byte byte0 = (byte)(1 << 7 - (j1 - (i1 << 3)));
            if((l & k1) == k1)
                abyte0[i1] |= byte0;
            else
                abyte0[i1] &= (byte)(0xff ^ byte0);
            l <<= 1;
            j1++;
        }

    }

    public static final int e(int j)
    {
        int k = c(e, f, j);
        f(j);
        return k;
    }

    public static final void f(int j)
    {
        f += j;
    }

    public static final void g(int j)
    {
        f += j << 3;
    }

    public static final byte c()
    {
        return (byte)e(8);
    }

    public static final byte[] h(int j)
    {
        byte abyte0[] = new byte[j];
        if((f & 0x7) == 0)
        {
            System.arraycopy(e, f >> 3, abyte0, 0, j);
            g(j);
        } else
        {
            for(int k = 0; k < j; k++)
                e[k] = c();

        }
        return abyte0;
    }

    public final void soundStateChanged(Sound sound, int j)
    {
        switch(j)
        {
        case 1: // '\001'
            h.release();
            h = null;
            break;
        }
    }

    public static final boolean a(int j, boolean flag)
    {
        try
        {
            if(a)
            {
                i = g.a(j);
                h = new Sound(i, 1);
                h.play(1);
            }
        }
        catch(Exception _ex)
        {
            return false;
        }
        return true;
    }

    public static final void d()
    {
        if(h != null)
            h.stop();
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?