// Decompiled with: FernFlower
// Class Version: 2
import com.nttdocomo.device.Bluetooth;
import com.nttdocomo.device.RemoteDevice;
import com.nttdocomo.io.ConnectionException;
import com.nttdocomo.ui.Audio3D;
import com.nttdocomo.ui.AudioPresenter;
import com.nttdocomo.ui.Canvas;
import com.nttdocomo.ui.Display;
import com.nttdocomo.ui.Font;
import com.nttdocomo.ui.Graphics;
import com.nttdocomo.ui.Image;
import com.nttdocomo.ui.MediaImage;
import com.nttdocomo.ui.MediaListener;
import com.nttdocomo.ui.MediaManager;
import com.nttdocomo.ui.MediaPresenter;
import com.nttdocomo.ui.MediaSound;
import com.nttdocomo.ui.PhoneSystem;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Hashtable;
import java.util.Random;
import javax.microedition.io.Connector;

class Module extends Canvas implements Runnable {
    protected P903ipuyo_col m_pnt;
    protected Thread m_thread;
    protected Random m_rand;
    boolean paintMode = false;
    private Display display = null;
    protected Font font;
    protected Font font2;
    protected int fontH;
    protected int fontB;
    protected int Mode;
    protected int ModeReq;
    protected int ModeTime;
    protected int mode2;
    protected int mode2req;
    protected int mode2time;
    protected boolean mode2init;
    protected int frame = 0;
    protected int GameMode;
    protected Image[] nImg = new Image[64];
    protected int Language = 0;
    protected int GameSelectType = -1;
    protected int GamePlayMode = 0;
    protected byte[] SaveData;
    int bkGameStageNo;
    int bkGamePlayMode;
    int bkGameSelectType;
    long[] keyTbl = new long[]{1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, 256L, 512L, 65536L, 2048L, 1024L, 4096L, 8192L, 16384L, 32768L, 131072L, 262144L};
    protected long[] old_key = new long[2];
    protected long[] now_key = new long[2];
    protected long[] push_key = new long[2];
    protected long old_key_sys;
    protected long now_key_sys;
    protected long push_key_sys;
    static final int UP = 17;
    static final int LEFT = 16;
    static final int RIGHT = 18;
    static final int DOWN = 19;
    static final int FIRE = 20;
    static final int KEY_CLR = 32;
    static final int KEY_CLR2 = 24;
    static final int KEY_NUM0 = 0;
    static final int KEY_NUM1 = 1;
    static final int KEY_NUM2 = 2;
    static final int KEY_NUM3 = 3;
    static final int KEY_NUM4 = 4;
    static final int KEY_NUM5 = 5;
    static final int KEY_NUM6 = 6;
    static final int KEY_NUM7 = 7;
    static final int KEY_NUM8 = 8;
    static final int KEY_NUM9 = 9;
    static final int KEY_POUND = 11;
    static final int KEY_STAR = 10;
    long org_key = 0L;
    String[][] SoftCmdName = new String[][]{{"♪○", "♪×", "戻る", "終了", "停止", "再開", " ", "♪大", "♪小", "♪×", " "}};
    int[] cmdid_bk = new int[2];
    protected Graphics g2;
    protected Graphics gx;
    protected int nWidth;
    protected int nHeight;
    protected int nFlushY;
    protected int nFlushX;
    protected Graphics gbk;
    protected int wbk;
    protected int hbk;
    protected static final int[] m_sintbl = new int[]{0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 49, 54, 58, 62, 66, 70, 74, 77, 80, 83, 86, 89, 91, 93, 95, 96, 97, 98, 99, 99, 100, 99, 99, 98, 97, 96, 95, 93, 91, 89, 86, 83, 80, 77, 74, 70, 66, 62, 58, 54, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0, -5, -10, -15, -20, -25, -30, -35, -40, -45, -49, -54, -58, -62, -66, -70, -74, -77, -80, -83, -86, -89, -91, -93, -95, -96, -97, -98, -99, -99, -100, -99, -99, -98, -97, -96, -95, -93, -91, -89, -86, -83, -80, -77, -74, -70, -66, -62, -58, -54, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5};
    int VibCnt = 0;
    boolean SeqWait = false;
    int SeqMode = 0;
    int LoadMax = 0;
    int LoadCnt = 0;
    int[] RSfileTop = new int[32];
    int[] RSfileSize = new int[32];
    int RSfileCnt = 0;
    int RStopAddress = 0;
    String SPstring = "scratchpad:///0;pos=";
    String[] RSfileTBL = new String[]{"SV"};
    boolean Snd3DF = true;
    int BGMSubject = 0;
    boolean BGMflag = false;
    boolean bgmLoadF = false;
    int MaxSndObj = 4;
    protected MediaSound[] Phr = new MediaSound[32];
    protected AudioPresenter[] STrack;
    private Audio3D[] a3dST;
    int[] SPhrNo = new int[4];
    String[] SndFTBL = new String[]{"0", "title.mld", "0", "", "0", "", "0", "c_m01.mld", "0", "", "0", "", "0", "c_count01.mld", "0", "c_count02.mld", "0", "c_count03.mld", "0", "c_count04.mld", "0", "c_count05.mld", "0", "c_count06.mld", "0", "c_count07.mld", "0", "c_count08.mld", "0", "c_count09.mld", "0", "c_count10.mld", "1", "c_se03.mld", "1", "c_se04.mld", "1", "c_se06.mld", "1", "c_se05.mld", "0", "p_m01.mld", "0", "", "0", "", "1", "p_count01.mld", "1", "p_count02.mld", "1", "p_count03.mld", "1", "p_count04.mld", "1", "p_count05.mld", "1", "p_count06.mld", "1", "p_count07.mld", "0", "p_count08.mld", "0", "p_count09.mld", "0", "p_count10.mld", "1", "p_se10.mld", "1", "p_se11.mld", "1", "p_se03.mld", "1", "p_se09.mld", "1", "p_se01.mld", "1", "p_se02.mld", "1", "p_se04.mld", "1", "p_se05.mld", "0", "p_se06.mld", "0", "", "1", "p_se07.mld", "0", "p_se08.mld", "0", "c_m02.mld", "0", "", "0", "c_m03.mld", "0", "", "0", "", "0", "c_m04.mld", "0", "", "0", "", "0", "p_m02.mld", "0", "", "0", "", "0", "p_m03.mld", "0", "", "0", "", "1", "c_se07.mld", "1", "p_v11.mld", "0", "menu_se01.mld", "0", "menu_se02.mld", "1", "c_se01.mld", "1", "c_se02.mld", "1", "p_v00.mld", "1", "p_v01.mld", "1", "p_v02.mld", "1", "p_v03.mld", "1", "p_v04.mld", "1", "p_v05.mld", "1", "p_v06.mld", "1", "p_v10.mld", "1", "p_se12.mld"};
    int BGMloopCnt = 0;
    Module.MyListener ml = new Module.MyListener();
    int[] colMagicPowTbl = new int[]{40, 20, 0};
    String[][] puyoChrName = new String[][]{{"スケルトン-T", "ハーピー", "アーちゃん", "すけとうだら", "チコ", "ドラコ", "ルルー", "ウィッチ", "アルル", "サタン"}};
    String[][][] titleMenuSTR2 = new String[][][]{{{"はい", "いいえ", "終了", "再開", "ヘルプ", "戻る"}, {"アプリを終了します。", "よろしいですか？    "}, {"全てのゲームデータを", "初期化しました。    "}, {"激甘", "甘口", "中辛", "辛口", "激辛", "ぷよ色数 ", "連鎖補正"}, {"全てのゲームデータを", "初期化しますか？    "}, {"復元できませんが", "よろしいですか？"}, {"ＢＧＭ変更", "ＢＧＭへんこう"}, {"VS HUMAN", "ふたりでぷよぷよ"}}};
    String[][][] BTMenuSTR2 = new String[][][]{{{"1P側から", "の対戦リクエストがありました。", "リクエストを受けますか？"}, {"切断されました。", "Bluetooth通信中(無料)", "接続エラー"}, {"近くにいる相手を探して", "います。              "}, {"2P側が見つかりました。", "2P側を選んでください。"}, {"対戦のリクエストをしています。", "しばらくお待ち下さい。        "}, {"Bluetooth通信(無料)を行います。", "1P側か2P側を選択して ", "下さい。             ", "登録済の相手と対戦(1P側)", "登録済の相手と対戦(2P側)", "未登録の相手と対戦(1P側)", "未登録の相手と対戦(2P側)"}, {"対戦相手が見つかり", "ませんでした。    "}, {"2P側がリクエストを", "断りました。      "}, {"2P側がリクエストを  ", "受けましたので、    ", "ゲームを開始します。"}, {"1P側のリクエストを", "待っています。    "}, {"1P側からリクエストを    ", "受けましたので、ゲームを", "開始します。            "}}};
    String[][][] titleMenuSTR = new String[][][]{{{""}, {"", "", "オプション"}, {"COM対戦", "通信対戦", "1Pモード", "ハイスコア", "ゲーム説明", "オマケ設定"}, {""}, {"最初から", "続きから", "VERY HARD"}, {"", "", "", "ハイスコア", "ゲーム説明", "オマケ設定"}, {"普通", "ちびぷよ", "でかぷよ"}, {"最初から", "続きから", "激辛モード"}, {"サウンド", "ﾊﾞｲﾌﾞﾚｰｼｮﾝ", "初期化", "言語設定"}, {""}, {""}, {""}, {"サーバー", "クライアント"}, {""}, {""}, {""}, {""}, {""}, {"基本ルール", "魔法石について", "VS HUMANモード"}, {"基本ルール", "対戦ルール", "ふたりでぷよぷよモード"}, {""}, {""}, {""}, {"Bluetooth対戦とは?", "通信料", "接続範囲", "ｹﾞｰﾑ停止/終了時の注意"}}};
    String[][][] titleMenuHELP = new String[][][]{{{""}, {"ぷよぷよ?んが遊べます。", "コラムスが遊べます。", "アプリの設定を行えます。", "アプリを終了します。"}, {"全10ステージのCPU対戦モードです。", "Bluetooth通信で対戦できるモードです。", "ひたすら遊んでスコアアタックするモードです。", "エンドレスモードのハイスコアを見ることができます。", "ＢＧＭが変更できます。", "コラムスの遊び方を見ることができます。"}, {""}, {"最初からゲームをはじめます。", "続きからゲームをはじめます。", "STAGE5からゲームをはじめます。"}, {"全10ステージのCPU対戦モードです。", "Bluetooth通信で対戦できるモードです。", "とことん遊んでスコアアタックをするモードです。", "とことんぷよぷよのハイスコアを見ることができます。", "ＢＧＭが変更できます。", "ぷよぷよ?んの遊び方を見ることができます。"}, {"大きいぷよで遊ぶ。", "普通のぷよで遊ぶ。", "小さいぷよで遊ぶ。"}, {"最初からゲームをはじめます。", "続きからゲームをはじめます。", "STAGE5からゲームをはじめます。"}, {"音量を調節します。", "バイブレーションの設定をします。", "全てのゲームデータを初期化します。"}, {"サウンド"}, {"ﾊﾞｲﾌﾞﾚｰｼｮﾝ"}, {"初期化します。", "初期化しません。"}, {"Bluetooth機器登録済みの相手と対戦します。自分が1P側になります。", "Bluetooth機器登録済みの相手と対戦します。自分が2P側になります。", "Bluetooth機器登録されていない相手と対戦します。自分が1P側になります。", "Bluetooth機器登録されていない相手と対戦します。自分が2P側になります。"}, {""}, {""}, {""}, {"ゲーム中のＢＧＭを変更します。"}, {"ゲーム中のＢＧＭを変更します。"}, {""}, {""}}};
    String[][][][][] titleGameHELP = new String[][][][][]{{{{{"３つずつ落ちてくる宝石を左右キー", "(又は数字キー４，６)で操作して", "フィールドに積んでいきます。"}, {"下キー(又は数字キー８)を押したら", "高速落下。", "", "決定キー(又は数字キー５)を押すと", "宝石が回転し、宝石の順番が入れ替", "わります。", "＊キーで逆回転が可能です。"}, {"宝石が落ちてくる場所に積み上がって", "しまうとゲームオーバー！", "そうならないように、同じ色の宝石", "を縦横斜めに３つ以上並べて消し", "ていきます。"}}, {{"ＶＳモードの魔法石", "宝石を消していくと魔法石ゲージが", "蓄積されていき、ゲージが満タンに", "なると魔法石が出現します。"}, {"ＶＳモードの魔法石の効果は全部で", "３種類あります。", "", "宝石を回転させて、一番下にある", "魔法石によって効果が変化します。"}, {"通常魔法石（スター）", "", "", "", "置いた場所にある色の宝石を画面", "全体から全て消します。"}, {"攻撃魔法石（ソード）", "", "", "", "相手のフィールドの高さを", "２段上げます。"}, {"防御魔法石（シールド）", "", "", "", "相手の攻撃魔法石でせり上がった", "フィールドを３段まで相手に送り返", "すことができます。せり上がって", "ないときは一番下の宝石１列を消去", "します。"}, {"エンドレスモードの魔法石", "エンドレスモードの魔法石は置いた", "場所にある色の宝石を画面全体から", "全て消す効果があります。", "落下地点に宝石が無い場合は", "得点+10000点"}, {"エンドレスモードでは選択した難易度で", "魔法石の出現条件が変わります。", "ＥＡＳＹでは上まで積みあがった時の", "起死回生の一回のみ。", "ＮＯＲＭＡＬ、ＨＡＲＤでは宝石を", "消した数によって出現します。"}}, {{"Bluetooth対戦って何?", "Bluetooth機能を使用して､近くの", "ユーザーと通信して楽しむゲーム!", "VS HUMANモードを利用するには､同じ", "アプリがインストールされている必要が", "あるよ｡"}, {"対戦メニューの選び方", "対戦は｢Bluetooth機器登録｣されている", "端末とできるよ!", "登録済の端末と対戦するときは｢登録済", "の相手と対戦｣を選んで対戦しよう｡", "対戦相手が(1P側)を選んだら(2P側)､", "対戦相手が(2P側)を選んだら(1P側)を", "選んでね｡"}, {"対戦メニューの選び方", "Bluetooth機器登録されていない端末と", "対戦するときは｢未登録の相手と対戦｣を", "選んで対戦しよう｡", "(2P側)を選んだ人が端末暗証番号を入力", "すると｢シリアルポート登録待機中｣にな", "るから､(1P側)を選んだ人が｢サーチ｣を", "しよう｡"}, {"(1P側)に相手の端末が表示されたら､", "相手の端末を｢選択｣して登録しよう｡", "Bluetoothパスキーは2人で同じ数字を", "入れてね｡"}, {"通信料", "Bluetooth通信は無料だよ｡", "", "接続範囲", "1P側を中心に､半径5m程度に接続を行う", "よ｡ただし､間に電波をさえぎる物が", "あると､接続範囲が狭くなってしまう", "ので注意!"}, {"ゲーム停止時/終了時の注意", "VS HUMANモードの一時停止状態", "または終了時には､使用していた", "接続情報は破棄されるので､予め", "ご了承ください｡"}}}, {{{"２匹ずつ落ちてくるぷよを", "左右キー(又は数字キー４と６)で", "操作してフィールドに置いていこう。"}, {"下キー(又は数字キー８)を押したら", "高速落下！", "", "決定キー(又は数字キー５)を押すと", "ぷよが回転するよ。", "＊キーで逆回転もできるよ。"}, {"ぷよが落ちてくる場所に積み", "上がってしまうとゲームオーバー！", "", "そうならないように、同じ色のぷよを", "上下左右に４つ以上くっつけて消して", "いこう！"}}, {{"ぷよを消すと相手におじゃまぷよを", "送ることができるよ！", "", "", "", "おじゃまぷよは隣接したぷよを消す", "と消えるよ！"}, {"一度に多くのぷよを消したり連鎖を", "すればするほど相手にたくさんの", "おじゃまぷよを送ることができるの", "でどんどんねらっていこう！"}, {"自分の攻撃と相手の攻撃がぶつ", "かると相殺だ！", "", "", "", "相手の攻撃より自分の攻撃が", "強ければおじゃまぷよは降って", "こないぞ！"}}, {{"Bluetooth対戦って何?", "Bluetooth機能を使用して､近くの", "ユーザーと通信して楽しむゲーム!", "ふたりでぷよぷよを利用するには､同じ", "アプリがインストールされている必要が", "あるよ｡"}, {"対戦メニューの選び方", "対戦は｢Bluetooth機器登録｣されている", "端末とできるよ!", "登録済の端末と対戦するときは｢登録済", "の相手と対戦｣を選んで対戦しよう｡", "対戦相手が(1P側)を選んだら(2P側)､", "対戦相手が(2P側)を選んだら(1P側)を", "選んでね｡"}, {"対戦メニューの選び方", "Bluetooth機器登録されていない端末と", "対戦するときは｢未登録の相手と対戦｣を", "選んで対戦しよう｡", "(2P側)を選んだ人が端末暗証番号を入力", "すると｢シリアルポート登録待機中｣にな", "るから､(1P側)を選んだ人が｢サーチ｣を", "しよう｡"}, {"(1P側)に相手の端末が表示されたら､", "相手の端末を｢選択｣して登録しよう｡", "Bluetoothパスキーは2人で同じ数字を", "入れてね｡"}, {"通信料", "Bluetooth通信は無料だよ｡", "", "接続範囲", "1P側を中心に､半径5m程度に接続を行う", "よ｡ただし､間に電波をさえぎる物が", "あると､接続範囲が狭くなってしまう", "ので注意!"}, {"ゲーム停止時/終了時の注意", "ふたりでぷよぷよの一時停止状態", "または終了時には､使用していた", "接続情報は破棄されるので､予め", "ご了承ください｡"}}}}};
    int[][] menuTbl_map = new int[][]{{0, 1, 0}, {0, 3, 0}, {1, 5, 1}, {2, 5, 1}, {2, 1, 1}, {1, 5, 2}, {5, 2, 2}, {5, 1, 2}, {1, 2, 0}, {9, 0, 0}, {10, 0, 0}, {8, 1, 0}, {1, 2, -1}, {12, 1, -1}, {12, 1, -1}, {-1, 0, -1}, {2, 0, 1}, {5, 0, 2}, {2, 0, 1}, {5, 0, 2}, {1, 1, -1}, {0, 1, -1}, {8, 1, 0}, {1, 1, -1}, {8, 1, -1}};
    String lenlen = "ああああああああああああああああああ";
    protected int btWait = 0;
    protected boolean bt_server1st = false;
    protected int bt_mode = 0;
    protected int[] curY = new int[32];
    protected int subCur = 0;
    protected int exitCur = 0;
    protected int title_bgno = -1;
    protected int title_bgcnt = 0;
    protected int title_bgcnt2 = 0;
    protected int title_helppage = 0;
    protected int title_helppage2 = 0;
    protected int titleSE = 0;
    int[] PuyoTbl = new int[]{8, 8, 12, 10, 5};
    int btLockTime = 0;
    int title_helpX = 0;
    int title_helpID = -1;
    int title_helpCUR = -1;
    boolean btRecvExit2T = false;
    int btRecvExitT = 0;
    protected int player_num = 1;
    protected int[][] play_stat = new int[2][128];
    protected char[][] play_map = new char[2][384];
    protected char[][] link_map = new char[2][384];
    protected int[][] offy_map = new int[2][384];
    protected char[] clr_map = new char[384];
    protected char[][] clr_map2 = new char[2][320];
    protected int rank_in = -1;
    protected int[] KabanStat = new int[8];
    protected int game_msg = 0;
    protected int message_cnt = 0;
    protected boolean game_pause = false;
    protected boolean game_pause2 = false;
    protected int GameStageNo = 0;
    protected int game_time = 0;
    int[] puyoLevelTbl = new int[]{3, 4, 5, 5, 5};
    int[] puyoLevelTbl2 = new int[]{3, 4, 4, 4, 5};
    int[] colLevelTbl = new int[]{4, 5, 6, 6, 6};
    int game_round = 0;
    int[][] play_stat2 = new int[2][16];
    int hanabi_x = 60;
    int hanabi_y = 90;
    int hanabi_no = 0;
    int simg_anm = 0;
    int simg_x = 180;
    int simg_y = 26;
    int[] MapB1TBL = new int[]{16, 16, 16, 16, 16, 16, 10, 24};
    int[] MapB2TBL = new int[]{16, 16, 16, 16, 16, 16, 10, 24};
    int[] MapHTBL = new int[]{13, 13, 13, 12, 12, 12, 16, 7};
    int[] MapTOPTBL = new int[]{10, 10, 10, 11, 11, 11, 7, 16};
    int[] MapWTBL = new int[]{6, 6, 6, 6, 6, 6, 10, 4};
    int GameMapType = 0;
    int[][][] FramePosTbl2 = new int[][][]{{{8, 16, 126, 52}, {4, 6, 106, 40, 106, 76}, {4, 6, 106, 40, 106, 76}, {10, 24, 126, 38}, {4, 18, 104, 32}, {4, 18, 104, 32}, {8, 40, 126, 38}, {10, 35, 126, 38}}, {{0}, {140, 6, 118, 96, 129, 22}, {140, 6, 118, 96, 129, 22}, {0}, {140, 18, 120, 194}, {140, 18, 120, 194}, {0}, {0}}};
    int[][] FaceTbl = new int[][]{{28, 6}, {19, 4}, {26, 6}, {23, 11}, {19, 7}, {26, 13}, {23, 10}, {23, 7}, {14, 21}, {23, 6}, {39, 2}, {21, 9}};
    Image[] iGem = new Image[16];
    char[] rand_work = new char[256];
    boolean GameLvSel = false;
    boolean btSelChk = false;
    boolean btTimeOut = false;
    boolean btTimeOut2 = false;
    int[][] SpeedTbl = new int[][]{{1, 1, 1, 1, 1, 1, 3, 5, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15}};
    int[] FaceNoTbl = new int[]{1, 3, 5, 8, 6, 2, 4, 7, 0, 9};
    int setLevel = 0;
    boolean btWriteDB = false;
    int[] clr_pos = new int[64];
    int[][] ComLevelTbl = new int[][]{{13, 30, 1, 2, 3, 1, 10, 30, 34, 33, 33, 75, 5, 20}, {11, 25, 1, 2, 3, 1, 9, 0, 40, 20, 40, 75, 5, 20}, {9, 20, 1, 2, 3, 1, 8, 0, 15, 70, 15, 65, 5, 30}, {7, 15, 1, 2, 3, 1, 7, 0, 20, 30, 50, 50, 20, 30}, {5, 10, 1, 2, 4, 1, 6, 0, 50, 25, 25, 45, 10, 45}, {3, 7, 1, 3, 4, 1, 5, 20, 15, 70, 15, 35, 5, 60}, {2, 4, 0, 3, 4, 1, 4, 0, 30, 60, 10, 45, 10, 45}, {2, 3, 0, 4, 4, 1, 3, 0, 34, 33, 33, 34, 33, 33}, {1, 2, 0, 4, 3, 1, 2, 0, 40, 40, 20, 25, 5, 70}, {1, 1, 0, 4, 3, 1, 1, 1, 5, 90, 5, 5, 5, 90}};
    int[][] ComLevelTbl2 = new int[][]{{13, 30, 9, 2, 0, 1, 10, 40}, {8, 10, 8, 2, 1, 1, 0, 0}, {5, 10, 7, 2, 2, 1, 8, 0}, {-1, -1, 6, 2, 7, 1, 0, 0}, {3, 8, 5, 2, 6, 1, 6, 0}, {2, 6, 4, 3, 6, 1, 5, 10}, {1, 4, 3, 3, 6, 1, 4, 0}, {0, 2, 2, 4, 7, 1, 3, 0}, {-1, 0, 1, 4, 7, 1, 2, 0}, {-1, -1, 0, 4, 8, 0, 0, 0}};
    int[] clr_pos2 = new int[64];
    char[] com_map = new char[384];
    char[] com_clr = new char[384];
    int btStat = 0;
    int btNetType = 0;
    int btRecvTop = 0;
    int btRecvTop2 = 0;
    int btRecvCnt = 0;
    byte[][] btRecvBuf = new byte[16][16];
    boolean btConnectFlg = false;
    int btMode2 = 0;
    int btRecvExit = 0;
    boolean btRecvExit2 = false;
    int btNetSeek = 0;
    int btNetTYPE = 0;
    int btNetDevCnt = 0;
    int btRecvCmd = 0;
    int btID = 0;
    int btDevCnt = 0;
    int btSubCmd = 0;
    int btCur = 0;
    int btSrvFlg = 0;
    int btGameReq = 0;
    int btConnectCur = 0;
    int btSendCnt = 0;
    int btSendTop = 0;
    int btRecv2Cnt = 0;
    int btRecv2Size = 0;
    String btDeviceAddress = null;
    int btPlayStat = 0;
    Bluetooth p_bt = null;
    btMgr btm = null;
    private RemoteDevice m_dev;
    String[] GameName = new String[]{"VS HUMAN", "ふたりでぷよぷよ"};
    byte[] dat_dat_dat = new byte[16];
    int btRecvMapLine = 0;
    int btSendMapLine = 0;
    int[] btGetMap = new int[16];
    int btErrTime = 0;
    boolean btSeekStop = false;
    int btRandSeed = 0;
    int btNetSeekE = 0;
    boolean btMode1ST = true;
    boolean btWriteErr = false;
    boolean btWriteErr2 = false;
    int btCur2 = 0;
    int btFrame = 0;
    String btName;
    boolean p_chk = false;
    long oldmem = 0L;
    long nowmem = 0L;

    public Module(Display var1, P903ipuyo_col var2) {
        this.m_pnt = var2;
        this.nWidth = this.getWidth();
        this.nHeight = this.getHeight();
        this.nFlushX = (this.nWidth - 240) / 2;
        this.nFlushY = (this.nHeight - 240) / 2;
        this.font = Font.getDefaultFont();
        this.fontH = this.font.getHeight();
        this.fontB = this.font.getAscent();
        this.m_rand = new Random();
        this.Mode = -1;
        this.ModeReq = 0;
        this.g2 = this.getGraphics();
        this.gx = this.getGraphics();
        this.initRS();
        this.SaveData = new byte[512];
        if (!this.readRS(0, this.SaveData)) {
            this.dataFormat();
            this.writeRS(0, this.SaveData);
        }

        this.SndInit();
        this.btInit();
        this.btConnectSet(0);
        this.SndSetVol(this.SaveData[16]);
    }

    public void start() {
        if (this.m_thread == null) {
            PhoneSystem.setAttribute(8, 1);
            Display var10000 = this.display;
            Display.setCurrent(this);
            this.m_thread = new Thread(this);
            this.m_thread.start();
        }

    }

    public void processEvent(int var1, int var2) {
    }

    void getKeyData1P() {
        long var1 = (long)this.getKeypadState();
        this.org_key = var1 & 2047L;
        if ((var1 & 65536L) != 0L) {
            this.org_key |= 8192L;
        }

        if ((var1 & 131072L) != 0L) {
            this.org_key |= 4096L;
        }

        if ((var1 & 262144L) != 0L) {
            this.org_key |= 16384L;
        }

        if ((var1 & 524288L) != 0L) {
            this.org_key |= 32768L;
        }

        if ((var1 & 1048576L) != 0L) {
            this.org_key |= 65536L;
        }

        if ((var1 & 2097152L) != 0L) {
            this.org_key |= 131072L;
        }

        if ((var1 & 4194304L) != 0L) {
            this.org_key |= 262144L;
        }

        if ((this.org_key & this.keyTbl[2]) != 0L) {
            this.org_key |= this.keyTbl[13];
        }

        if ((this.org_key & this.keyTbl[8]) != 0L) {
            this.org_key |= this.keyTbl[16];
        }

        if ((this.org_key & this.keyTbl[4]) != 0L) {
            this.org_key |= this.keyTbl[14];
        }

        if ((this.org_key & this.keyTbl[6]) != 0L) {
            this.org_key |= this.keyTbl[15];
        }

        if ((this.org_key & this.keyTbl[5]) != 0L) {
            this.org_key |= this.keyTbl[10];
        }

        this.old_key[0] = this.now_key[0];
        this.now_key[0] = this.org_key;
        this.push_key[0] = ~this.old_key[0] & this.now_key[0];
        this.setKeyData(0);
    }

    void setKeyData(int var1) {
        this.old_key_sys = this.old_key[var1];
        this.now_key_sys = this.now_key[var1];
        this.push_key_sys = this.push_key[var1];
    }

    boolean chkKeyData(int var1) {
        if (!this.m_pnt.m_bPause && !this.p_chk && this.m_pnt.m_bPauseT <= 0) {
            return (this.now_key_sys & this.keyTbl[var1]) == this.keyTbl[var1];
        } else {
            return false;
        }
    }

    boolean chkKeyPush(int var1) {
        if (!this.m_pnt.m_bPause && !this.p_chk && this.m_pnt.m_bPauseT <= 0) {
            return (this.push_key_sys & this.keyTbl[var1]) == this.keyTbl[var1];
        } else {
            return false;
        }
    }

    public void setSaveData(int var1, int var2, int var3) {
        switch(var3) {
        case 1:
            this.SaveData[var1] = (byte)var2;
            break;
        case 2:
            this.SaveData[var1] = (byte)(var2 >> 8 & 255);
            this.SaveData[var1 + 1] = (byte)(var2 & 255);
        case 3:
        default:
            break;
        case 4:
            this.SaveData[var1] = (byte)(var2 >> 24 & 255);
            this.SaveData[var1 + 1] = (byte)(var2 >> 16 & 255);
            this.SaveData[var1 + 2] = (byte)(var2 >> 8 & 255);
            this.SaveData[var1 + 3] = (byte)(var2 & 255);
        }

    }

    protected void dataFormat() {
        int var1;
        for(var1 = 0; var1 < 512; ++var1) {
            this.SaveData[var1] = 0;
        }

        for(var1 = 0; var1 < 5; ++var1) {
            this.setSaveData(128 + var1 * 8, 10000 - var1 * 1000, 4);
            this.setSaveData(168 + var1 * 4, 500 - var1 * 50, 4);
            this.setSaveData(200 + var1 * 2, 5 - var1, 2);
            this.setSaveData(216 + var1 * 2, 10 - var1, 2);
            this.setSaveData(256 + var1 * 8, 10000 - var1 * 1000, 4);
            this.setSaveData(296 + var1 * 4, 100 - var1 * 10, 4);
            this.setSaveData(328 + var1 * 2, 5 - var1, 2);
            this.setSaveData(344 + var1 * 2, 10 - var1, 2);
        }

        this.SndSetVol(this.SaveData[16]);
        this.writeRS(0, this.SaveData);
    }

    protected void Initialize() {
    }

    public void run() {
        long var1 = 0L;
        long var3 = 0L;
        this.Initialize();

        while(true) {
            var3 = System.currentTimeMillis();
            Thread var10000;
            if (var3 - var1 < 32L && var3 - var1 > 0L) {
                try {
                    var10000 = this.m_thread;
                    Thread.sleep(32L - (var3 - var1));
                    var1 = var3 + (32L - (var3 - var1));
                } catch (InterruptedException var6) {
                }
            } else {
                try {
                    var10000 = this.m_thread;
                    Thread.sleep(1L);
                    var1 = var3 + 1L;
                } catch (InterruptedException var7) {
                }
            }

            this.paint2();
            this.chkVib();
            ++this.frame;
        }
    }

    public void commandAction() {
    }

    public void commandPop() {
    }

    public void commandPush() {
    }

    public void commandSet(int var1, int var2) {
        if (var1 == 0) {
            if (var2 == 0) {
                if (this.SaveData[16] <= 1) {
                    var2 = 7;
                } else if (this.SaveData[16] <= 3) {
                    var2 = 8;
                } else {
                    var2 = 9;
                }
            }

            this.setSoftLabel(0, this.SoftCmdName[0][var2]);
        } else {
            this.setSoftLabel(1, this.SoftCmdName[0][var2]);
        }

    }

    protected void setModeReq(int var1) {
        this.ModeReq = var1;
    }

    public void paint(Graphics var1) {
        this.gx = var1;
        this.g2 = var1;
    }

    void pushGraphics(Graphics var1, int var2, int var3) {
        this.gbk = this.gx;
        this.wbk = this.nFlushX;
        this.hbk = this.nFlushY;
        this.gx = var1;
        this.nFlushX = var2;
        this.nFlushY = var3;
        this.gx.setFont(this.font);
    }

    void popGraphics() {
        this.gx = this.gbk;
        this.nFlushX = this.wbk;
        this.nFlushY = this.hbk;
    }

    public void setColor(int var1) {
        Graphics var10001 = this.gx;
        this.gx.setColor(Graphics.getColorOfRGB(var1 >> 16 & 255, var1 >> 8 & 255, var1 & 255));
    }

    public void fillRect(int var1, int var2, int var3, int var4) {
        this.gx.fillRect(this.nFlushX + var1, this.nFlushY + var2, var3, var4);
    }

    public void drawRect(int var1, int var2, int var3, int var4) {
        this.gx.drawRect(this.nFlushX + var1, this.nFlushY + var2, var3, var4);
    }

    public void setClip(int var1, int var2, int var3, int var4) {
        this.gx.setClip(this.nFlushX + var1, this.nFlushY + var2, var3, var4);
    }

    public void drawImageC(Image var1, int var2, int var3) {
        this.drawImage(var1, var2 - var1.getWidth() / 2, var3 - var1.getHeight() / 2);
    }

    public void drawImage(Image var1, int var2, int var3) {
        this.gx.drawImage(var1, this.nFlushX + var2, this.nFlushY + var3);
    }

    public void drawString(int var1, int var2, String var3) {
        this.gx.drawString(var3, var1 + this.nFlushX, var2 + this.nFlushY + this.fontB);
    }

    public void drawStringC(int var1, int var2, String var3) {
        this.gx.drawString(var3, var1 + this.nFlushX - this.font.stringWidth(var3) / 2, var2 + this.nFlushY - this.fontH / 2 + this.fontB);
    }

    public void drawString2(int var1, int var2, int var3, int var4, String var5) {
        var1 += this.nFlushX;
        var2 += this.nFlushY;
        this.setColor(var4);

        for(int var6 = -1; var6 <= 1; ++var6) {
            for(int var7 = 0; var7 <= 2; ++var7) {
                if (var6 != 0 || var7 != 1) {
                    this.gx.drawString(var5, var1 + var6, var2 + var7 + this.fontB);
                }
            }
        }

        this.setColor(var3);
        this.gx.drawString(var5, var1, var2 + this.fontB);
    }

    public void drawString2C(int var1, int var2, int var3, int var4, String var5) {
        this.drawString2(var1 - this.font.stringWidth(var5) / 2, var2 - this.fontH / 2, var3, var4, var5);
    }

    public void drawString2R(int var1, int var2, int var3, int var4, String var5) {
        this.drawString2(var1 - this.font.stringWidth(var5), var2, var3, var4, var5);
    }

    public void drawStringR(int var1, int var2, String var3) {
        this.drawString(var1 - this.font.stringWidth(var3), var2, var3);
    }

    public void drawStringR2(int var1, int var2, int var3, int var4, String var5) {
        this.drawString2(var1 - this.font.stringWidth(var5), var2, var3, var4, var5);
    }

    public void drawLine(int var1, int var2, int var3, int var4) {
        this.gx.drawLine(var1 + this.nFlushX, var2 + this.nFlushY, var3 + this.nFlushX, var4 + this.nFlushY);
    }

    public void fiiRectRect(int var1, int var2, int var3, int var4, int var5) {
    }

    public void drawArc(int var1, int var2, int var3, int var4, int var5, int var6) {
        this.gx.drawArc(this.nFlushX + var1, this.nFlushY + var2, var3, var4, var5, var6);
    }

    public void fillArc(int var1, int var2, int var3, int var4, int var5, int var6) {
        this.gx.fillArc(this.nFlushX + var1, this.nFlushY + var2, var3, var4, var5, var6);
    }

    public int Sin(int var1) {
        var1 %= 360;
        var1 /= 3;
        return m_sintbl[var1];
    }

    public int Cos(int var1) {
        var1 = (var1 + 90) % 360;
        var1 /= 3;
        return m_sintbl[var1];
    }

    public void setVib(int var1) {
        if (this.SaveData[18] == 0) {
            this.VibCnt = var1;
            PhoneSystem.setAttribute(1, 1);
        }

    }

    public void chkVib() {
        if (this.SaveData[18] == 0) {
            try {
                --this.VibCnt;
                if (this.VibCnt <= 0) {
                    PhoneSystem.setAttribute(1, 0);
                }
            } catch (Exception var2) {
            }
        }

    }

    public int rand(int var1) {
        return this.m_rand != null ? Math.abs(this.m_rand.nextInt() % var1) : 0;
    }

    public Image createImage(String var1) {
        Image var2 = null;

        try {
            MediaImage var3 = MediaManager.getImage("resource:///" + var1 + ".gif");
            var3.use();
            var2 = var3.getImage();
        } catch (Exception var4) {
            var2 = null;
        }

        return var2;
    }

    public Image createImageJPG(String var1) {
        Image var2 = null;

        try {
            MediaImage var3 = MediaManager.getImage("resource:///" + var1 + ".jpg");
            var3.use();
            var2 = var3.getImage();
        } catch (Exception var4) {
            var2 = null;
        }

        return var2;
    }

    void readInit() {
        this.SeqWait = false;
        this.SeqMode = 0;
        this.LoadCnt = 0;
        this.LoadMax = 0;
    }

    public void readFile(int var1) {
        this.SeqWait = true;
        this.SeqMode = 65536 | var1;
        this.LoadCnt = 0;
        (new Thread() {
            public void run() {
                try {
                    switch(Module.this.Mode) {
                    case 0:
                    default:
                        break;
                    case 1:
                        Module.this.nImg[0] = Module.this.createImage("logo");
                        break;
                    case 16:
                        Module.this.Init_Title();
                        break;
                    case 32:
                        Module.this.Init_Game();
                        break;
                    case 256:
                        Module.this.writeRS(0, Module.this.SaveData);
                        Module.this.m_pnt.Exit();
                        return;
                    }

                    if (Module.this.Mode != 1) {
                        Module.this.commandSet(0, 0);
                    }

                    Module.this.ModeTime = 0;
                } catch (Exception var2) {
                }

                Module.this.SeqWait = false;
            }
        }).start();
    }

    public boolean readExec(Graphics var1) {
        return this.SeqWait;
    }

    void initRS() {
        boolean var4 = false;
        byte[] var5 = new byte[272];
        Object var6 = null;
        this.RSfileCnt = 0;
        this.RStopAddress = 272;

        int var1;
        for(var1 = 0; var1 < 32; ++var1) {
            this.RSfileTop[var1] = -1;
            this.RSfileSize[var1] = -1;
        }

        var4 = this.readRS_sub(0, var5);
        if (var4) {
            if (var5[0] == 86 && var5[1] == 69 && var5[2] == 82) {
                this.RSfileCnt = var5[4] << 24 & -16777216 | var5[5] << 16 & 16711680 | var5[6] << 8 & '?' | var5[7] << 0 & 255;
                this.RStopAddress = var5[8] << 24 & -16777216 | var5[9] << 16 & 16711680 | var5[10] << 8 & '?' | var5[11] << 0 & 255;
                int var3 = 16;

                for(var1 = 0; var1 < 32; ++var1) {
                    this.RSfileTop[var1] = var5[var3] << 24 & -16777216 | var5[var3 + 1] << 16 & 16711680 | var5[var3 + 2] << 8 & '?' | var5[var3 + 3] << 0 & 255;
                    var3 += 4;
                    this.RSfileSize[var1] = var5[var3] << 24 & -16777216 | var5[var3 + 1] << 16 & 16711680 | var5[var3 + 2] << 8 & '?' | var5[var3 + 3] << 0 & 255;
                    var3 += 4;
                }
            } else {
                this.SaveInfoRS_sub();
            }
        }

        Object var7 = null;
    }

    protected void SaveInfoRS(int var1, int var2) {
        if (this.RSfileTop[var1] == -1) {
            this.RSfileTop[var1] = this.RStopAddress;
            this.RSfileSize[var1] = var2;
            ++this.RSfileCnt;
            this.RStopAddress += var2;
            this.SaveInfoRS_sub();
        }

    }

    protected void SaveInfoRS_sub() {
        Object var1 = null;
        byte[] var2 = new byte[272];

        int var3;
        for(var3 = 0; var3 < 272; ++var3) {
            var2[var3] = 0;
        }

        var2[0] = 86;
        var2[1] = 69;
        var2[2] = 82;
        var2[4] = (byte)(this.RSfileCnt >> 24 & 255);
        var2[5] = (byte)(this.RSfileCnt >> 16 & 255);
        var2[6] = (byte)(this.RSfileCnt >> 8 & 255);
        var2[7] = (byte)(this.RSfileCnt & 255);
        var2[8] = (byte)(this.RStopAddress >> 24 & 255);
        var2[9] = (byte)(this.RStopAddress >> 16 & 255);
        var2[10] = (byte)(this.RStopAddress >> 8 & 255);
        var2[11] = (byte)(this.RStopAddress & 255);
        int var5 = 16;

        for(var3 = 0; var3 < 32; ++var3) {
            var2[var5] = (byte)(this.RSfileTop[var3] >> 24 & 255);
            var2[var5 + 1] = (byte)(this.RSfileTop[var3] >> 16 & 255);
            var2[var5 + 2] = (byte)(this.RSfileTop[var3] >> 8 & 255);
            var2[var5 + 3] = (byte)(this.RSfileTop[var3] & 255);
            var5 += 4;
            var2[var5] = (byte)(this.RSfileSize[var3] >> 24 & 255);
            var2[var5 + 1] = (byte)(this.RSfileSize[var3] >> 16 & 255);
            var2[var5 + 2] = (byte)(this.RSfileSize[var3] >> 8 & 255);
            var2[var5 + 3] = (byte)(this.RSfileSize[var3] & 255);
            var5 += 4;
        }

        this.writeRS_sub(0, var2);
        Object var6 = null;
    }

    boolean readRS(int var1, byte[] var2) {
        return this.RSfileTop[var1] == -1 ? false : this.readRS_sub(this.RSfileTop[var1], var2);
    }

    boolean writeRS(int var1, byte[] var2) {
        boolean var3 = false;
        boolean var4 = false;
        int var5;
        if (this.RSfileTop[var1] == -1) {
            var5 = this.RStopAddress;
        } else {
            var5 = this.RSfileTop[var1];
        }

        if (this.writeRS_sub(var5, var2)) {
            this.SaveInfoRS(var1, var2.length);
            var3 = true;
        }

        return var3;
    }

    boolean readRS_sub(int var1, byte[] var2) {
        boolean var3 = false;
        InputStream var4 = null;

        try {
            var4 = Connector.openInputStream(this.SPstring + var1 + ",length=" + var2.length);
            var4.read(var2);
            var4.close();
            var4 = null;
            var3 = true;
        } catch (Exception var15) {
        } finally {
            try {
                if (var4 != null) {
                    var4.close();
                    var4 = null;
                }
            } catch (Exception var14) {
            }

        }

        return var3;
    }

    boolean writeRS_sub(int var1, byte[] var2) {
        boolean var3 = false;
        OutputStream var4 = null;

        do {
            this.m_pnt.m_bPause = false;

            try {
                var4 = Connector.openOutputStream(this.SPstring + var1);
                var4.write(var2);
                var3 = true;
            } catch (ConnectionException var17) {
                this.m_pnt.m_bPause = true;
            } catch (Exception var18) {
                this.m_pnt.m_bPause = true;
            } finally {
                try {
                    if (var4 != null) {
                        var4.close();
                        var4 = null;
                    }
                } catch (Exception var16) {
                    this.m_pnt.m_bPause = true;
                    var4 = null;
                }

            }
        } while(this.m_pnt.m_bPause);

        return var3;
    }

    int getPackFileOffset(int var1, int var2) {
        return 0;
    }

    void SndInit() {
        this.STrack = new AudioPresenter[4];
        if (this.Snd3DF) {
            this.a3dST = new Audio3D[4];
        }

        try {
            for(this.MaxSndObj = 0; this.MaxSndObj < 4; ++this.MaxSndObj) {
                this.STrack[this.MaxSndObj] = AudioPresenter.getAudioPresenter(this.MaxSndObj);
                this.SPhrNo[this.MaxSndObj] = -1;
                if (this.Snd3DF) {
                    this.a3dST[this.MaxSndObj] = this.STrack[this.MaxSndObj].getAudio3D();
                }
            }
        } catch (Exception var2) {
        }

    }

    void SndLoad(int var1, int var2, int var3) {
        this.bgmLoadF = true;

        for(int var4 = 0; var4 < 1; ++var4) {
            System.gc();

            try {
                if (this.Phr[var2] != null) {
                    this.Phr[var2].dispose();
                    this.Phr[var2] = null;
                }

                this.Phr[var2] = MediaManager.getSound("resource:///" + this.SndFTBL[var3 * 2 + 1]);
                this.Phr[var2].use();
                this.bgmLoadF = false;
            } catch (Exception var6) {
            }

            if (!this.bgmLoadF) {
                break;
            }
        }

        this.bgmLoadF = false;
    }

    void SndSetVol(int var1) {
        byte var3;
        switch(var1) {
        case 0:
            var3 = 70;
            break;
        case 1:
            var3 = 52;
            break;
        case 2:
            var3 = 40;
            break;
        case 3:
            var3 = 17;
            break;
        default:
            var3 = 0;
        }

        try {
            for(int var2 = 0; var2 < this.MaxSndObj; ++var2) {
                this.STrack[var2].setAttribute(4, var3);
            }
        } catch (Exception var5) {
        }

    }

    void SndPlay(int var1, int var2) {
        if (var1 < this.MaxSndObj) {
            if (this.SPhrNo[var1] < 0) {
                this.setPhrase(var1, var2);
            } else if (this.SPhrNo[var1] == var2) {
                this.SndStop(var1);
                this.setPhrase(var1, var2);
            } else {
                this.SndStop(var1);
                this.setPhrase(var1, var2);
            }

            this.SndSetVol(this.SaveData[16]);
            this.soundPlay(var1, 1);
        }
    }

    void BGMPlay3(int var1, int var2, int var3, int var4, int var5) {
        if (!this.bgmLoadF) {
            try {
                if (this.SPhrNo[var1] < 0) {
                    this.setPhrase(var1, var2);
                } else if (this.SPhrNo[var1] == var2) {
                    this.SndStop(var1);
                    this.setPhrase(var1, var2);
                } else {
                    this.SndStop(var1);
                    this.setPhrase(var1, var2);
                }

                this.BGMflag = true;
                this.BGMloopCnt = var5;
                if (var5 == 0) {
                    this.STrack[var1].setMediaListener(this.ml);
                    this.BGMflag = true;
                } else {
                    this.STrack[var1].setMediaListener((MediaListener)null);
                }

                this.soundPlay(var1, var5);
                this.BGMSubject = 1;
            } catch (Exception var7) {
            }

        }
    }

    void SndStop(int var1) {
        if (var1 == 0) {
            this.BGMflag = false;
        }

        try {
            Thread var10000 = this.m_thread;
            Thread.sleep(1L);
            if (var1 >= this.MaxSndObj) {
                return;
            }

            this.STrack[var1].stop();
            if (this.Snd3DF) {
                this.a3dST[var1].disable();
            }
        } catch (Exception var3) {
        }

    }

    void SndStop2(int var1) {
        if (var1 == 0) {
            this.BGMflag = false;
        }

        try {
            Thread var10000 = this.m_thread;
            Thread.sleep(1L);
            if (var1 >= this.MaxSndObj) {
                return;
            }

            this.STrack[var1].stop();
            if (this.Snd3DF) {
                this.a3dST[var1].disable();
            }
        } catch (Exception var3) {
        }

    }

    void SndStop_ALL() {
        for(int var1 = 0; var1 < this.MaxSndObj; ++var1) {
            if (this.SPhrNo[var1] >= 0) {
                this.SndStop(var1);
            }
        }

    }

    void setPhrase(int var1, int var2) {
        try {
            this.STrack[var1].setSound(this.Phr[var2]);
            if (this.Snd3DF) {
                try {
                    int var3 = Integer.parseInt(this.Phr[var2].getProperty("3d.resources"));
                    this.a3dST[var1].enable(1, var3);
                } catch (Exception var4) {
                }
            }

            this.SPhrNo[var1] = var2;
        } catch (Exception var5) {
        }

    }

    void soundPlay(int var1, int var2) {
        try {
            this.STrack[var1].play();
        } catch (Exception var4) {
        }

    }

    void Init_Title() {
        this.mode2 = -1;
        if (this.GameSelectType == -1) {
            this.mode2req = 0;

            for(int var1 = 0; var1 < this.curY.length; ++var1) {
                this.curY[var1] = 0;
            }
        } else if (this.GameSelectType == 0) {
            this.mode2req = 2;
        } else {
            this.mode2req = 5;
        }

        this.mode2init = false;
        this.title_bgno = -1;
        this.curY[6] = 1;
        this.Read_Title();
    }

    void Release_Title() {
    }

    void Read_Title() {
        this.nImg[5] = this.createImage("mempj020");
        this.nImg[6] = this.createImage("mempj021");
        this.nImg[7] = this.createImage("mempj022");
        this.nImg[8] = this.createImage("mempj023");

        int var1;
        for(var1 = 0; var1 < 6; ++var1) {
            this.iGem[var1] = this.createImage("jemcj00" + var1);
        }

        for(var1 = 0; var1 < 5; ++var1) {
            this.iGem[var1 + 6] = this.createImage("jempj2" + var1 + "1");
        }

        this.iGem[12] = this.createImage("jempj200");
        this.iGem[13] = this.createImage("jemcj011");
        this.SndLoad(1, 7, 62);
        this.SndLoad(1, 8, 61);
        this.SndLoad(1, 3, 16);
        this.SndLoad(1, 4, 17);
        this.SndLoad(1, 5, 33);
        this.SndLoad(1, 6, 34);
    }

    void Exec_Title() {
        int var1;
        if (this.mode2 != this.mode2req) {
            if (this.title_bgno != this.menuTbl_map[this.mode2req][2] && this.menuTbl_map[this.mode2req][2] != -1) {
                this.title_bgno = this.menuTbl_map[this.mode2req][2];
                this.title_bgcnt = 0;

                for(var1 = 0; var1 < 36; ++var1) {
                    this.offy_map[0][var1] = 240 + this.rand(60);
                    this.offy_map[1][var1] = this.rand(8) + 1;
                }

                for(var1 = 40; var1 < 44; ++var1) {
                    this.offy_map[0][var1] = -this.rand(60);
                    this.offy_map[1][var1] = this.rand(16) + 1;
                }

                switch(this.title_bgno) {
                case 0:
                    var1 = 0;

                    for(; var1 < this.curY.length; ++var1) {
                        if (1 != var1) {
                            this.curY[var1] = 0;
                        }
                    }

                    this.curY[6] = 1;
                    this.GameSelectType = 2;
                    this.titleSE = 7;
                    this.SndLoad(0, 0, 0);
                    this.BGMPlay3(0, 0, 1, -1, 0);
                    this.nImg[0] = this.createImage("tit_bg01");
                    this.nImg[2] = this.createImage("tit_bg11");
                    this.nImg[10] = this.createImage("tit_logo");
                    this.nImg[11] = this.createImage("tit_mn01");
                    this.nImg[12] = this.createImage("tit_mn02");
                    this.nImg[13] = this.createImage("tit_mn03");
                    this.nImg[34] = this.createImage("tit_sega");
                    this.nImg[15] = this.createImage("tit_key");
                    this.nImg[16] = this.createImage("tit_pic1");
                    this.nImg[17] = this.createImage("tit_pic2");
                    this.nImg[18] = this.createImage("tit_pic3");
                    this.nImg[19] = this.createImage("tit_pic4");
                    this.nImg[26] = this.createImage("tit_mn04");
                    this.nImg[24] = this.createImage("tit_curl");
                    this.nImg[25] = this.createImage("tit_curr");
                    break;
                case 1:
                    this.titleSE = 3;
                    this.SndLoad(0, 0, 45);
                    this.BGMPlay3(0, 0, 1, -1, 0);
                    this.nImg[33] = this.createImage("frmcj999");
                    this.nImg[0] = this.createImage("memcj000");
                    this.nImg[1] = this.createImage("memcj001");
                    this.nImg[10] = this.createImage("memcj102");
                    this.nImg[11] = this.createImage("memcj101");
                    this.nImg[12] = this.createImage("memcj100");
                    this.nImg[13] = this.createImage("memcj104");
                    this.nImg[14] = this.createImage("memcj103");
                    this.nImg[15] = this.createImage("memcj105");
                    this.nImg[27] = this.createImage("frmcj104");
                    this.nImg[28] = this.createImage("jemcj006");
                    this.nImg[29] = this.createImage("jemcj009");
                    this.nImg[30] = this.createImage("jemcj008");
                    this.nImg[31] = this.createImage("jemcj007");
                    break;
                case 2:
                    this.nImg[33] = this.createImage("frmpj999");
                    this.titleSE = 5;
                    this.SndLoad(0, 0, 20);
                    this.BGMPlay3(0, 0, 1, 2, 0);
                    this.nImg[1] = this.createImage("mempj001");
                    this.nImg[2] = this.createImage("mempj002");
                    this.nImg[10] = this.createImage("mempj010");
                    this.nImg[11] = this.createImage("mempj011");
                    this.nImg[12] = this.createImage("mempj012");
                    this.nImg[13] = this.createImage("mempj013");
                    this.nImg[14] = this.createImage("mempj014");
                    this.nImg[15] = this.createImage("mempj015");
                    this.nImg[16] = this.createImage("mempj030");
                    this.nImg[17] = this.createImage("mempj031");
                    this.nImg[18] = this.createImage("mempj032");
                    this.nImg[19] = this.createImage("chrpjb00");
                    this.nImg[27] = this.createImage("jempj150");
                    this.nImg[28] = this.createImage("fntpj501");
                }
            }

            this.mode2 = this.mode2req;
            this.mode2time = 0;
            this.mode2init = true;
        } else {
            this.mode2init = false;
            this.mode2time += 2;
            this.title_bgcnt += 2;
            this.title_bgcnt2 += 2;
            this.Soft1Key();
        }

        int var2;
        int var10002;
        label959:
        switch(this.mode2) {
        case 0:
            if (this.mode2init) {
                this.commandSet(1, 3);
            }

            if (this.chkKeyPush(10)) {
                this.SndPlay(3, this.titleSE);
                this.mode2req = 1;
                this.title_bgcnt2 = 0;
                this.curY[1] = 0;
            } else if (this.chkKeyPush(18)) {
                this.mode2req = 21;
                this.exitCur = 1;
                this.commandSet(1, 2);
            }
            break;
        case 1:
            if (this.mode2init) {
                this.commandSet(1, 2);
            }

            if (this.chkKeyPush(10)) {
                if (this.title_bgcnt > 2) {
                    this.SndPlay(3, this.titleSE);
                    switch(this.curY[this.mode2]) {
                    case 0:
                        this.GameSelectType = 1;
                        this.mode2req = 5;
                        break label959;
                    case 1:
                        this.GameSelectType = 0;
                        this.mode2req = 2;
                        break label959;
                    case 2:
                        this.mode2req = 8;
                        break label959;
                    case 3:
                        this.mode2req = 20;
                        this.exitCur = 1;
                    }
                } else {
                    this.title_bgcnt = 0;
                    this.title_bgcnt2 = 9999999;
                }
            } else if (this.chkKeyPush(14)) {
                if (this.title_bgcnt > 2) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.curY[this.mode2] > 0) {
                        var10002 = this.curY[this.mode2]--;
                    } else {
                        this.curY[this.mode2] = this.menuTbl_map[this.mode2][1];
                    }

                    this.title_bgcnt = 0;
                } else {
                    this.title_bgcnt = 0;
                    this.title_bgcnt2 = 9999999;
                }
            } else if (this.chkKeyPush(15)) {
                if (this.title_bgcnt > 2) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.curY[this.mode2] < this.menuTbl_map[this.mode2][1]) {
                        var10002 = this.curY[this.mode2]++;
                    } else {
                        this.curY[this.mode2] = 0;
                    }

                    this.title_bgcnt = 0;
                } else {
                    this.title_bgcnt = 0;
                    this.title_bgcnt2 = 9999999;
                }
            } else if (this.chkKeyPush(18)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.mode2 == 12) {
                    if (this.GameSelectType == 0) {
                        this.mode2req = 2;
                    } else {
                        this.mode2req = 5;
                    }
                } else {
                    this.mode2req = this.menuTbl_map[this.mode2][0];
                }
            }
            break;
        case 2:
        case 4:
        case 5:
        case 6:
        case 7:
            if (this.mode2init) {
                this.commandSet(1, 2);
            }

            if (this.chkKeyPush(10)) {
                this.SndPlay(3, this.titleSE);
                label713:
                switch(this.mode2) {
                case 2:
                    switch(this.curY[this.mode2]) {
                    case 0:
                        this.GamePlayMode = 2;
                        this.GameStageNo = 0;
                        if (this.SaveData[32] != 0) {
                            this.GameStageNo = this.SaveData[32];
                            if (this.GameStageNo > 9) {
                                this.GameStageNo = 9;
                            }
                        }

                        this.mode2req = 4;
                        break;
                    case 1:
                        this.mode2req = 12;
                        this.GamePlayMode = 1;
                        break;
                    case 2:
                        this.GamePlayMode = 0;
                        this.setModeReq(32);
                        break;
                    case 3:
                        this.mode2req = 15;
                        break;
                    case 4:
                        this.mode2req = 16;
                        break;
                    case 5:
                        this.mode2req = 18;
                        this.title_helppage = 0;
                    }
                case 3:
                default:
                    break;
                case 4:
                case 7:
                    switch(this.curY[this.mode2]) {
                    case 0:
                        this.GameStageNo = 0;
                        this.setModeReq(32);
                        break label713;
                    case 1:
                        this.setModeReq(32);
                        break label713;
                    case 2:
                        this.GameStageNo = 4;
                        this.setModeReq(32);
                    default:
                        break label713;
                    }
                case 5:
                    switch(this.curY[this.mode2]) {
                    case 0:
                        this.GamePlayMode = 2;
                        this.GameStageNo = 0;
                        if (this.SaveData[33] != 0) {
                            this.GameStageNo = this.SaveData[33];
                            if (this.GameStageNo > 9) {
                                this.GameStageNo = 9;
                            }
                        }

                        this.mode2req = 7;
                        break label713;
                    case 1:
                        this.mode2req = 12;
                        this.GamePlayMode = 1;
                        break label713;
                    case 2:
                        this.mode2req = 6;
                        break label713;
                    case 3:
                        this.mode2req = 15;
                        break label713;
                    case 4:
                        this.mode2req = 17;
                        break label713;
                    case 5:
                        this.mode2req = 19;
                        this.title_helppage = 0;
                    default:
                        break label713;
                    }
                case 6:
                    switch(this.curY[this.mode2]) {
                    case 0:
                        this.GamePlayMode = 4;
                        this.setModeReq(32);
                        break;
                    case 1:
                        this.GamePlayMode = 0;
                        this.setModeReq(32);
                        break;
                    case 2:
                        this.GamePlayMode = 3;
                        this.setModeReq(32);
                    }
                }
            } else if (this.chkKeyPush(14)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] > 0) {
                    var10002 = this.curY[this.mode2]--;
                } else {
                    this.curY[this.mode2] = this.menuTbl_map[this.mode2][1];
                }

                if (this.mode2 == 1) {
                    this.title_bgcnt = 0;
                    this.title_bgcnt2 = 9999999;
                } else if ((this.mode2 == 4 || this.mode2 == 7) && this.SaveData[32 + this.GameSelectType] == 0) {
                    this.curY[this.mode2] = 0;
                }
            } else if (this.chkKeyPush(15)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] < this.menuTbl_map[this.mode2][1]) {
                    var10002 = this.curY[this.mode2]++;
                } else {
                    this.curY[this.mode2] = 0;
                }

                if (this.mode2 == 1) {
                    this.title_bgcnt = 0;
                    this.title_bgcnt2 = 9999999;
                } else if ((this.mode2 == 4 || this.mode2 == 7) && this.SaveData[32 + this.GameSelectType] == 0) {
                    this.curY[this.mode2] = 0;
                }
            } else if (this.chkKeyPush(18)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.mode2 == 12) {
                    if (this.GameSelectType == 0) {
                        this.mode2req = 2;
                    } else {
                        this.mode2req = 5;
                    }
                } else {
                    this.mode2req = this.menuTbl_map[this.mode2][0];
                }
            }
        case 3:
        case 9:
        case 10:
        case 23:
        default:
            break;
        case 8:
            if (this.mode2init) {
            }

            if (this.chkKeyPush(10)) {
                this.SndPlay(3, this.titleSE);
                switch(this.curY[this.mode2]) {
                case 0:
                case 1:
                    this.mode2req = this.menuTbl_map[this.mode2][0];
                    this.writeRS(0, this.SaveData);

                    for(var1 = 0; var1 < this.curY.length; ++var1) {
                        if (1 != var1) {
                            this.curY[var1] = 0;
                        }
                    }

                    this.curY[6] = 2;
                    break label959;
                case 2:
                    this.mode2req = 11;
                }
            } else if (this.chkKeyPush(13)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] > 0) {
                    var10002 = this.curY[this.mode2]--;
                } else {
                    this.curY[this.mode2] = this.menuTbl_map[this.mode2][1];
                }
            } else if (this.chkKeyPush(16)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] < this.menuTbl_map[this.mode2][1]) {
                    var10002 = this.curY[this.mode2]++;
                } else {
                    this.curY[this.mode2] = 0;
                }
            } else if (this.chkKeyPush(15)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] == 0) {
                    if (this.SaveData[16] > 0) {
                        --this.SaveData[16];
                    } else {
                        this.SaveData[16] = 4;
                    }

                    this.commandSet(0, 0);
                    this.SndSetVol(this.SaveData[16]);
                } else if (this.curY[this.mode2] == 1) {
                    if (this.SaveData[18] == 0) {
                        this.SaveData[18] = 1;
                    } else {
                        this.SaveData[18] = 0;
                    }
                }
            } else if (this.chkKeyPush(14)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] == 0) {
                    if (this.SaveData[16] < 4) {
                        ++this.SaveData[16];
                    } else {
                        this.SaveData[16] = 0;
                    }

                    this.commandSet(0, 0);
                    this.SndSetVol(this.SaveData[16]);
                } else if (this.curY[this.mode2] == 1) {
                    if (this.SaveData[18] == 0) {
                        this.SaveData[18] = 1;
                    } else {
                        this.SaveData[18] = 0;
                    }
                }
            } else if (this.chkKeyPush(18)) {
                this.SndPlay(3, this.titleSE + 1);
                this.writeRS(0, this.SaveData);
                this.mode2req = this.menuTbl_map[this.mode2][0];

                for(var1 = 0; var1 < this.curY.length; ++var1) {
                    if (1 != var1) {
                        this.curY[var1] = 0;
                    }
                }

                this.curY[6] = 2;
            }
            break;
        case 11:
        case 22:
            if (this.mode2init) {
                this.curY[this.mode2] = 1;
            }

            if (this.chkKeyPush(10)) {
                this.SndPlay(3, this.titleSE);
                if (this.mode2 == 11) {
                    if (this.curY[this.mode2] == 0) {
                        this.mode2req = 22;
                    } else {
                        this.mode2req = this.menuTbl_map[this.mode2][0];
                    }
                } else if (this.curY[this.mode2] == 0) {
                    this.dataFormat();
                    this.commandSet(0, 0);
                    this.mode2req = 24;
                } else {
                    this.mode2req = this.menuTbl_map[this.mode2][0];
                }
            } else if (!this.chkKeyPush(13) && !this.chkKeyPush(16)) {
                if (this.chkKeyPush(18)) {
                    this.SndPlay(3, this.titleSE + 1);
                    this.mode2req = this.menuTbl_map[this.mode2][0];
                }
            } else {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] == 0) {
                    this.curY[this.mode2] = 1;
                } else {
                    this.curY[this.mode2] = 0;
                }
            }
            break;
        case 12:
            if (this.mode2init) {
                this.btPlayStat = 0;
                this.subCur = 0;
            }

            if (this.chkKeyPush(10)) {
                this.SndPlay(3, this.titleSE);
                if (this.btNetSeek == 0) {
                    switch(this.curY[this.mode2]) {
                    case 0:
                        this.mode2req = 13;
                        if (this.bt_server1st) {
                            this.bt_mode = 0;
                        } else {
                            this.bt_mode = 9;
                        }
                        break label959;
                    case 1:
                        this.mode2req = 14;
                        if (this.bt_server1st) {
                            this.bt_mode = 0;
                        } else {
                            this.bt_mode = 9;
                        }
                        break label959;
                    case 2:
                        this.mode2req = 13;
                        if (this.bt_server1st) {
                            this.bt_mode = 0;
                        } else {
                            this.bt_mode = 10;
                        }
                        break label959;
                    case 3:
                        this.mode2req = 14;
                        if (this.bt_server1st) {
                            this.bt_mode = 0;
                        } else {
                            this.bt_mode = 10;
                        }
                    }
                }
            } else if (this.chkKeyPush(13)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] > 0) {
                    var10002 = this.curY[this.mode2]--;
                } else {
                    this.curY[this.mode2] = 3;
                }
            } else if (this.chkKeyPush(16)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.curY[this.mode2] < 3) {
                    var10002 = this.curY[this.mode2]++;
                } else {
                    this.curY[this.mode2] = 0;
                }
            } else if (this.chkKeyPush(18)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.mode2 == 12) {
                    if (this.GameSelectType == 0) {
                        this.mode2req = 2;
                    } else {
                        this.mode2req = 5;
                    }
                } else {
                    this.mode2req = this.menuTbl_map[this.mode2][0];
                }
            }
            break;
        case 13:
            if (this.mode2init) {
            }

            switch(this.bt_mode) {
            case 3:
                var2 = this.btConnectChk();
                if (var2 == 1) {
                    this.btConnectSet(9);
                    this.bt_mode = 6;
                    this.mode2time = 0;
                    this.commandSet(1, 6);
                } else if (var2 == 255 || var2 == 2) {
                    this.bt_mode = 255;
                    this.mode2time = 0;
                    this.subCur = 0;
                }
                break;
            case 4:
            case 5:
            case 255:
                this.commandSet(1, 2);
                if (this.chkKeyPush(10)) {
                    this.SndPlay(3, this.titleSE);
                    this.btConnectSet(160);
                    this.mode2req = 12;
                    this.commandSet(1, 2);
                }
                break;
            case 6:
                var2 = this.btConnectChk();
                if ((this.btStat & 32) != 0) {
                    var2 = 255;
                }

                if (var2 == 1) {
                    this.btWait = 0;
                    this.bt_mode = 80;
                } else if (var2 == 2) {
                    this.bt_mode = 5;
                    this.commandSet(1, 2);
                } else if (var2 == 255) {
                    this.bt_mode = 255;
                    this.mode2time = 0;
                    this.subCur = 0;
                }
                break;
            case 9:
                this.bt_mode = 3;
                this.bt_mode = 20;
                this.btConnectSet(1);
                break;
            case 10:
                this.bt_mode = 3;
                this.bt_mode = 20;
                this.btConnectSet(11);
                break;
            case 20:
                if (this.btNetSeek == 3) {
                    this.bt_mode = 21;
                } else if (this.btNetSeek == 0) {
                    this.bt_mode = 4;
                }
                break;
            case 21:
                if (this.btNetSeek == 0) {
                    this.bt_mode = 4;
                }

                if (this.chkKeyPush(10)) {
                    this.btConnectSet(4);
                    this.bt_mode = 3;
                }
                break;
            case 80:
                this.btWait += 2;
                var2 = this.btConnectChk();
                if (var2 == 255) {
                    this.bt_mode = 255;
                    this.mode2time = 0;
                    this.subCur = 0;
                } else if (this.btWait >= 60) {
                    this.setModeReq(32);
                }
            }

            if (this.chkKeyPush(18) && this.bt_mode != 3 && this.bt_mode != 6 && this.bt_mode != 80) {
                this.SndPlay(3, this.titleSE + 1);
                this.btConnectSet(160);
                this.mode2req = this.menuTbl_map[this.mode2][0];
            }
            break;
        case 14:
            switch(this.bt_mode) {
            case 0:
            default:
                break;
            case 1:
                if (this.btLockTime > 0) {
                    this.btLockTime -= 2;
                } else {
                    this.commandSet(1, 2);
                }

                var2 = this.btConnectChk();
                if (var2 == 1) {
                    this.commandSet(1, 2);
                    this.bt_mode = 2;
                    this.mode2time = 0;
                    this.btCur = 0;
                } else if (var2 == 255) {
                    this.commandSet(1, 2);
                    this.bt_mode = 4;
                    this.mode2time = 0;
                    this.subCur = 0;
                }
                break;
            case 2:
                var2 = this.btConnectChk();
                if ((this.btStat & 32) != 0) {
                    var2 = 255;
                }

                if (var2 == 255) {
                    this.bt_mode = 255;
                    this.mode2time = 0;
                    this.subCur = 0;
                } else if (this.chkKeyPush(10)) {
                    this.SndPlay(3, this.titleSE);
                    this.btConnectSet(35);
                    if (this.btCur == 0) {
                        this.bt_mode = 8;
                        this.commandSet(1, 6);
                    } else {
                        this.bt_mode = 29;
                    }
                } else if (this.chkKeyPush(13)) {
                    this.SndPlay(3, this.titleSE + 1);
                    this.btCur = this.btCur + 1 & 1;
                } else if (this.chkKeyPush(16)) {
                    this.SndPlay(3, this.titleSE + 1);
                    this.btCur = this.btCur + 1 & 1;
                }
                break;
            case 4:
            case 255:
                if (this.chkKeyPush(10)) {
                    this.SndPlay(3, this.titleSE);
                    this.mode2req = 12;
                    this.btConnectSet(160);
                }
                break;
            case 8:
                var2 = this.btConnectChk();
                if (var2 == 255) {
                    this.bt_mode = 255;
                    this.mode2time = 0;
                    this.subCur = 0;
                } else if (this.btRecvBuf[this.btRecvTop2][0] == 21) {
                    this.btWait = 0;
                    this.bt_mode = 80;
                }
                break;
            case 9:
                this.btPlayStat = 1;
                this.bt_mode = 1;
                this.mode2time = 0;
                this.btConnectSet(33);
                this.btLockTime = 300;
                this.commandSet(1, 6);
                break;
            case 10:
                this.btPlayStat = 1;
                this.bt_mode = 1;
                this.mode2time = 0;
                this.btLockTime = 300;
                this.btConnectSet(42);
                this.commandSet(1, 6);
                break;
            case 29:
                this.btConnectSet(160);
                this.mode2req = this.menuTbl_map[this.mode2][0];
                break;
            case 80:
                this.btWait += 2;
                var2 = this.btConnectChk();
                if (var2 == 255) {
                    this.bt_mode = 255;
                    this.mode2time = 0;
                    this.subCur = 0;
                } else if (this.btWait >= 60) {
                    this.GameSelectType = this.btGameReq;
                    this.setModeReq(32);
                    return;
                }
            }

            if (this.bt_mode != 8 && this.bt_mode != 80 && (this.bt_mode != 1 || this.btLockTime <= 0) && this.chkKeyPush(18)) {
                this.commandSet(1, 2);
                this.SndPlay(3, this.titleSE + 1);
                this.btConnectSet(160);
                this.mode2req = this.menuTbl_map[this.mode2][0];
            }
            break;
        case 15:
            if (this.mode2init) {
            }

            if (this.chkKeyPush(18)) {
                this.SndPlay(3, this.titleSE + 1);
                if (this.GameSelectType == 0) {
                    this.mode2req = 2;
                } else {
                    this.mode2req = 5;
                }
            }
            break;
        case 16:
        case 17:
            if (this.mode2init) {
            }

            if (this.chkKeyPush(10)) {
                this.SndPlay(3, this.titleSE);
                if (this.GameSelectType == 0) {
                    this.mode2req = 2;
                } else {
                    this.mode2req = 5;
                }

                this.writeRS(0, this.SaveData);
            } else if (!this.chkKeyPush(14) && !this.chkKeyPush(15)) {
                if (this.chkKeyPush(18)) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.GameSelectType == 0) {
                        this.mode2req = 2;
                    } else {
                        this.mode2req = 5;
                    }

                    this.writeRS(0, this.SaveData);
                }
            } else {
                this.SndPlay(3, this.titleSE + 1);
                this.SaveData[34 + this.GameSelectType] = (byte)(this.SaveData[34 + this.GameSelectType] + 1 & 1);
            }
            break;
        case 18:
        case 19:
            if (this.mode2init) {
            }

            switch(this.title_helppage) {
            case 0:
                if (this.chkKeyPush(10)) {
                    this.SndPlay(3, this.titleSE);
                    this.title_helppage = this.curY[this.mode2] + 1;
                    this.title_helppage2 = 0;
                } else if (this.chkKeyPush(13)) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.curY[this.mode2] > 0) {
                        var10002 = this.curY[this.mode2]--;
                    } else {
                        this.curY[this.mode2] = this.titleMenuSTR[0][this.mode2].length - 1;
                    }
                } else if (this.chkKeyPush(16)) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.curY[this.mode2] < this.titleMenuSTR[0][this.mode2].length - 1) {
                        var10002 = this.curY[this.mode2]++;
                    } else {
                        this.curY[this.mode2] = 0;
                    }
                } else if (this.chkKeyPush(18)) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.GameSelectType == 0) {
                        this.mode2req = 2;
                    } else {
                        this.mode2req = 5;
                    }
                }
                break label959;
            default:
                if (this.chkKeyPush(10)) {
                    this.SndPlay(3, this.titleSE);
                    if (this.title_helppage2 < this.titleGameHELP[0][this.GameSelectType][this.title_helppage - 1].length - 1) {
                        ++this.title_helppage2;
                    } else {
                        this.title_helppage = 0;
                    }
                } else if (this.chkKeyPush(14)) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.title_helppage2 > 0) {
                        --this.title_helppage2;
                    }
                } else if (this.chkKeyPush(15)) {
                    this.SndPlay(3, this.titleSE + 1);
                    if (this.title_helppage2 < this.titleGameHELP[0][this.GameSelectType][this.title_helppage - 1].length - 1) {
                        ++this.title_helppage2;
                    }
                } else if (this.chkKeyPush(18)) {
                    this.SndPlay(3, this.titleSE + 1);
                    this.title_helppage = 0;
                }
                break label959;
            }
        case 20:
        case 21:
            if (this.mode2init) {
                this.exitCur = 1;
            }

            if (this.chkKeyPush(10)) {
                if (this.exitCur == 0) {
                    this.setModeReq(256);
                } else {
                    this.mode2req = this.menuTbl_map[this.mode2][0];
                }
            } else if (this.chkKeyPush(13)) {
                this.exitCur = this.exitCur + 1 & 1;
            } else if (this.chkKeyPush(16)) {
                this.exitCur = this.exitCur + 1 & 1;
            } else if (this.chkKeyPush(18)) {
                this.mode2req = this.menuTbl_map[this.mode2][0];
                if (this.mode2 == 21) {
                    this.commandSet(1, 3);
                } else {
                    this.commandSet(1, 2);
                }
            }
            break;
        case 24:
            if (this.chkKeyPush(10) || this.chkKeyPush(18)) {
                this.mode2req = this.menuTbl_map[this.mode2][0];
            }
        }

        this.setClip(0, 0, 240, 240);
        int var4;
        int var5;
        int var6;
        int[] var12;
        switch(this.title_bgno) {
        case 0:
            this.drawImage(this.nImg[0], 0, 0);
            break;
        case 1:
            this.setColor(0);
            this.fillRect(0, 0, 240, 240);

            for(var4 = 0; var4 < 24; ++var4) {
                this.setClip(var4 * 10, this.offy_map[0][var4], 16, 16);
                this.drawImage(this.iGem[var4 % 6], var4 * 10 - (this.mode2time / 2 & 3) * 16, this.offy_map[0][var4]);
                var5 = this.offy_map[0][var4] - 32;
                var6 = var4 * 10 + 2;
                this.setClip(var6, var5, 13, 12);
                this.drawImage(this.iGem[13], var6 - 32, var5 - (this.mode2time + var4 * 8) / 2 / 4 % 6 * 12);
                var5 = this.offy_map[0][var4] - 20;
                this.setClip(var6, var5, 13, 12);
                this.drawImage(this.iGem[13], var6 - 32, var5 - (this.mode2time + var4) / 2 / 2 % 6 * 12);
                var5 = this.offy_map[0][var4] - 8;
                this.setClip(var6, var5, 13, 12);
                this.drawImage(this.iGem[13], var6 - 32, var5 - (this.mode2time + var4 * 4) / 2 % 6 * 12);
                var12 = this.offy_map[0];
                var12[var4] += this.offy_map[1][var4];
                if (this.offy_map[0][var4] > 240) {
                    var12 = this.offy_map[0];
                    var12[var4] -= 300;
                    this.offy_map[1][var4] = this.rand(16) + 1;
                }
            }

            this.setClip(0, 0, 240, 240);
            this.drawImage(this.nImg[0], 0, 0);
            this.drawImage(this.nImg[1], 31, 30);
            this.drawImageC(this.nImg[34], 120, 228);
            break;
        case 2:
            this.setColor(0);
            this.fillRect(0, 0, 240, 240);

            for(var4 = 0; var4 < 36; ++var4) {
                this.setClip(var4 * 32 % 240 + 8 - var4 / 10 * 8, 240 - this.offy_map[0][var4], 24, 24);
                this.drawImage(this.iGem[var4 % 5 + 6], var4 * 32 % 240 + 8 - var4 / 10 * 8 - (216 + this.mode2time / 2 / 4 % this.PuyoTbl[var4 % 5] * 24) % 240, 240 - (216 + this.mode2time / 2 / 4 % this.PuyoTbl[var4 % 5] * 24) / 240 * 24 - this.offy_map[0][var4]);
                var12 = this.offy_map[0];
                var12[var4] -= this.offy_map[1][var4];
                if (this.offy_map[0][var4] < -24) {
                    var12 = this.offy_map[0];
                    var12[var4] += 300;
                    this.offy_map[1][var4] = this.rand(16) + 1;
                }
            }

            var12 = this.offy_map[0];
            var12[36] += 2;
            var4 = 240 - this.offy_map[0][36];
            if (this.offy_map[0][36] > 440) {
                this.offy_map[1][36] = this.rand(120) - 60;
                this.offy_map[0][36] = 0;
            }

            var5 = this.offy_map[1][36] + 110;
            this.setClip(var4, var5, 32, 32);
            this.drawImage(this.nImg[19], var4 - this.mode2time / 2 / 4 % 2 * 32, var5 - 64);
            var4 += 40;

            for(var1 = 0; var1 < 5; ++var1) {
                this.setClip(var4, var5 + 8, 24, 24);
                this.drawImage(this.iGem[var1 % 5 + 6], var4 - (216 + this.mode2time / 2 / 4 % this.PuyoTbl[var1 % 5] * 24) % 240, var5 + 8 - (216 + this.mode2time / 2 / 4 % this.PuyoTbl[var1 % 5] * 24) / 240 * 24);
                var4 += 32;
            }

            this.setClip(0, 0, 240, 240);
            var1 = -240 + this.title_bgcnt * 2;
            if (var1 > 0) {
                var1 = 0;
            }

            this.drawImage(this.nImg[1], 75, 24 + var1);
            var1 = -120 + this.title_bgcnt;
            if (var1 > 0) {
                var1 = 0;
            }

            this.drawImage(this.nImg[2], 8, 52 + var1);
            this.drawImageC(this.nImg[34], 120, 228);
        }

        this.setClip(0, 0, 240, 240);
        boolean var8;
        switch(this.mode2) {
        case 0:
        case 1:
            for(var4 = 0; var4 < 24; ++var4) {
                this.setClip(var4 * 10, this.offy_map[0][var4], 16, 16);
                this.drawImage(this.iGem[var4 % 6], var4 * 10 - (this.mode2time / 2 & 3) * 16, this.offy_map[0][var4]);
                var12 = this.offy_map[0];
                var12[var4] -= this.offy_map[1][var4];
                if (this.offy_map[0][var4] < -24) {
                    var12 = this.offy_map[0];
                    var12[var4] += 300;
                    this.offy_map[1][var4] = this.rand(16) + 1;
                }
            }

            for(var4 = 0; var4 < 12; ++var4) {
                this.setClip(var4 * 48 + 8, this.offy_map[0][var4 + 24], 24, 24);
                this.drawImage(this.iGem[var4 % 5 + 6], var4 * 48 + 8 - (216 + this.mode2time / 2 / 4 % this.PuyoTbl[var4 % 5] * 24) % 240, this.offy_map[0][var4 + 24] - (216 + this.mode2time / 2 / 4 % this.PuyoTbl[var4 % 5] * 24) / 240 * 24);
                var12 = this.offy_map[0];
                var12[var4 + 24] -= this.offy_map[1][var4 + 24];
                if (this.offy_map[0][var4 + 24] < -24) {
                    var12 = this.offy_map[0];
                    var12[var4 + 24] += 300;
                    this.offy_map[1][var4 + 24] = this.rand(16) + 1;
                }
            }

            this.setClip(0, 0, 240, 240);
            this.drawImageC(this.nImg[10], 120, 93);
            this.drawImageC(this.nImg[34], 120, 222);
            if (this.mode2 == 0) {
                if ((this.mode2time / 2 & 8) == 0) {
                    this.drawImageC(this.nImg[15], 120, 187);
                }

                this.title_bgcnt = 0;
            } else {
                var6 = this.title_bgcnt2 * 10 - 160;

                for(var1 = 0; var1 < 36; ++var1) {
                    if (var1 % 6 == 0) {
                        var6 += 160;
                    }

                    var4 = var1 % 6 * 40;
                    var5 = -240 + var6;
                    if (200 - var1 / 6 * 40 < var5) {
                        var5 = 200 - var1 / 6 * 40;
                    }

                    this.setClip(var4, var5, 40, 40);
                    if ((var1 + var1 / 6 & 1) == 0) {
                        this.drawImage(this.nImg[2], var4, var5);
                    } else {
                        this.drawImage(this.nImg[2], var4 - 40, var5);
                    }

                    var6 -= 60;
                    if (var6 < 0) {
                        break;
                    }
                }

                if (var6 > 240) {
                    var4 = this.title_bgcnt * 80 / 10;
                    var5 = this.title_bgcnt * 60 / 10;
                    if (var4 > 80) {
                        var4 = 80;
                    }

                    if (var5 > 60) {
                        var5 = 60;
                    }

                    this.setClip(0, 0, 240, 240);
                    if (this.curY[this.mode2] == 3) {
                        this.drawImageC(this.nImg[26], 120, 175);
                    } else {
                        this.drawImageC(this.nImg[11 + this.curY[this.mode2]], 120, 175);
                    }

                    this.drawImageC(this.nImg[24], 52 - this.mode2time / 2 / 4 % 10, 175);
                    this.drawImageC(this.nImg[25], 188 + this.mode2time / 2 / 4 % 10, 175);
                    this.drawHelp(this.mode2, this.curY[this.mode2], 214);
                    this.setColor(0);
                    this.fillRect(40, 40, 160, 120);
                    this.setClip(120 - var4, 100 - var5, var4 * 2, var5 * 2);
                    this.drawImage(this.nImg[16 + this.curY[this.mode2]], 40, 40);
                    this.setClip(0, 0, 240, 240);
                } else {
                    this.title_bgcnt = 0;
                }
            }
            break;
        case 2:
            this.drawImageC(this.nImg[10 + this.curY[this.mode2]], 120, 117);
            this.drawSelT(52, 180, 109);
            this.drawHelp(this.mode2, this.curY[this.mode2], 214);
        case 3:
        case 9:
        case 10:
        case 23:
        default:
            break;
        case 4:
        case 7:
            this.drawCur(147 - this.fontH / 2, 0);
            if (this.curY[this.mode2] == 1) {
                this.drawStringC(120, 147, this.titleMenuSTR[0][this.mode2][this.curY[this.mode2]] + " STAGE" + (this.GameStageNo + 1));
            } else {
                this.drawStringC(120, 147, this.titleMenuSTR[0][this.mode2][this.curY[this.mode2]]);
            }

            if (this.SaveData[32 + this.GameSelectType] != 0) {
                this.drawSelT(32, 200, 140);
            }

            this.drawHelp(this.mode2, this.curY[this.mode2], 214);
            break;
        case 5:
            this.drawImageC(this.nImg[10 + this.curY[this.mode2]], 120, 147);
            this.drawSelT(52, 180, 140);
            this.drawHelp(this.mode2, this.curY[this.mode2], 214);
            break;
        case 6:
            var8 = false;
            var4 = this.mode2time / 2;
            if (var4 > 20) {
                var4 = 20;
            }

            this.drawImageC(this.nImg[16 + this.curY[this.mode2]], 120, 147);
            this.drawImageC(this.nImg[12], 120, 147 - var4);
            this.drawSelT(52, 180, 140);
            this.drawHelp(this.mode2, this.curY[this.mode2], 214);
            break;
        case 8:
            for(var1 = 0; var1 < 36; ++var1) {
                var4 = var1 % 6 * 40;
                var5 = 200 - var1 / 6 * 40;
                this.setClip(var4, var5, 40, 40);
                if ((var1 + var1 / 6 & 1) == 0) {
                    this.drawImage(this.nImg[2], var4, var5);
                } else {
                    this.drawImage(this.nImg[2], var4 - 40, var5);
                }
            }

            var8 = true;
            boolean var9 = true;
            this.setClip(0, 0, 240, 240);
            this.drawImageC(this.nImg[13], 120, 175);
            this.drawImage(this.nImg[18], 40, 40);
            this.setColor(0);

            for(var1 = 0; var1 < 240; var1 += 2) {
                this.drawLine(0, var1, 240, var1);
            }

            this.drawString2C(120, 20, 16777215, 4210752, this.titleMenuSTR[0][1][2]);
            this.drawCur(60, this.curY[this.mode2]);
            this.setColor(16777215);

            for(var1 = 0; var1 < 3; ++var1) {
                this.drawString2(30, 60 + var1 * 25, 16777215, 4210752, this.titleMenuSTR[0][this.mode2][var1]);
            }

            String[] var10 = new String[]{"4", "3", "2", "1", "off"};
            String[] var11 = new String[]{"on", "off"};
            this.drawStringR2(220, 60, 16777215, 4210752, "" + var10[this.SaveData[16]]);
            this.drawStringR2(220, 85, 16777215, 4210752, "" + var11[this.SaveData[18]]);
            this.drawSelT(176, 224, 60 + (this.fontH - 16) / 2);
            this.drawSelT(176, 224, 85 + (this.fontH - 16) / 2);
            this.drawHelp(this.mode2, this.curY[this.mode2], 214);
            break;
        case 11:
        case 22:
            this.setColor(0);

            for(var1 = 0; var1 < 240; var1 += 2) {
                this.drawLine(0, var1, 240, var1);
            }

            if (this.mode2 == 11) {
                this.drawStringT(60, this.titleMenuSTR2[0][4][0]);
                this.drawStringT(84, this.titleMenuSTR2[0][4][1]);
            } else {
                this.drawStringT(60, this.titleMenuSTR2[0][5][0]);
                this.drawStringT(84, this.titleMenuSTR2[0][5][1]);
            }

            this.drawCur(143 - this.fontH / 2, this.curY[this.mode2]);
            this.setColor(16777215);
            this.drawStringC(120, 143, this.titleMenuSTR2[0][0][0]);
            this.drawStringC(120, 168, this.titleMenuSTR2[0][0][1]);
            break;
        case 12:
            this.drawHelp(this.mode2, this.curY[this.mode2], 234);
            this.drawWinG(12, 12, 216, 184);
            this.setClip(8, 5, 224, 240);
            if (this.GameSelectType == 1) {
                this.drawStringT(15, this.titleMenuSTR2[0][7][1]);
            } else {
                this.drawStringT(15, this.titleMenuSTR2[0][7][0]);
            }

            this.drawCur(140 - this.fontH / 2 - 25, this.curY[this.mode2]);
            this.setColor(16777215);
            if (this.btNetSeek != 0) {
                this.drawStringC(120, 40, "前回の相手プレイヤーの通信が");
                this.drawStringC(120, 64, "正常に切断されていないため  ");
                this.drawStringC(120, 88, "新規接続が出来ません。      ");
            } else {
                this.drawStringC(120, 40, this.BTMenuSTR2[0][5][0]);
                this.drawStringC(120, 64, this.BTMenuSTR2[0][5][1]);
                this.drawStringC(120, 88, this.BTMenuSTR2[0][5][2]);
            }

            this.drawStringC(120, 115, this.BTMenuSTR2[0][5][3]);
            this.drawStringC(120, 140, this.BTMenuSTR2[0][5][4]);
            this.drawStringC(120, 165, this.BTMenuSTR2[0][5][5]);
            this.drawStringC(120, 190, this.BTMenuSTR2[0][5][6]);
            break;
        case 13:
            this.drawWinG(12, 12, 216, 214);
            this.setClip(8, 5, 224, 240);
            if (this.GameSelectType == 1) {
                this.drawStringT(15, this.titleMenuSTR2[0][7][1]);
            } else {
                this.drawStringT(15, this.titleMenuSTR2[0][7][0]);
            }

            this.setColor(16777215);
            switch(this.bt_mode) {
            case 1:
            case 2:
            case 3:
            case 6:
                this.drawStringC(120, 60, this.BTMenuSTR2[0][4][0]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][4][1]);
                this.drawStringC(120, 110, this.BTMenuSTR2[0][1][1]);
                this.drawBar();
                return;
            case 4:
                this.drawStringC(120, 60, this.BTMenuSTR2[0][6][0]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][6][1]);
                return;
            case 5:
                this.drawStringC(120, 60, this.BTMenuSTR2[0][7][0]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][7][1]);
                return;
            case 20:
            default:
                return;
            case 21:
                this.drawStringC(120, 60, "2P側が｢1P側のリクエストを待って");
                this.drawStringC(120, 85, "います｡｣という画面になってから ");
                this.drawStringC(120, 110, "決定キーを押してください。     ");
                this.drawCur(200 - this.fontH / 2, 0);
                this.drawStringC(120, 200, "準備完了");
                return;
            case 80:
                this.drawStringC(120, 60, this.BTMenuSTR2[0][8][0]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][8][1]);
                this.drawStringC(120, 110, this.BTMenuSTR2[0][8][2]);
                return;
            case 255:
                this.BTerrorMsg();
                return;
            }
        case 14:
            this.drawWinG(12, 12, 216, 214);
            this.setClip(8, 5, 224, 240);
            this.drawStringT(15, this.GameName[this.GameSelectType]);
            this.setColor(16777215);
            switch(this.bt_mode) {
            case 0:
            default:
                return;
            case 1:
                this.drawStringC(120, 60, this.BTMenuSTR2[0][9][0]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][9][1]);
                this.drawStringC(120, 110, this.BTMenuSTR2[0][1][1]);
                this.drawBar();
                return;
            case 2:
                this.drawStringC(120, 60, "1P側から" + this.GameName[this.btGameReq]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][0][1]);
                this.drawStringC(120, 110, this.BTMenuSTR2[0][0][2]);
                this.drawCur(140 - this.fontH / 2, this.btCur);
                this.setColor(16777215);
                this.drawStringC(120, 140, this.titleMenuSTR2[0][0][0]);
                this.drawStringC(120, 165, this.titleMenuSTR2[0][0][1]);
                return;
            case 4:
                this.drawStringC(120, 60, this.BTMenuSTR2[0][6][0]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][6][1]);
                return;
            case 8:
                this.drawString(20, 60 + (this.fontH + 4) * 0, "1P側のリクエストを待っています。");
                return;
            case 80:
                this.drawStringC(120, 60, this.BTMenuSTR2[0][10][0]);
                this.drawStringC(120, 85, this.BTMenuSTR2[0][10][1]);
                this.drawStringC(120, 110, this.BTMenuSTR2[0][10][2]);
                return;
            case 255:
                this.BTerrorMsg();
                return;
            }
        case 15:
            this.drawHiScore(-1);
            break;
        case 16:
        case 17:
            this.setColor(0);

            for(var1 = 0; var1 < 240; var1 += 2) {
                this.drawLine(0, var1, 240, var1);
            }

            if (this.GameSelectType == 0) {
                this.drawStringT(20, this.titleMenuSTR2[0][6][0]);
            } else {
                this.drawStringT(20, this.titleMenuSTR2[0][6][1]);
            }

            this.drawCur2(100 - this.fontH / 2, this.curY[this.mode2]);
            this.setColor(16777215);
            String[] var7 = new String[]{"BGM1", "BGM2"};
            this.drawStringC(120, 100, var7[this.SaveData[34 + this.GameSelectType]]);
            this.drawSelT(32, 200, 92);
            this.drawHelp(this.mode2, this.curY[this.mode2], 214);
            break;
        case 18:
        case 19:
            this.drawWinG(10, 12, 220, 216);
            this.setClip(8, 5, 224, 230);
            switch(this.title_helppage) {
            case 0:
                this.drawStringT(20, this.titleMenuSTR2[0][0][4]);
                this.drawCur(60 - this.fontH / 2, this.curY[this.mode2]);
                this.setColor(16777215);

                for(var1 = 0; var1 < this.titleMenuSTR[0][this.mode2].length; ++var1) {
                    this.drawStringC(120, 60 + var1 * 25, this.titleMenuSTR[0][this.mode2][var1]);
                }

                return;
            default:
                this.drawStringT(20, this.titleMenuSTR[0][this.mode2][this.curY[this.mode2]]);
                this.drawStringR(220, 230 - this.fontH, "" + (this.title_helppage2 + 1) + "/" + this.titleGameHELP[0][this.GameSelectType][this.title_helppage - 1].length);

                for(var1 = 0; var1 < this.titleGameHELP[0][this.GameSelectType][this.title_helppage - 1][this.title_helppage2].length; ++var1) {
                    if (this.title_helppage == 3 && (var1 == 0 && this.title_helppage2 != 3 || var1 == 3 && this.title_helppage2 == 4)) {
                        if (this.GameSelectType == 0) {
                            this.setColor(8421631);
                        } else {
                            this.setColor(65280);
                        }
                    }

                    if (this.title_helppage == 2 && var1 == 0 && (this.title_helppage2 == 0 || this.title_helppage2 == 5) && this.GameSelectType == 0) {
                        this.setColor(8421631);
                    }

                    this.drawString(120 - this.font.stringWidth(this.lenlen) / 2, 40 + var1 * 22, this.titleGameHELP[0][this.GameSelectType][this.title_helppage - 1][this.title_helppage2][var1]);
                    this.setColor(16777215);
                }

                if (this.title_helppage2 != 0) {
                    this.drawImage(this.nImg[7 + (this.mode2time / 2 / 4 & 1)], 20 - this.mode2time / 2 % 10, 16);
                }

                if (this.title_helppage2 + 1 != this.titleGameHELP[0][this.GameSelectType][this.title_helppage - 1].length) {
                    this.drawImage(this.nImg[5 + (this.mode2time / 2 / 4 & 1)], 210 + this.mode2time / 2 % 10, 16);
                }

                if (this.GameSelectType == 0) {
                    switch(this.title_helppage) {
                    case 2:
                        switch(this.title_helppage2) {
                        case 0:
                            this.drawImage(this.nImg[27], 112, 180);
                            var1 = this.mode2time % 36;
                            this.setColor(9371648);
                            this.fillRect(114, 218 - var1, 1, var1);
                            this.fillRect(118, 218 - var1, 1, var1);
                            this.setColor(13565952);
                            this.fillRect(115, 218 - var1, 1, var1);
                            this.fillRect(117, 218 - var1, 1, var1);
                            this.setColor(16711680);
                            this.fillRect(116, 218 - var1, 1, var1);
                            return;
                        case 1:
                            this.setClip(112, 160, 16, 16);
                            this.drawImage(this.nImg[29], 112 - (this.mode2time / 2 & 3) * 16, 160);
                            this.setClip(112, 180, 16, 16);
                            this.drawImage(this.nImg[30], 112 - (this.mode2time / 2 & 3) * 16, 180);
                            this.setClip(112, 200, 16, 16);
                            this.drawImage(this.nImg[31], 112 - (this.mode2time / 2 & 3) * 16, 200);
                            return;
                        case 2:
                            this.setClip(112, 80, 16, 16);
                            this.drawImage(this.nImg[29], 112 - (this.mode2time / 2 & 3) * 16, 80);
                            return;
                        case 3:
                            this.setClip(112, 80, 16, 16);
                            this.drawImage(this.nImg[30], 112 - (this.mode2time / 2 & 3) * 16, 80);
                            return;
                        case 4:
                            this.setClip(112, 80, 16, 16);
                            this.drawImage(this.nImg[31], 112 - (this.mode2time / 2 & 3) * 16, 80);
                            break;
                        case 5:
                        default:
                            return;
                        case 6:
                            this.setClip(112, 180, 16, 16);
                            this.drawImage(this.nImg[28], 112 - (this.mode2time / 2 & 3) * 16, 180);
                        }
                    }
                } else {
                    switch(this.title_helppage) {
                    case 2:
                        switch(this.title_helppage2) {
                        case 0:
                            this.setClip(112, 100, 16, 16);
                            this.drawImage(this.nImg[27], 112, 100);
                            return;
                        case 2:
                            this.drawImageC(this.nImg[28], 120, 110);
                        }
                    }
                }

                return;
            }
        case 20:
        case 21:
            this.drawCur(120 - this.fontH / 2, this.exitCur);
            this.setColor(16777215);
            this.drawStringC(120, 60, this.titleMenuSTR2[0][1][0]);
            this.drawStringC(120, 84, this.titleMenuSTR2[0][1][1]);
            this.drawStringC(120, 120, this.titleMenuSTR2[0][0][0]);
            this.drawStringC(120, 145, this.titleMenuSTR2[0][0][1]);
            break;
        case 24:
            this.setColor(0);

            for(var1 = 0; var1 < 240; var1 += 2) {
                this.drawLine(0, var1, 240, var1);
            }

            this.drawStringT(60, this.titleMenuSTR2[0][2][0]);
            this.drawStringT(84, this.titleMenuSTR2[0][2][1]);
        }

    }

    void drawHelp(int var1, int var2, int var3) {
        if (var1 != 0) {
            byte var4 = 24;
            int var5 = var3 - (var4 + 2);
            this.setColor(0);
            this.fillRect(0, var5, 240, var4);
            this.setColor(16777215);
            this.drawLine(0, var5 - 1, 240, var5 - 1);
            this.drawLine(0, var5 + var4 + 1, 240, var5 + var4 + 1);
            this.setColor(8421504);
            this.drawLine(0, var5, 240, var5);
            this.drawLine(0, var5 + var4, 240, var5 + var4);
            if (var1 == this.title_helpID && var2 == this.title_helpCUR) {
                this.title_helpX -= 2;
                if (this.title_helpX < -this.font.stringWidth(this.titleMenuHELP[this.Language][var1][var2])) {
                    this.title_helpX = 240;
                }
            } else {
                this.title_helpID = var1;
                this.title_helpCUR = var2;
                this.title_helpX = 240;
            }

            this.setColor(16777215);
            this.drawString(this.title_helpX, var5 + (var4 - this.fontH) / 2, this.titleMenuHELP[this.Language][var1][var2]);
        }
    }

    void drawStringT(int var1, String var2) {
        this.drawString2C(120, var1, 16777215, 4210752, var2);
    }

    void drawSelT(int var1, int var2, int var3) {
        this.drawImage(this.nImg[7 + (this.mode2time / 2 / 4 & 1)], var1 - this.mode2time / 2 / 4 % 8, var3);
        this.drawImage(this.nImg[5 + (this.mode2time / 2 / 4 & 1)], var2 + this.mode2time / 2 / 4 % 8, var3);
    }

    void drawCur(int var1, int var2) {
        this.setColor(263328);
        this.fillRect(0, var1 + var2 * 25 - 1, 241, this.fontH + 2 + 1);
        this.setColor(16777215);
        this.drawRect(-1, var1 + var2 * 25 - 2, 242, this.fontH + 2 + 2);
    }

    void drawCur2(int var1, int var2) {
        if (this.GameSelectType == 0) {
            this.setColor(4259840);
        } else {
            this.setColor(16751686);
        }

        this.fillRect(0, var1 + var2 * 25 - 1, 241, this.fontH + 2 + 2 + 1);
        this.setColor(16777215);
        this.drawRect(-1, var1 + var2 * 25 - 2, 242, this.fontH + 2 + 2);
    }

    void drawBar() {
        this.setColor(16777215);
        this.drawRect(80, 180, 82, 10);
        boolean var2 = false;

        for(int var1 = 0; var1 < 80; var1 += 4) {
            int var3 = this.mode2time * 4 + var1 * 8 & 511;
            if (var3 >= 256) {
                this.setColor(511 - var3 << 8);
            } else {
                this.setColor(var3 << 8);
            }

            this.fillRect(81 + var1, 181, 5, 9);
        }

    }

    void drawHiScore(int var1) {
        this.drawWinG(13, 16, 214, 194);
        String[] var3 = new String[]{"エンドレスモード ハイスコア", "とことんぷよぷよモード ハイスコア"};
        this.drawStringT(30, var3[this.GameSelectType]);
        this.setColor(16777215);
        if (this.GameSelectType == 1) {
            this.drawStringR(100, 60, "スコア");
            this.drawStringR(155, 60, "消去数");
            this.drawStringR(195, 60, "連鎖数");
        } else {
            this.drawStringR(90, 60, "スコア");
            this.drawStringR(135, 60, "消去数");
            this.drawStringR(180, 60, "連鎖数");
            this.drawStringR(225, 60, "レベル");
        }

        short var9;
        if (this.GameSelectType == 0) {
            var9 = 128;
        } else {
            var9 = 256;
        }

        for(int var2 = 0; var2 < 5; ++var2) {
            if (var1 == var2) {
                this.setColor(16711680);
            } else {
                this.setColor(16777215);
            }

            int var4 = this.SaveData[var9 + var2 * 8] << 24 & -16777216 | this.SaveData[var9 + var2 * 8 + 1] << 16 & 16711680 | this.SaveData[var9 + var2 * 8 + 2] << 8 & '?' | this.SaveData[var9 + var2 * 8 + 3] & 255;
            int var5 = this.SaveData[var9 + var2 * 8 + 4] << 24 & -16777216 | this.SaveData[var9 + var2 * 8 + 5] << 16 & 16711680 | this.SaveData[var9 + var2 * 8 + 6] << 8 & '?' | this.SaveData[var9 + var2 * 8 + 7] & 255;
            int var7 = this.SaveData[var9 + 40 + var2 * 4] << 24 & -16777216 | this.SaveData[var9 + 40 + var2 * 4 + 1] << 16 & 16711680 | this.SaveData[var9 + 40 + var2 * 4 + 2] << 8 & '?' | this.SaveData[var9 + 40 + var2 * 4 + 3] & 255;
            int var6 = this.SaveData[var9 + 40 + 32 + var2 * 2] << 8 & '?' | this.SaveData[var9 + 40 + 32 + var2 * 2 + 1] & 255;
            int var8 = this.SaveData[var9 + 40 + 48 + var2 * 2] << 8 & '?' | this.SaveData[var9 + 40 + 48 + var2 * 2 + 1] & 255;
            this.drawStringR(24, 90 + var2 * 24, "" + (var2 + 1));
            int var12 = 1;
            int var11 = 0;
            int var10;
            if (this.GameSelectType == 1) {
                for(var10 = 0; var10 < 6 && (var10 == 0 || var4 / var12 != 0 || var5 != 0); ++var10) {
                    this.drawStringR(130 - var11 - 30, 90 + var2 * 24, "" + var4 / var12 % 10);
                    var12 *= 10;
                    var11 += this.fontH / 2;
                }

                var12 = 1;

                for(var10 = 0; var10 < 3 && var5 / var12 != 0; ++var10) {
                    this.drawStringR(130 - var11 - 30, 90 + var2 * 24, "" + var5 / var12 % 10);
                    var12 *= 10;
                    var11 += this.fontH / 2;
                }

                this.drawStringR(155, 90 + var2 * 24, "" + var7);
                this.drawStringR(195, 90 + var2 * 24, "" + var6);
            } else {
                for(var10 = 0; var10 < 6 && (var10 == 0 || var4 / var12 != 0 || var5 != 0); ++var10) {
                    this.drawStringR(90 - var11, 90 + var2 * 24, "" + var4 / var12 % 10);
                    var12 *= 10;
                    var11 += this.fontH / 2;
                }

                var12 = 1;

                for(var10 = 0; var10 < 3 && var5 / var12 != 0; ++var10) {
                    this.drawStringR(90 - var11, 90 + var2 * 24, "" + var5 / var12 % 10);
                    var12 *= 10;
                    var11 += this.fontH / 2;
                }

                this.drawStringR(135, 90 + var2 * 24, "" + var7);
                this.drawStringR(180, 90 + var2 * 24, "" + var6);
                this.drawStringR(225, 90 + var2 * 24, "" + var8);
            }
        }

    }

    void BTerrorMsg() {
        if (!this.btRecvExit2T) {
            if (!this.m_pnt.m_bPause && !this.p_chk) {
                this.btRecvExitT = 0;
            } else {
                this.btRecvExitT = 1;
            }

            this.btRecvExit2T = true;
        }

        if (this.btRecvExitT == 0) {
            this.drawString(20, 60 + (this.fontH + 4) * 0, "・電波状態が悪くなった");
            this.drawString(20, 60 + (this.fontH + 4) * 1, "・相手がゲームを終了した");
            this.drawString(20, 60 + (this.fontH + 4) * 2, "・相手に電話がかかってきた");
        } else {
            this.drawString(20, 60 + (this.fontH + 4) * 0, "・携帯電話のバッテリーが残り少ない");
            this.drawString(20, 60 + (this.fontH + 4) * 1, "・ゲームを中断した");
            this.drawString(20, 60 + (this.fontH + 4) * 2, "・電話がかかってきた");
        }

        this.drawString(20, 60 + (this.fontH + 4) * 3, "などの理由によりBluetooth通信が");
        this.drawString(20, 60 + (this.fontH + 4) * 4, "中断されました。");
        this.drawCur(200 - this.fontH / 2, 0);
        this.drawStringC(120, 200, this.titleMenuSTR2[0][0][5]);
    }

    void rand2_init() {
        if (this.GameMapType == 1 || this.GameMapType == 4) {
            this.m_rand = null;
            this.m_rand = new Random((long)this.btRandSeed);
        }

        for(int var1 = 0; var1 < 256; ++var1) {
            this.rand_work[var1] = (char)this.rand(127);
        }

    }

    int rand2(int var1, int var2) {
        int var10002 = this.play_stat[var1][19]++;
        return this.rand_work[this.play_stat[var1][19] % 256] % var2;
    }

    void Init_Game() {
        for(int var1 = 0; var1 < this.play_stat[0].length; ++var1) {
            this.play_stat[0][var1] = 0;
            this.play_stat[1][var1] = 0;
        }

        this.game_round = 0;
        this.mode2 = 2;
        this.mode2req = 2;
        this.game_msg = 0;
        if (this.GameSelectType == 0) {
            switch(this.GamePlayMode) {
            case 0:
                this.GameLvSel = true;
                this.GameMapType = 0;
                this.player_num = 1;
                break;
            case 1:
                this.GameLvSel = false;
                this.GameMapType = 1;
                this.player_num = 2;
                break;
            case 2:
                this.GameLvSel = false;
                this.GameMapType = 2;
                this.player_num = 2;
            }
        } else {
            switch(this.GamePlayMode) {
            case 0:
                this.GameLvSel = true;
                this.player_num = 1;
                this.GameMapType = 3;
                break;
            case 1:
                this.GameLvSel = true;
                this.player_num = 2;
                this.GameMapType = 4;
                break;
            case 2:
                this.GameLvSel = false;
                this.player_num = 2;
                this.GameMapType = 5;
                break;
            case 3:
                this.GameLvSel = true;
                this.player_num = 1;
                this.GameMapType = 6;
                break;
            case 4:
                this.GameLvSel = true;
                this.player_num = 1;
                this.GameMapType = 7;
            }
        }

        if (this.GameMapType != 1 && this.GameMapType != 4) {
            this.btPlayStat = 1;
        } else {
            this.btConnectON(true);
        }

        this.rand2_init();
        this.Read_Game();
        this.btWriteDB = false;
        if (this.GameMapType != 1 && this.GameMapType != 4 && this.btWriteErr) {
            this.btWriteDB = true;
        }

        this.btWriteErr = false;
    }

    void Release_Game() {
        if (this.GameMapType == 1 || this.GameMapType == 4) {
            if (this.GameMapType == 1) {
                this.curY[2] = 1;
                this.curY[1] = 1;
            } else {
                this.curY[5] = 1;
                this.curY[1] = 0;
            }

            this.btConnectON(false);
        }

    }

    void colImageC() {
        System.gc();
        Graphics var1 = this.nImg[0].getGraphics();
        this.pushGraphics(var1, 0, 0);
        Image var2 = this.createImageJPG("bg_cj" + (1 + (this.play_stat[0][14] - this.play_stat[0][100] * 5) / 2) % 5 + "00");
        this.drawImage(var2, 0, 0);
        var2 = null;
        var2 = this.createImage("frmcj100");
        this.drawImage(var2, this.FramePosTbl2[0][this.GameMapType][0] - 2, this.FramePosTbl2[0][this.GameMapType][1] - 2);
        var2 = null;
        var2 = this.createImage("frmcj103");
        this.drawImage(var2, this.FramePosTbl2[0][this.GameMapType][2] - 2, this.FramePosTbl2[0][this.GameMapType][3] - 2 - 32);
        var2 = null;
        var2 = this.createImage("frmcj101");
        this.drawImage(var2, 122, 80);
        var2 = null;
        var2 = this.createImage("frmcj102");
        this.drawImage(var2, 122, 112);
        this.drawImage(var2, 122, 148);
        this.drawImage(var2, 122, 186);
        var2 = null;
        var2 = this.createImage("fntcj100");
        this.drawImage(var2, 125, 115);
        var2 = null;
        var2 = this.createImage("fntcj101");
        this.drawImage(var2, 125, 151);
        var2 = null;
        var2 = this.createImage("fntcj102");
        this.drawImage(var2, 125, 189);
        var2 = null;
        this.popGraphics();
        var1 = null;
        System.gc();
    }

    void Read_Stage() {
        Graphics var1 = this.nImg[0].getGraphics();
        this.pushGraphics(var1, 0, 0);
        Image var2;
        if (this.GameSelectType == 0) {
            this.nImg[12] = this.createImage("fntcj013");
            this.nImg[18] = this.createImage("imgcj000");
            if (this.GameMapType == 2) {
                var2 = this.createImageJPG("bg_cj" + this.GameStageNo / 2 + "00");
            } else {
                var2 = this.createImageJPG("bg_cj000");
            }

            this.drawImage(var2, 0, 0);
            var2 = null;
            var2 = this.createImage("frmcj100");
            this.drawImage(var2, this.FramePosTbl2[0][this.GameMapType][0] - 2, this.FramePosTbl2[0][this.GameMapType][1] - 2);
            if (this.player_num == 2) {
                this.drawImage(var2, this.FramePosTbl2[1][this.GameMapType][0] - 2, this.FramePosTbl2[1][this.GameMapType][1] - 2);
            }

            var2 = null;
            if (this.player_num == 2) {
                var2 = this.createImage("frmcj106");
                this.drawImage(var2, this.FramePosTbl2[0][this.GameMapType][2] - 2, this.FramePosTbl2[0][this.GameMapType][3] - 2 - 32);
                var2 = null;
                var2 = this.createImage("frmcj105");
                this.drawImage(var2, 3, 218);
                var2 = null;
                this.setColor(16777215);
                this.drawStringC(45, 229, "YOU");
                if (this.GameMapType == 1) {
                    this.drawStringC(190, 229, "OPPONENT");
                } else {
                    this.drawStringC(190, 229, "CPU");
                    this.drawStringC(118, 229, "STAGE" + (this.GameStageNo + 1));
                }
            } else {
                var2 = this.createImage("frmcj103");
                this.drawImage(var2, this.FramePosTbl2[0][this.GameMapType][2] - 2, this.FramePosTbl2[0][this.GameMapType][3] - 2 - 32);
                var2 = null;
                var2 = this.createImage("frmcj101");
                this.drawImage(var2, 122, 80);
                var2 = null;
                var2 = this.createImage("frmcj102");
                this.drawImage(var2, 122, 112);
                this.drawImage(var2, 122, 148);
                this.drawImage(var2, 122, 186);
                var2 = null;
                var2 = this.createImage("fntcj100");
                this.drawImage(var2, 125, 115);
                var2 = null;
                var2 = this.createImage("fntcj101");
                this.drawImage(var2, 125, 151);
                var2 = null;
                var2 = this.createImage("fntcj102");
                this.drawImage(var2, 125, 189);
                var2 = null;
            }
        } else {
            this.nImg[12] = this.createImage("fntpj012");
            this.nImg[10] = this.createImage("fntpj202");
            if (this.player_num == 2) {
                if (this.GameMapType == 4) {
                    if (this.btSrvFlg == 1) {
                        this.nImg[4] = this.createImage("chfpja00");
                    } else {
                        this.nImg[4] = this.createImage("chfpjb00");
                    }
                } else {
                    this.nImg[4] = this.createImage("chfpj" + this.FaceNoTbl[this.GameStageNo] + "00");
                }

                if (this.GameMapType == 4) {
                    var2 = this.createImageJPG("bg_pj000");
                } else {
                    var2 = this.createImageJPG("bg_pj" + this.GameStageNo / 2 + "00");
                }

                this.drawImage(var2, 0, 0);
            }

            if (this.player_num == 2) {
                this.setColor(16777215);
                this.drawStringC(43, 231, "あなた");
                if (this.GameMapType == 4) {
                    this.drawStringC(195, 231, "あいて");
                    this.drawStringC(120, 231, "VS");
                } else {
                    this.drawStringC(195, 231, this.puyoChrName[0][this.GameStageNo]);
                    this.drawStringC(120, 231, "STAGE" + (this.GameStageNo + 1));
                }

                byte var3 = 100;
                byte var4 = 62;
                this.setClip(var3, var4, 36, 54);
                this.drawImage(this.nImg[3], var3, var4);
                var3 = 104;
                var4 = 118;
                this.setClip(var3, var4, 36, 54);
                this.drawImage(this.nImg[4], var3, var4);
            }
        }

        var2 = null;
        this.popGraphics();
        var1 = null;
        this.commandSet(1, 6);
    }

    void Read_Game() {
        this.nImg[22] = this.createImage("net0000");
        this.nImg[23] = this.createImage("net0001");
        this.nImg[24] = this.createImage("net0010");
        this.nImg[25] = this.createImage("net0011");
        this.nImg[0] = Image.createImage(240, 240);
        this.nImg[1] = Image.createImage(this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType], this.MapHTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType]);
        if (this.player_num == 2) {
            this.nImg[2] = Image.createImage(this.MapWTBL[this.GameMapType] * this.MapB2TBL[this.GameMapType], this.MapHTBL[this.GameMapType] * this.MapB2TBL[this.GameMapType]);
        }

        if (this.GameSelectType == 0) {
            this.nImg[33] = this.createImage("frmcj999");
            this.nImg[6] = this.createImage("fntcj300");
            this.nImg[7] = this.createImage("fntcj301");
            this.nImg[5] = this.createImage("fntpj010");
            this.nImg[14] = this.createImage("fntcj400");
            this.nImg[15] = this.createImage("fntcj401");
            this.nImg[16] = this.createImage("fntcj402");
            this.nImg[17] = this.createImage("fntcj403");
        } else {
            this.nImg[33] = this.createImage("frmpj999");
            this.nImg[5] = this.createImage("fntpj010");
            this.nImg[14] = this.createImage("fntpj300");
            this.nImg[15] = this.createImage("fntpj301");
            this.nImg[16] = this.createImage("fntpj302");
            this.nImg[17] = this.createImage("fntpj303");
            this.nImg[19] = this.createImage("fntpj500");
            this.nImg[20] = this.createImage("fntpj501");
            if (this.player_num == 2) {
                this.nImg[6] = this.createImage("fntpj400");
                if (this.GameMapType == 4 && this.btSrvFlg == 2) {
                    this.nImg[3] = this.createImage("chfpja00");
                } else {
                    this.nImg[3] = this.createImage("chfpjb00");
                }
            } else {
                this.nImg[3] = this.createImage("chrpjb00");
                this.nImg[6] = this.createImage("fntpj100");
                this.nImg[7] = this.createImage("fntpj101");
                this.nImg[8] = this.createImage("fntpj102");
                this.nImg[9] = this.createImage("fntpj103");
            }
        }

        Graphics var1 = this.nImg[0].getGraphics();
        this.pushGraphics(var1, 0, 0);
        Image var2;
        if (this.GameSelectType != 0 && (this.GameMapType == 3 || this.GameMapType == 6 || this.GameMapType == 7)) {
            if (this.GameMapType == 3) {
                var2 = this.createImageJPG("bg_pjg02");
            } else if (this.GameMapType == 6) {
                var2 = this.createImageJPG("bg_pjg01");
            } else {
                var2 = this.createImageJPG("bg_pjg03");
            }

            this.drawImage(var2, 0, 0);
            var2 = null;
            var2 = this.createImageJPG("bg_pjg00");
            this.drawImage(var2, 120, 0);
            var2 = null;
            var2 = this.createImage("bg_pjg10");
            this.drawImage(var2, 126, 111);
            var2 = null;
            var2 = this.createImage("bg_pjg11");
            this.drawImage(var2, 175, 111);
            var2 = null;
            var2 = this.createImage("bg_pjg12");
            this.drawImage(var2, 126, 150);
            var2 = null;
            var2 = this.createImage("bg_pjg13");
            this.drawImage(var2, 126, 189);
        }

        var2 = null;
        this.popGraphics();
        var1 = null;
        int var3;
        if (this.GameSelectType == 0) {
            for(var3 = 0; var3 < 11; ++var3) {
                if (var3 >= 10) {
                    this.iGem[var3] = this.createImage("jemcj01" + var3 % 10);
                } else {
                    this.iGem[var3] = this.createImage("jemcj00" + var3);
                }
            }

            this.iGem[11] = this.createImage("jemcj011");
            this.iGem[12] = this.createImage("jempj170");
            this.iGem[15] = this.createImage("jempj180");
        } else {
            if (this.GameMapType == 6) {
                for(var3 = 0; var3 < 5; ++var3) {
                    this.iGem[var3] = this.createImage("jempj3" + var3 + "0");
                    this.iGem[var3 + 6] = this.createImage("jempj3" + var3 + "1");
                }
            } else if (this.GameMapType == 7) {
                for(var3 = 0; var3 < 5; ++var3) {
                    this.iGem[var3] = this.createImage("jempj2" + var3 + "0");
                    this.iGem[var3 + 6] = this.createImage("jempj2" + var3 + "1");
                }
            } else {
                for(var3 = 0; var3 < 5; ++var3) {
                    this.iGem[var3] = this.createImage("jempj1" + var3 + "0");
                    this.iGem[var3 + 6] = this.createImage("jempj1" + var3 + "1");
                }

                this.iGem[5] = this.createImage("jempj150");
                this.iGem[11] = this.createImage("jempj150");
                this.iGem[12] = this.createImage("jempj170");
                this.iGem[13] = this.createImage("jempj160");
                this.iGem[15] = this.createImage("jempj180");
            }

            this.iGem[14] = this.createImage("jempj400");
        }

        if (this.GameSelectType == 0) {
            this.SndLoad(1, 5, 18);
            this.SndLoad(1, 6, 19);
            this.SndLoad(1, 7, 6);
            this.SndLoad(1, 8, 7);
            this.SndLoad(1, 9, 8);
            this.SndLoad(1, 10, 9);
            this.SndLoad(1, 11, 10);
            this.SndLoad(1, 12, 11);
            this.SndLoad(1, 13, 12);
            this.SndLoad(1, 17, 63);
            this.SndLoad(1, 18, 64);
            this.SndLoad(1, 3, 16);
            this.SndLoad(1, 4, 17);
        } else {
            this.SndLoad(1, 3, 33);
            this.SndLoad(1, 4, 34);
            this.SndLoad(1, 5, 35);
            this.SndLoad(1, 6, 36);
            if ((this.GameMapType != 4 || this.btSrvFlg == 2) && this.GameMapType != 5) {
                this.SndLoad(1, 7, 23);
                this.SndLoad(1, 8, 24);
                this.SndLoad(1, 9, 25);
                this.SndLoad(1, 10, 26);
                this.SndLoad(1, 11, 27);
                this.SndLoad(1, 12, 28);
                this.SndLoad(1, 13, 29);
            } else {
                this.SndLoad(1, 7, 65);
                this.SndLoad(1, 8, 66);
                this.SndLoad(1, 9, 67);
                this.SndLoad(1, 10, 68);
                this.SndLoad(1, 11, 69);
                this.SndLoad(1, 12, 70);
                this.SndLoad(1, 13, 71);
            }

            this.SndLoad(1, 17, 38);
            this.SndLoad(1, 18, 39);
            this.SndLoad(1, 19, 40);
            this.SndLoad(1, 20, 43);
            this.SndLoad(1, 21, 44);
        }

    }

    void Exec_Game() {
        if (this.mode2 != this.mode2req) {
            this.mode2 = this.mode2req;
            this.mode2time = 0;
            this.mode2init = true;
        } else {
            this.mode2time += 2;
            this.mode2init = false;
            this.Soft1Key();
        }

        boolean var8 = false;
        if ((this.GameMapType == 1 || this.GameMapType == 4) && this.mode2 != 48 && (this.m_pnt.m_bPause || this.p_chk)) {
            this.btStat |= 32;
        }

        if ((this.GameMapType == 1 || this.GameMapType == 4) && this.mode2 != 10 && this.mode2 != 64 && this.mode2 != 80 && ((this.btStat & 32) != 0 || this.btRecvCmd == 4) && !this.btRecvExit2) {
            this.btRecvExit2 = true;
            this.SndStop_ALL();
            this.commandSet(1, 6);
            this.btConnectON(false);
            if (!this.m_pnt.m_bPause && !this.p_chk) {
                this.btRecvExit = 0;
            } else {
                this.btRecvExit = 1;
            }
        }

        if ((this.GameMapType == 1 || this.GameMapType == 4) && this.btRecvExit2) {
            if (this.chkKeyPush(10)) {
                this.setModeReq(16);
            } else {
                this.setColor(0);
                this.fillRect(0, 0, 240, 240);
                this.setColor(16777215);
                if (this.btRecvExit == 0) {
                    this.drawString(20, 60 + (this.fontH + 4) * 0, "・電波状態が悪くなった");
                    this.drawString(20, 60 + (this.fontH + 4) * 1, "・相手がゲームを終了した");
                    this.drawString(20, 60 + (this.fontH + 4) * 2, "・相手に電話がかかってきた");
                } else {
                    this.drawString(20, 60 + (this.fontH + 4) * 0, "・携帯電話のバッテリーが残り少ない");
                    this.drawString(20, 60 + (this.fontH + 4) * 1, "・ゲームを中断した");
                    this.drawString(20, 60 + (this.fontH + 4) * 2, "・電話がかかってきた");
                }

                this.drawString(20, 60 + (this.fontH + 4) * 3, "などの理由によりBluetooth通信が");
                this.drawString(20, 60 + (this.fontH + 4) * 4, "中断されました。");
                this.drawCur(200 - this.fontH / 2, 0);
                this.setColor(16777215);
                this.drawStringC(120, 200, this.titleMenuSTR2[0][0][2]);
            }
        } else {
            int var4;
            int var5;
            if (this.btNetTYPE == 12) {
                var4 = 0;

                for(var5 = 0; var5 < this.MapHTBL[this.GameMapType]; ++var5) {
                    if (this.btGetMap[var5] == 0) {
                        ++var4;
                    }
                }

                if (var4 == 0 && (this.btRecvMapLine == 15 || this.btRecvCmd != 12 && this.btRecvCmd != 0)) {
                    if ((this.play_stat[1][1] & 2) == 0) {
                        this.drawMap1P(1, this.play_stat[1][15], true);
                    }

                    this.btSendMapLine = 0;
                    this.btRecvMapLine = 0;

                    for(var4 = 0; var4 < 16; ++var4) {
                        this.btGetMap[var4] = 0;
                    }

                    this.btSendSet(13);
                }
            } else if (this.btNetTYPE != 13 && this.btRecvCmd == 12) {
                this.btSendMapLine = 0;
                this.btRecvMapLine = 0;

                for(var4 = 0; var4 < 16; ++var4) {
                    this.btGetMap[var4] = 0;
                }

                this.btSendSet(12);
            } else if (this.btNetTYPE == 13 && this.btRecvCmd != 12 && this.btRecvCmd != 0) {
                this.play_stat[0][77] = 0;
                this.btSendSet(3);
            } else if (this.btNetTYPE == 13 && this.btRecvCmd == 12 && this.btRecvMapLine != 15) {
                this.btSendMapLine = 0;
                this.btRecvMapLine = 0;

                for(var4 = 0; var4 < 16; ++var4) {
                    this.btGetMap[var4] = 0;
                }

                this.btSendSet(12);
            }

            int var1;
            int var2;
            int var6;
            int var7;
            int var10;
            int var15;
            int[] var10000;
            int var10002;
            if (this.btNetTYPE != 12 && this.btNetTYPE != 13) {
                boolean var9;
                label2745:
                switch(this.mode2) {
                case 0:
                case 1:
                    System.gc();
                    this.btTimeOut = false;
                    this.btTimeOut2 = false;
                    if (this.GameMapType != 1 && this.GameMapType != 4) {
                        this.rand2_init();
                    }

                    this.Read_Stage();
                    if (this.GameMapType == 1 || this.GameMapType == 4) {
                        this.btCleanMessage();
                    }

                    if (this.mode2 != 1) {
                        for(var4 = 0; var4 < this.play_stat[0].length; ++var4) {
                            this.play_stat[0][var4] = 0;
                            this.play_stat[1][var4] = 0;
                        }
                    } else {
                        var15 = this.play_stat[0][10];
                        var10 = this.play_stat[0][25];

                        for(var4 = 0; var4 < this.play_stat[0].length; ++var4) {
                            this.play_stat[0][var4] = 0;
                            this.play_stat[1][var4] = 0;
                        }

                        this.play_stat[0][10] = var15;
                        this.play_stat[0][25] = var10;
                        this.play_stat[0][12] = this.play_stat[0][10];
                        this.play_stat[0][27] = this.play_stat[0][25];
                    }

                    if (this.GameMapType == 1 || this.GameMapType == 4) {
                        this.play_stat[0][19] = this.game_round * 50;
                        this.play_stat[1][19] = this.game_round * 50;
                        ++this.game_round;
                    }

                    if (this.GameSelectType == 0) {
                        if (this.SaveData[34] == 0) {
                            this.SndLoad(0, 0, 3);
                            this.SndLoad(0, 1, 4);
                            this.SndLoad(0, 2, 5);
                        } else {
                            this.SndLoad(0, 0, 47);
                            this.SndLoad(0, 1, 48);
                            this.SndLoad(0, 2, 49);
                        }
                    } else if (this.SaveData[35] == 0) {
                        this.SndLoad(0, 0, 53);
                        this.SndLoad(0, 1, 54);
                        this.SndLoad(0, 2, 55);
                    } else {
                        this.SndLoad(0, 0, 56);
                        this.SndLoad(0, 1, 57);
                        this.SndLoad(0, 2, 58);
                    }

                    this.BGMPlay3(0, 0, 1, 2, 0);

                    for(var4 = 0; var4 < 384; ++var4) {
                        this.offy_map[0][var4] = 0;
                        this.offy_map[1][var4] = 0;
                    }

                    this.setLevel = 0;
                    if (this.GameLvSel) {
                        this.game_msg = 5;
                        this.mode2req = 8;
                        if (this.GameMapType != 1 && this.GameMapType != 4) {
                            this.subCur = 0;
                            this.commandSet(1, 2);
                        } else {
                            this.subCur = 2;
                            this.btSubCmd = 2;
                        }
                    } else {
                        if (this.GameMapType == 1) {
                            this.play_stat[0][100] = 2;
                            this.play_stat[1][100] = 2;
                        } else if (this.GameMapType != 5 && this.GameMapType != 2) {
                            this.play_stat[0][100] = 2;
                            this.play_stat[1][100] = 2;
                        } else if (this.GameStageNo < 2) {
                            this.play_stat[0][100] = 0;
                            this.play_stat[1][100] = 0;
                        } else if (this.GameStageNo < 4) {
                            this.play_stat[0][100] = 1;
                            this.play_stat[1][100] = 1;
                        } else {
                            this.play_stat[0][100] = 2;
                            this.play_stat[1][100] = 2;
                        }

                        this.mode2req = 16;
                    }

                    this.play_stat[0][15] = this.GameSelectType;
                    this.play_stat[1][15] = this.GameSelectType;
                    this.play_stat[0][24] = 0;
                    this.play_stat[1][24] = 0;
                    this.play_stat[0][76] = 0;
                    this.play_stat[1][76] = 0;
                    this.play_stat[0][77] = 0;
                    this.play_stat[1][77] = 0;
                    if (this.GameMapType == 0) {
                        this.play_stat[0][28] = 100;
                        this.play_stat[1][28] = 100;
                    } else {
                        this.play_stat[0][28] = 500;
                        this.play_stat[1][28] = 500;
                    }

                    this.game_pause = false;
                    this.game_pause2 = false;

                    for(var5 = 0; var5 < 24; ++var5) {
                        for(var4 = 0; var4 < 16; ++var4) {
                            if (var4 != 0 && var4 < this.MapWTBL[this.GameMapType] + 1 && var5 != 23) {
                                this.play_map[0][var4 + var5 * 16] = 0;
                                this.play_map[1][var4 + var5 * 16] = 0;
                            } else {
                                this.play_map[0][var4 + var5 * 16] = 127;
                                this.play_map[1][var4 + var5 * 16] = 127;
                            }
                        }
                    }

                    this.play_stat[0][0] = 0;
                    this.play_stat[1][0] = 0;
                    var4 = 0;

                    while(true) {
                        if (var4 >= 6) {
                            break label2745;
                        }

                        if (this.play_stat[0][15] == 0) {
                            for(var5 = 0; var5 < 3; ++var5) {
                                this.play_stat[0][32 + var5 + var4 * 4] = this.rand2(0, this.colLevelTbl[this.play_stat[0][100]]) + 1;
                            }
                        } else {
                            for(var5 = 0; var5 < 2; ++var5) {
                                if (this.GameMapType == 4) {
                                    this.play_stat[0][32 + var5 + var4 * 4] = this.rand2(0, this.puyoLevelTbl2[this.play_stat[0][100]]) + 1;
                                } else {
                                    this.play_stat[0][32 + var5 + var4 * 4] = this.rand2(0, this.puyoLevelTbl[this.play_stat[0][100]]) + 1;
                                }
                            }
                        }

                        if (this.play_stat[1][15] == 0) {
                            for(var5 = 0; var5 < 3; ++var5) {
                                this.play_stat[1][32 + var5 + var4 * 4] = this.rand2(1, this.colLevelTbl[this.play_stat[0][100]]) + 1;
                            }
                        } else {
                            for(var5 = 0; var5 < 2; ++var5) {
                                if (this.GameMapType == 4) {
                                    this.play_stat[1][32 + var5 + var4 * 4] = this.rand2(1, this.puyoLevelTbl2[this.play_stat[1][100]]) + 1;
                                } else {
                                    this.play_stat[1][32 + var5 + var4 * 4] = this.rand2(1, this.puyoLevelTbl[this.play_stat[1][100]]) + 1;
                                }
                            }
                        }

                        ++var4;
                    }
                case 2:
                    if (this.GameMapType != 1 && this.GameMapType != 4) {
                        this.mode2req = 0;
                    } else if (this.btRecvCmd != 20) {
                        this.mode2req = 0;
                    }
                    break;
                case 7:
                    if (this.btRecvCmd == 11 || (this.btStat & 32) != 0) {
                        this.mode2req = 10;
                        this.game_msg = 11;
                    }

                    if (this.btRecvCmd == 10) {
                        this.mode2req = 0;
                    }
                    break;
                case 8:
                    if (this.mode2init && (this.GameMapType == 1 || this.GameMapType == 4)) {
                        this.btSubCmd = 2;
                        this.btSelChk = true;
                    }

                    if (this.GameMapType != 1 && this.GameMapType != 4) {
                        if (this.chkKeyPush(18)) {
                            this.setModeReq(16);
                        }
                    } else {
                        if (this.btSelChk && this.btRecvCmd != 1 && this.btRecvCmd != 2) {
                            this.btSubCmd = 2;
                            this.btSelChk = false;
                        }

                        this.btSendSet(1);
                    }

                    if (this.chkKeyPush(10)) {
                        this.SndPlay(3, 3);
                        this.mode2req = 16;
                        this.play_stat[0][100] = this.subCur;
                        if (this.GameMapType != 1 && this.GameMapType != 4) {
                            this.commandSet(1, 6);
                            this.play_stat[0][14] = this.subCur * 5;
                        } else {
                            this.play_stat[0][14] = 0;
                        }

                        if (this.GameMapType == 5 || this.GameMapType == 2) {
                            this.play_stat[1][100] = this.play_stat[0][100];
                            this.play_stat[1][14] = this.play_stat[0][14];
                        }

                        if (this.GameMapType == 0) {
                            switch(this.play_stat[0][100]) {
                            case 1:
                                this.play_stat[0][10] = 20000;
                                break;
                            case 2:
                                this.play_stat[0][10] = 50000;
                            }

                            this.play_stat[0][12] = this.play_stat[0][10];
                            this.play_stat[0][27] = this.play_stat[0][25];
                        }
                    } else if (this.chkKeyPush(13)) {
                        this.SndPlay(3, 4);
                        if (this.subCur > 0) {
                            --this.subCur;
                        } else if (this.GameMapType == 4) {
                            this.subCur = 4;
                        } else {
                            this.subCur = 2;
                        }
                    } else if (this.chkKeyPush(16)) {
                        this.SndPlay(3, 4);
                        if (this.GameMapType == 4) {
                            if (this.subCur < 4) {
                                ++this.subCur;
                            } else {
                                this.subCur = 0;
                            }
                        } else if (this.subCur < 2) {
                            ++this.subCur;
                        } else {
                            this.subCur = 0;
                        }
                    }
                    break;
                case 10:
                    if (this.mode2init) {
                        this.btConnectON(false);
                    }

                    this.game_msg = 11;
                    if (this.chkKeyPush(10)) {
                        this.setModeReq(16);
                    }
                    break;
                case 16:
                    this.mode2time = 0;
                    if (this.GameMapType != 1 && this.GameMapType != 4) {
                        this.mode2req = 32;
                        if (this.GameMapType != 2 && this.GameMapType != 5) {
                            this.game_msg = 1;
                        } else {
                            this.game_msg = 6;
                        }
                    } else {
                        this.btSendSet(2);
                        if (this.btRecvChk() == 1 && this.btRecvCmd != 10) {
                            this.play_stat[1][100] = this.btSubCmd;
                            this.play_stat[1][14] = 0;
                            this.mode2req = 32;
                            this.game_msg = 1;
                        }
                    }
                    break;
                case 32:
                    if (this.game_msg == 6) {
                        if (this.mode2time > 120) {
                            this.game_msg = 1;
                            this.mode2time = 0;
                        }
                    } else if (this.mode2time > 180) {
                        this.btSendSet(3);
                        this.game_msg = 0;
                        this.mode2req = 48;
                        this.game_time = 0;
                        this.game_pause = false;
                        this.btFrame = 0;
                        this.commandSet(1, 4);
                    } else if (this.mode2time > 90) {
                        this.game_msg = 2;
                    }
                    break;
                case 48:
                    if (this.m_pnt.m_bPause && !this.game_pause) {
                        this.subCur = 0;
                        this.game_pause = true;
                        this.commandSet(1, 5);
                    }

                    if (this.chkKeyPush(18) || PhoneSystem.getAttribute(2) == 0 && !this.game_pause) {
                        if (this.game_pause) {
                            this.game_pause = false;
                            this.commandSet(1, 4);
                        } else {
                            this.subCur = 0;
                            this.game_pause = true;
                            this.commandSet(1, 5);
                        }
                    }

                    if (this.game_pause) {
                        this.btSendSet(6);
                        if (this.chkKeyPush(13)) {
                            this.SndPlay(3, 4);
                            this.subCur = this.subCur + 1 & 1;
                        } else if (this.chkKeyPush(16)) {
                            this.SndPlay(3, 4);
                            this.subCur = this.subCur + 1 & 1;
                        } else if (this.chkKeyPush(10)) {
                            this.SndPlay(3, 3);
                            if (this.subCur == 0) {
                                this.game_pause = false;
                                this.commandSet(1, 4);
                            } else {
                                this.btSendSet(4);
                                this.setModeReq(16);
                            }
                        }
                        break;
                    } else {
                        this.btSendSet(3);
                        if (this.GameMapType == 1 || this.GameMapType == 4) {
                            this.btRecvChk();
                            if (this.game_pause2 && !this.game_pause) {
                                break;
                            }
                        }

                        this.game_time += 2;
                        if (this.game_time >= 360000) {
                            this.game_time = 359999;
                        }

                        var1 = 0;

                        while(true) {
                            if (var1 >= this.player_num) {
                                break label2745;
                            }

                            if ((this.play_stat[var1][1] & 4) == 0) {
                                if ((this.GameMapType == 1 || this.GameMapType == 4) && var1 == 0) {
                                    if (this.btWriteErr) {
                                        break label2745;
                                    }

                                    if (this.btRecvCmd != 0) {
                                        var10000 = this.play_stat[var1];
                                        var10000[77] += 2;
                                        if (this.play_stat[var1][24] == this.play_stat[var1][76]) {
                                            if (this.play_stat[var1][77] > 60) {
                                                this.play_stat[var1][77] = 0;
                                                this.btSendMapLine = 0;
                                                this.btRecvMapLine = 0;

                                                for(var4 = 0; var4 < 16; ++var4) {
                                                    this.btGetMap[var4] = 0;
                                                }

                                                this.btSendSet(12);
                                                break label2745;
                                            }
                                        } else {
                                            this.play_stat[var1][77] = 0;
                                        }
                                    }

                                    this.play_stat[var1][76] = this.play_stat[var1][24];
                                }

                                var10002 = this.play_stat[var1][24]++;
                            }

                            if (this.GameMapType != 1 && this.GameMapType != 4) {
                                this.play_stat[var1][101] = this.play_stat[var1][24];
                            } else if (var1 == 1) {
                                if (this.btRecvChk() != 1) {
                                    this.now_key[var1] = 0L;
                                    this.push_key[var1] = 0L;
                                }

                                this.setKeyData(1);
                            }

                            byte var17;
                            switch(this.play_stat[var1][0]) {
                            case 0:
                                this.play_stat[var1][91] = this.play_stat[var1][91] + 1 & 1;
                                if (this.GameMapType == 6) {
                                    var17 = 5;
                                } else if (this.GameMapType == 7) {
                                    var17 = 2;
                                } else {
                                    var17 = 3;
                                }

                                if (this.play_map[var1][var17 + this.MapTOPTBL[this.GameMapType] * 16] != 0) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] |= 4;
                                    this.play_stat[var1][0] = 112;
                                    if (var1 == 0) {
                                        this.play_stat[var1][89] = this.play_stat[var1][24];
                                    }
                                    break;
                                }

                                var10000 = this.play_stat[var1];
                                var10000[1] &= -1025;
                                var10000 = this.play_stat[var1];
                                var10000[1] &= -33;
                                this.play_stat[var1][2] = var17 << 4;
                                this.play_stat[var1][3] = this.MapTOPTBL[this.GameMapType] - 1 << 4;
                                var10000 = this.play_stat[var1];
                                var10000[1] &= -3;
                                if (var1 == 0) {
                                    this.drawMap1P(0, this.play_stat[var1][15], true);
                                } else {
                                    this.drawMap1P(1, this.play_stat[var1][15], true);
                                    this.play_stat[var1][112] = 0;
                                }

                                this.play_stat[var1][13] = 0;
                                this.play_stat[var1][0] = 16;
                                this.play_stat[var1][5] = 0;
                                this.play_stat[var1][22] = 0;
                                if (this.GameSelectType == 0) {
                                    if (this.GameMapType == 0 && this.play_stat[var1][14] != this.play_stat[var1][111]) {
                                        this.play_stat[var1][111] = this.play_stat[var1][14];
                                        if ((this.play_stat[var1][14] - this.play_stat[var1][100] * 5 & 1) == 0) {
                                            this.nImg[18] = null;
                                            this.nImg[18] = this.createImage("imgcj00" + (this.play_stat[var1][14] - this.play_stat[var1][100] * 5) / 2 % 5);
                                            System.gc();
                                        } else {
                                            this.colImageC();
                                        }
                                    }

                                    if (this.play_stat[var1][36] >= 7) {
                                        if (this.player_num == 2) {
                                            this.play_stat[var1][28] = 500;
                                        } else {
                                            this.play_stat[var1][28] = 100 + this.play_stat[var1][29] * 50;
                                        }
                                    } else {
                                        if (this.player_num == 1 && this.play_stat[0][100] == 0) {
                                            if (this.play_stat[var1][29] == 0) {
                                                var5 = 0;

                                                for(var4 = 1; var4 < 7; ++var4) {
                                                    if (this.play_map[var1][var4 + (this.MapTOPTBL[this.GameMapType] + 4) * 16] != 0) {
                                                        ++var5;
                                                    }
                                                }

                                                if (var5 >= 2) {
                                                    this.play_stat[var1][28] = 0;
                                                } else {
                                                    this.play_stat[var1][28] = 500;
                                                }
                                            } else {
                                                this.play_stat[var1][28] = 500;
                                            }
                                        }

                                        if (this.play_stat[var1][28] <= 0) {
                                            if (this.player_num == 2) {
                                                this.play_stat[var1][40] = 9;
                                                this.play_stat[var1][41] = 10;
                                                this.play_stat[var1][42] = 8;
                                            } else {
                                                this.play_stat[var1][40] = 7;
                                                this.play_stat[var1][41] = 7;
                                                this.play_stat[var1][42] = 7;
                                            }

                                            var10002 = this.play_stat[var1][29]++;
                                            if (this.play_stat[var1][29] > 999) {
                                                this.play_stat[var1][29] = 999;
                                            }
                                        }
                                    }

                                    for(var4 = 0; var4 < 5; ++var4) {
                                        this.play_stat[var1][32 + var4 * 4] = this.play_stat[var1][32 + (var4 + 1) * 4];
                                        this.play_stat[var1][33 + var4 * 4] = this.play_stat[var1][33 + (var4 + 1) * 4];
                                        this.play_stat[var1][34 + var4 * 4] = this.play_stat[var1][34 + (var4 + 1) * 4];
                                    }

                                    this.play_stat[var1][54] = this.rand2(var1, this.colLevelTbl[this.play_stat[0][100]]) + 1;
                                    this.play_stat[var1][53] = this.rand2(var1, this.colLevelTbl[this.play_stat[0][100]]) + 1;
                                    this.play_stat[var1][52] = this.rand2(var1, this.colLevelTbl[this.play_stat[0][100]]) + 1;
                                    if (this.player_num == 1 && this.play_stat[var1][100] == 0) {
                                        this.com_sub01(this.play_map[var1], this.play_stat[var1]);
                                        this.com_sub00(this.play_map[var1], this.clr_map, this.play_stat[var1]);
                                    }
                                } else {
                                    for(var4 = 0; var4 < 5; ++var4) {
                                        this.play_stat[var1][32 + var4 * 4] = this.play_stat[var1][32 + (var4 + 1) * 4];
                                        this.play_stat[var1][33 + var4 * 4] = this.play_stat[var1][33 + (var4 + 1) * 4];
                                    }

                                    if (this.GameMapType == 4) {
                                        this.play_stat[var1][53] = this.rand2(var1, this.puyoLevelTbl2[this.play_stat[var1][100]]) + 1;
                                        this.play_stat[var1][52] = this.rand2(var1, this.puyoLevelTbl2[this.play_stat[var1][100]]) + 1;
                                    } else {
                                        this.play_stat[var1][53] = this.rand2(var1, this.puyoLevelTbl[this.play_stat[var1][100]]) + 1;
                                        this.play_stat[var1][52] = this.rand2(var1, this.puyoLevelTbl[this.play_stat[var1][100]]) + 1;
                                    }
                                }

                                this.play_stat[var1][7] = 0;
                                this.play_stat[var1][8] = 0;
                                this.play_stat[var1][9] = 0;
                                this.play_stat[var1][31] = 0;
                                if (this.GameMapType == 1) {
                                    if (this.play_stat[0][14] > this.play_stat[1][14]) {
                                        var4 = this.play_stat[0][14];
                                    } else {
                                        var4 = this.play_stat[1][14];
                                    }
                                } else {
                                    var4 = this.play_stat[var1][14];
                                }

                                if (this.GameMapType == 2 || this.GameMapType == 5) {
                                    if (this.GameStageNo >= 5) {
                                        var4 += 10 + (this.GameStageNo - 5);
                                    } else {
                                        var4 = 10;
                                    }
                                }

                                if (this.play_stat[var1][14] >= 30) {
                                    var4 = 30;
                                }

                                if (var4 >= 30) {
                                    var4 = 30;
                                }

                                this.play_stat[var1][6] = this.SpeedTbl[0][var4];
                                this.play_stat[var1][21] = 0;
                                var10000 = this.play_stat[var1];
                                var10000[1] |= 1;
                                break;
                            case 16:
                                var10000 = this.play_stat[var1];
                                var10000[5] += 2;
                                if ((this.GameMapType == 1 || this.GameMapType == 4) && var1 == 1 && this.play_stat[1][104] == 32) {
                                    this.play_stat[var1][5] = 30;
                                }

                                if (this.play_stat[var1][5] >= 30) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] &= -32769;
                                    this.play_stat[var1][0] = 32;
                                    this.play_stat[var1][26] = 0;
                                }
                                break;
                            case 32:
                                if (var1 == 1) {
                                    if (this.GameMapType != 1 && this.GameMapType != 4) {
                                        this.comcom_main();
                                    }

                                    this.setKeyData(1);
                                }

                                var2 = this.play_stat[var1][6];
                                int var3;
                                if (this.play_stat[var1][15] == 0) {
                                    if (this.chkKeyPush(10)) {
                                        if (var1 == 0) {
                                            this.SndPlay(3, 5);
                                        }

                                        if (this.play_stat[var1][15] == 0) {
                                            var3 = this.play_stat[var1][32];
                                            this.play_stat[var1][32] = this.play_stat[var1][33];
                                            this.play_stat[var1][33] = this.play_stat[var1][34];
                                            this.play_stat[var1][34] = var3;
                                        }

                                        if (this.play_stat[var1][7] < 2) {
                                            var10002 = this.play_stat[var1][7]++;
                                        } else {
                                            this.play_stat[var1][7] = 0;
                                        }

                                        this.play_stat[var1][8] = 0;
                                    } else if (this.chkKeyPush(12)) {
                                        if (var1 == 0) {
                                            this.SndPlay(3, 5);
                                        }

                                        if (this.play_stat[var1][15] == 0) {
                                            var3 = this.play_stat[var1][32];
                                            this.play_stat[var1][32] = this.play_stat[var1][34];
                                            this.play_stat[var1][34] = this.play_stat[var1][33];
                                            this.play_stat[var1][33] = var3;
                                        }

                                        if (this.play_stat[var1][7] > 0) {
                                            var10002 = this.play_stat[var1][7]--;
                                        } else {
                                            this.play_stat[var1][7] = 2;
                                        }

                                        this.play_stat[var1][8] = 0;
                                    }

                                    if (this.chkKeyData(14)) {
                                        var8 = false;
                                        if (this.chkKeyPush(14)) {
                                            var8 = true;
                                            this.play_stat[var1][18] = 0;
                                        } else {
                                            var10000 = this.play_stat[var1];
                                            var10000[18] += 2;
                                            if (this.play_stat[var1][18] > 10) {
                                                var8 = true;
                                            }
                                        }

                                        if (var8 && !this.chkMapHit_LR(var1, this.play_stat[var1], -1)) {
                                            var10000 = this.play_stat[var1];
                                            var10000[2] -= 16;
                                        }
                                    } else if (this.chkKeyData(15)) {
                                        var8 = false;
                                        if (this.chkKeyPush(15)) {
                                            var8 = true;
                                            this.play_stat[var1][18] = 0;
                                        } else {
                                            var10000 = this.play_stat[var1];
                                            var10000[18] += 2;
                                            if (this.play_stat[var1][18] > 10) {
                                                var8 = true;
                                            }
                                        }

                                        if (var8 && !this.chkMapHit_LR(var1, this.play_stat[var1], 1)) {
                                            var10000 = this.play_stat[var1];
                                            var10000[2] += 16;
                                        }
                                    }

                                    if (this.chkKeyData(16)) {
                                        var10002 = this.play_stat[var1][10]++;
                                        var2 = 15;
                                    }

                                    var10000 = this.play_stat[var1];
                                    var10000[3] += var2;
                                } else {
                                    if (this.play_stat[var1][8] != 0) {
                                        this.play_stat[var1][8] = 0;
                                    }

                                    var10000 = this.play_stat[var1];
                                    var10000[23] += 2;
                                    if (this.chkKeyPush(10)) {
                                        var2 = this.play_stat[var1][7];
                                        this.play_stat[var1][8] = -1;
                                        if (this.play_stat[var1][7] < 3) {
                                            var10002 = this.play_stat[var1][7]++;
                                        } else {
                                            this.play_stat[var1][7] = 0;
                                        }

                                        if (this.play_stat[var1][7] == 1) {
                                            if (this.chkMapHit_LR(var1, this.play_stat[var1], 1)) {
                                                if (this.chkMapHit_LR(var1, this.play_stat[var1], -1)) {
                                                    this.play_stat[var1][8] = 0;
                                                    this.play_stat[var1][7] = 2;
                                                } else {
                                                    var10000 = this.play_stat[var1];
                                                    var10000[2] -= 16;
                                                }
                                            }
                                        } else if (this.play_stat[var1][7] == 3 && this.chkMapHit_LR(var1, this.play_stat[var1], -1)) {
                                            if (this.chkMapHit_LR(var1, this.play_stat[var1], 1)) {
                                                this.play_stat[var1][8] = 0;
                                                this.play_stat[var1][7] = 0;
                                            } else {
                                                var10000 = this.play_stat[var1];
                                                var10000[2] += 16;
                                            }
                                        }

                                        this.play_stat[var1][23] = 0;
                                        if (var1 == 0 && var2 != this.play_stat[var1][7]) {
                                            this.SndPlay(3, 5);
                                        }
                                    } else if (this.chkKeyPush(12)) {
                                        var2 = this.play_stat[var1][7];
                                        this.play_stat[var1][8] = 1;
                                        if (this.play_stat[var1][7] > 0) {
                                            var10002 = this.play_stat[var1][7]--;
                                        } else {
                                            this.play_stat[var1][7] = 3;
                                        }

                                        if (this.play_stat[var1][7] == 1) {
                                            if (this.chkMapHit_LR(var1, this.play_stat[var1], 1)) {
                                                if (this.chkMapHit_LR(var1, this.play_stat[var1], -1)) {
                                                    this.play_stat[var1][8] = 2;
                                                    this.play_stat[var1][7] = 0;
                                                } else {
                                                    var10000 = this.play_stat[var1];
                                                    var10000[2] -= 16;
                                                }
                                            }
                                        } else if (this.play_stat[var1][7] == 3 && this.chkMapHit_LR(var1, this.play_stat[var1], -1)) {
                                            if (this.chkMapHit_LR(var1, this.play_stat[var1], 1)) {
                                                this.play_stat[var1][8] = 2;
                                                this.play_stat[var1][7] = 2;
                                            } else {
                                                var10000 = this.play_stat[var1];
                                                var10000[2] += 16;
                                            }
                                        }

                                        this.play_stat[var1][23] = 0;
                                        if (var1 == 0 && var2 != this.play_stat[var1][7]) {
                                            this.SndPlay(3, 5);
                                        }
                                    }

                                    if (this.chkKeyData(14)) {
                                        var8 = false;
                                        if (this.chkKeyPush(14)) {
                                            var8 = true;
                                            this.play_stat[var1][18] = 0;
                                        } else {
                                            var10000 = this.play_stat[var1];
                                            var10000[18] += 2;
                                            if (this.play_stat[var1][18] > 10) {
                                                var8 = true;
                                            }
                                        }

                                        if (var8) {
                                            if (this.play_stat[var1][7] == 3) {
                                                if (!this.chkMapHit_LR(var1, this.play_stat[var1], -2)) {
                                                    var10000 = this.play_stat[var1];
                                                    var10000[2] -= 16;
                                                    if (var1 == 0) {
                                                        this.SndPlay(3, 17);
                                                    }
                                                }
                                            } else if (!this.chkMapHit_LR(var1, this.play_stat[var1], -1)) {
                                                var10000 = this.play_stat[var1];
                                                var10000[2] -= 16;
                                                if (var1 == 0) {
                                                    this.SndPlay(3, 17);
                                                }
                                            }
                                        }
                                    } else if (this.chkKeyData(15)) {
                                        var8 = false;
                                        if (this.chkKeyPush(15)) {
                                            var8 = true;
                                            this.play_stat[var1][18] = 0;
                                        } else {
                                            var10000 = this.play_stat[var1];
                                            var10000[18] += 2;
                                            if (this.play_stat[var1][18] > 10) {
                                                var8 = true;
                                            }
                                        }

                                        if (var8) {
                                            if (this.play_stat[var1][7] == 1) {
                                                if (!this.chkMapHit_LR(var1, this.play_stat[var1], 2)) {
                                                    var10000 = this.play_stat[var1];
                                                    var10000[2] += 16;
                                                    if (var1 == 0) {
                                                        this.SndPlay(3, 17);
                                                    }
                                                }
                                            } else if (!this.chkMapHit_LR(var1, this.play_stat[var1], 1)) {
                                                var10000 = this.play_stat[var1];
                                                var10000[2] += 16;
                                                if (var1 == 0) {
                                                    this.SndPlay(3, 17);
                                                }
                                            }
                                        }
                                    }

                                    if (this.chkKeyData(16)) {
                                        var10002 = this.play_stat[var1][10]++;
                                        var2 = 15;
                                    }

                                    var10000 = this.play_stat[var1];
                                    var10000[3] += var2;
                                }

                                if ((this.GameMapType == 1 || this.GameMapType == 4) && var1 == 1) {
                                    if ((this.play_stat[1][92] & 1) == (this.play_stat[1][91] & 1)) {
                                        this.play_stat[1][2] = this.play_stat[1][102];
                                        if (this.GameSelectType == 0) {
                                            var4 = this.play_stat[1][105] - this.play_stat[1][7];
                                            if (var4 < 0) {
                                                var4 += 3;
                                            }

                                            while(var4 > 0) {
                                                var3 = this.play_stat[var1][32];
                                                this.play_stat[var1][32] = this.play_stat[var1][33];
                                                this.play_stat[var1][33] = this.play_stat[var1][34];
                                                this.play_stat[var1][34] = var3;
                                                --var4;
                                            }
                                        }

                                        this.play_stat[1][7] = this.play_stat[1][105];
                                        this.play_stat[1][8] = 0;
                                        if (this.play_stat[1][104] != 32 && this.play_stat[1][104] >= 32) {
                                            if (this.play_stat[0][24] + 1 - this.play_stat[1][101] <= 0) {
                                                this.play_stat[1][3] = this.play_stat[1][103] + 1;
                                                this.play_stat[var1][4] = 0;
                                            } else {
                                                this.play_stat[var1][4] = 30;
                                                this.play_stat[1][3] = this.play_stat[1][103] + 1;
                                            }
                                        } else {
                                            this.play_stat[var1][4] = 0;
                                        }
                                    } else {
                                        this.play_stat[var1][4] = 0;
                                    }
                                }

                                if (this.chkMapHit(var1, this.play_stat[var1])) {
                                    if (this.play_stat[var1][4] == 0 && var1 == 0) {
                                        this.SndPlay(3, 6);
                                    }

                                    this.play_stat[var1][3] = this.play_stat[var1][3] >> 4 << 4;
                                    if (this.play_stat[var1][15] == 1 && this.play_stat[var1][7] == 2 && this.play_map[var1][(this.play_stat[var1][2] >> 4) + ((this.play_stat[var1][3] >> 4) + 1) * 16] != 0) {
                                        var10000 = this.play_stat[var1];
                                        var10000[3] -= 16;
                                    }

                                    if (this.chkKeyData(16)) {
                                        var10000 = this.play_stat[var1];
                                        var10000[4] += 8;
                                    } else {
                                        var10000 = this.play_stat[var1];
                                        var10000[4] += 2;
                                    }

                                    if (this.play_stat[var1][4] < 30 || (this.play_stat[var1][24] & 1) != 0 && var1 != 1) {
                                        break;
                                    }

                                    if (this.GameMapType == 1 || this.GameMapType == 4) {
                                        if (var1 == 0) {
                                            if (this.GameSelectType == 1) {
                                                this.play_stat2[0][0] = this.play_stat[var1][64];
                                            } else {
                                                this.play_stat2[0][0] = this.play_stat[var1][74];
                                            }

                                            if (this.play_stat[0][24] - 1 - this.play_stat[1][101] > 0) {
                                                var10002 = this.play_stat[var1][24]--;
                                                break;
                                            }
                                        } else if (this.GameSelectType == 1) {
                                            this.play_stat2[1][0] = this.play_stat2[0][1];
                                        } else {
                                            this.play_stat2[1][0] = this.play_stat2[0][1];
                                            var10000 = this.play_stat[var1];
                                            var10000[1] &= -65;
                                            this.play_stat[var1][74] = this.play_stat2[1][0];
                                            if (this.play_stat[var1][74] != 0) {
                                                var10000 = this.play_stat[var1];
                                                var10000[1] |= 64;
                                            }
                                        }
                                    }

                                    if (var1 == 0) {
                                        this.play_stat[var1][89] = this.play_stat[var1][24];
                                    }

                                    this.play_stat[var1][5] = 0;
                                    if ((this.GameMapType == 1 || this.GameMapType == 4) && var1 == 1) {
                                        this.play_stat[var1][0] = 69;
                                        this.play_stat[var1][5] = 0;
                                    } else {
                                        this.play_stat[var1][0] = 48;
                                    }

                                    var6 = this.play_stat[var1][2] >> 4;
                                    var7 = (this.play_stat[var1][3] >> 4) * 16;
                                    if (this.play_stat[var1][15] == 0) {
                                        if (this.player_num == 2) {
                                            var10000 = this.play_stat[var1];
                                            var10000[28] -= this.colMagicPowTbl[2];
                                        }

                                        this.play_map[var1][var7 + var6 - 32] = (char)this.play_stat[var1][34];
                                        this.play_map[var1][var7 + var6 - 16] = (char)this.play_stat[var1][33];
                                        this.play_map[var1][var7 + var6] = (char)this.play_stat[var1][32];
                                    } else {
                                        switch(this.play_stat[var1][7]) {
                                        case 0:
                                            this.play_map[var1][var7 + var6] = (char)this.play_stat[var1][32];
                                            this.play_map[var1][var7 + var6 - 16] = (char)this.play_stat[var1][33];
                                            this.offy_map[var1][var6 + var7 - 16] = 8;
                                            break;
                                        case 1:
                                            this.play_map[var1][var7 + var6] = (char)this.play_stat[var1][32];
                                            this.play_map[var1][var7 + var6 + 1] = (char)this.play_stat[var1][33];
                                            this.offy_map[var1][var6 + var7 + 1] = 8;
                                            break;
                                        case 2:
                                            this.play_map[var1][var7 + var6] = (char)this.play_stat[var1][32];
                                            this.play_map[var1][var7 + var6 + 16] = (char)this.play_stat[var1][33];
                                            this.offy_map[var1][var6 + var7 + 16] = 8;
                                            break;
                                        case 3:
                                            this.play_map[var1][var7 + var6] = (char)this.play_stat[var1][32];
                                            this.play_map[var1][var7 + var6 - 1] = (char)this.play_stat[var1][33];
                                            this.offy_map[var1][var6 + var7 - 1] = 8;
                                        }

                                        this.offy_map[var1][var6 + var7] = 8;
                                    }

                                    var10000 = this.play_stat[var1];
                                    var10000[1] &= -2;
                                    var10000 = this.play_stat[var1];
                                    var10000[1] |= 2;
                                } else {
                                    if (this.play_stat[var1][4] > 0) {
                                        var10002 = this.play_stat[var1][31]++;
                                    }

                                    if (this.play_stat[var1][31] < 10) {
                                        this.play_stat[var1][4] = 0;
                                    }
                                }
                                break;
                            case 48:
                                if (this.GameMapType != 1 && this.GameMapType != 4) {
                                    var10002 = this.play_stat[var1][24]--;
                                    this.play_stat[var1][5] = 0;
                                    this.play_stat[var1][0] = 106;
                                } else if (var1 == 0) {
                                    if (this.play_stat[1][90] - this.play_stat[0][89] > this.play_stat[1][101] - this.play_stat[0][24]) {
                                        var10002 = this.play_stat[var1][24]--;
                                    } else if (this.play_stat[0][24] - this.play_stat[1][101] <= 0) {
                                        this.play_stat[var1][0] = 106;
                                        this.play_stat[var1][5] = 0;
                                    } else {
                                        var10002 = this.play_stat[var1][24]--;
                                    }
                                } else {
                                    this.play_stat[var1][0] = 106;
                                    this.play_stat[var1][5] = 0;
                                }
                                break;
                            case 64:
                                if (this.play_stat[var1][16] == 0) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] |= 2;
                                    if (var1 == 0) {
                                        if ((this.play_stat[var1][1] & 16384) != 0) {
                                            this.SndPlay(3, 18);
                                        } else {
                                            var5 = this.play_stat[var1][13] - 1;
                                            if (var5 > 6) {
                                                var5 = 6;
                                            }

                                            this.SndPlay(3, 7 + var5);
                                        }
                                    }
                                }

                                var10000 = this.play_stat[var1];
                                var10000[16] += 2;
                                if (this.play_stat[var1][16] >= 32) {
                                    this.play_stat[var1][0] = 106;
                                }
                                break;
                            case 66:
                                var9 = true;
                                if (this.GameSelectType == 0) {
                                    for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                                        for(var5 = 352; var5 > 0; var5 -= 16) {
                                            if (this.offy_map[var1][var4 + var5] != 0) {
                                                var9 = false;
                                                if (this.offy_map[var1][var4 + var5] > 0) {
                                                    var10000 = this.offy_map[var1];
                                                    var10000[var4 + var5] -= this.play_stat[var1][17];
                                                    if (this.offy_map[var1][var4 + var5] < 0) {
                                                        this.offy_map[var1][var4 + var5] = 0;
                                                    }
                                                } else {
                                                    var10000 = this.offy_map[var1];
                                                    var10000[var4 + var5] += this.play_stat[var1][17];
                                                    if (this.offy_map[var1][var4 + var5] > 0) {
                                                        this.offy_map[var1][var4 + var5] = 0;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                } else {
                                    for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                                        for(var5 = 352; var5 > 0; var5 -= 16) {
                                            if (this.offy_map[var1][var4 + var5] != 0) {
                                                var9 = false;
                                                if (this.offy_map[var1][var4 + var5] > 0) {
                                                    var10002 = this.offy_map[var1][var4 + var5]--;
                                                    if (this.offy_map[var1][var4 + var5] < 0) {
                                                        this.offy_map[var1][var4 + var5] = 0;
                                                    }
                                                } else {
                                                    var10000 = this.offy_map[var1];
                                                    var10000[var4 + var5] += this.play_stat[var1][17];
                                                    if (this.offy_map[var1][var4 + var5] > 0) {
                                                        this.offy_map[var1][var4 + var5] = 7;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }

                                var10002 = this.play_stat[var1][17]++;
                                if (this.play_stat[var1][17] > 15) {
                                    this.play_stat[var1][17] = 15;
                                }

                                if (var9) {
                                    if ((this.play_stat[var1][1] & '耀') != 0) {
                                        this.play_stat[var1][5] = 0;
                                        this.play_stat[var1][0] = 104;
                                        if (var1 == 0) {
                                            this.SndPlay(3, 21);
                                        }
                                    } else {
                                        this.play_stat[var1][0] = 96;
                                    }
                                }
                                break;
                            case 69:
                                if (this.play_stat[0][24] - 1 - this.play_stat[1][101] >= 0) {
                                    this.play_stat[var1][0] = 106;
                                }
                                break;
                            case 70:
                                var10002 = this.play_stat[var1][24]--;
                                if (this.GameMapType == 6) {
                                    var17 = 5;
                                } else if (this.GameMapType == 7) {
                                    var17 = 2;
                                } else {
                                    var17 = 3;
                                }

                                if (this.play_map[var1][var17 + this.MapTOPTBL[this.GameMapType] * 16] != 0) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] |= 4;
                                    this.play_stat[var1][0] = 112;
                                    if (var1 == 0) {
                                        this.play_stat[var1][89] = this.play_stat[var1][24] + 1;
                                        var10002 = this.play_stat[var1][24]++;
                                    }
                                } else if ((this.play_stat[0][92] & 1) != (this.play_stat[0][91] & 1)) {
                                    this.play_stat[var1][0] = 0;
                                }
                                break;
                            case 80:
                                var2 = 0;
                                var4 = this.play_stat[var1][67] + 1;
                                if (this.GameMapType != 1 && this.GameMapType != 4) {
                                    var15 = 0;
                                    if (var4 > 0 && var1 == 0) {
                                        this.SndPlay(3, 18);
                                    }

                                    for(var5 = this.MapTOPTBL[this.GameMapType] * 16; var5 > 0; var5 -= 16) {
                                        while(var4 < this.MapWTBL[this.GameMapType] + 1 && var15 < 36) {
                                            if (this.play_map[var1][var4 + var5] == 0) {
                                                if (this.play_stat[var1][64] <= 0) {
                                                    this.play_stat[var1][64] = 0;
                                                    break;
                                                }

                                                this.play_map[var1][var4 + var5] = 6;
                                            }

                                            var10002 = this.play_stat[var1][64]--;
                                            ++var15;
                                            ++var4;
                                        }

                                        if (var4 != this.MapWTBL[this.GameMapType] + 1) {
                                            break;
                                        }

                                        var4 = 1;
                                        ++var2;
                                    }
                                } else {
                                    var15 = 0;
                                    if (var4 > 0 && var1 == 0) {
                                        this.SndPlay(3, 18);
                                    }

                                    for(var5 = this.MapTOPTBL[this.GameMapType] * 16; var5 > 0; var5 -= 16) {
                                        while(var4 < this.MapWTBL[this.GameMapType] + 1 && var15 < 36) {
                                            if (this.play_map[var1][var4 + var5] == 0) {
                                                if (this.play_stat2[var1][0] <= 0) {
                                                    this.play_stat2[var1][0] = 0;
                                                    break;
                                                }

                                                this.play_map[var1][var4 + var5] = 6;
                                            }

                                            var10002 = this.play_stat[var1][64]--;
                                            var10002 = this.play_stat2[var1][0]--;
                                            ++var15;
                                            ++var4;
                                        }

                                        if (var4 != this.MapWTBL[this.GameMapType] + 1) {
                                            break;
                                        }

                                        var4 = 1;
                                        ++var2;
                                    }
                                }

                                this.play_stat[var1][67] = var4 - 1;
                                this.play_stat[var1][17] = 0;
                                this.play_stat[var1][0] = 106;
                                break;
                            case 86:
                                var10000 = this.play_stat[var1];
                                var10000[1] &= -65;
                                this.play_stat[var1][17] = 0;
                                this.play_stat[var1][0] = 66;

                                for(var2 = 0; var2 < this.play_stat[var1][74]; ++var2) {
                                    for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                                        for(var5 = 16; var5 < 368; var5 += 16) {
                                            if (this.play_map[var1][var4 + var5] != 0) {
                                                this.play_map[var1][var4 + var5 - 16] = this.play_map[var1][var4 + var5];
                                                this.offy_map[var1][var4 + var5 - 16] = 16 * (var2 + 1);
                                            }
                                        }

                                        this.play_map[var1][var4 + var5 - 16] = 11;
                                        this.offy_map[var1][var4 + var5 - 16] = 16 * (var2 + 1);
                                    }
                                }

                                this.play_stat[var1][74] = 0;
                                break;
                            case 96:
                                var10000 = this.play_stat[var1];
                                var10000[1] &= -3;
                                this.drawMap1P(var1, this.play_stat[var1][15], true);
                                if (this.chkMapClr(var1, this.play_stat[var1], this.play_map[var1], this.clr_map2[var1], this.link_map[var1])) {
                                    if (var1 == 0) {
                                        this.setVib(2);
                                    }

                                    if ((this.play_stat[var1][1] & 256) != 0) {
                                        this.play_stat[var1][0] = 122;
                                        var10000 = this.play_stat[var1];
                                        var10000[1] |= 65536;
                                        this.play_stat[var1][72] = 0;
                                    } else {
                                        this.play_stat[var1][0] = 64;
                                        if (this.play_stat[var1][65] != 0 || this.GameSelectType == 0) {
                                            var10000 = this.play_stat[var1];
                                            var10000[1] |= 512;
                                        }

                                        this.play_stat[var1][106] = 0;
                                        if (this.play_stat[var1][64] - (this.play_stat[var1][65] - this.play_stat[var1][75]) > 0) {
                                            if (this.play_stat[var1][64] - this.play_stat[var1][65] < 0) {
                                                this.play_stat[var1][66] = 0;
                                            } else {
                                                this.play_stat[var1][66] = 1;
                                            }
                                        } else {
                                            this.play_stat[var1][66] = 2;
                                        }
                                    }

                                    this.play_stat[var1][16] = 0;
                                } else {
                                    if (this.play_stat[var1][65] != 0) {
                                        if (this.play_stat2[var1][0] != 0) {
                                            var10000 = this.play_stat2[var1];
                                            var10000[0] -= this.play_stat[var1][65];
                                            if (this.play_stat2[var1][0] < 0) {
                                                this.play_stat2[var1][0] = 0;
                                            }
                                        }

                                        if (this.play_stat[var1][64] != 0) {
                                            var10000 = this.play_stat[var1];
                                            var10000[64] -= this.play_stat[var1][65];
                                            if (this.play_stat[var1][64] < 0) {
                                                this.play_stat[var1][65] = 0 - this.play_stat[var1][64];
                                                this.play_stat[var1][64] = 0;
                                            } else {
                                                this.play_stat[var1][65] = 0;
                                            }
                                        }

                                        this.play_stat[var1][75] = 0;
                                    }

                                    var10000 = this.play_stat[var1];
                                    var10000[1] |= 2;
                                    if (this.GameMapType != 1 && this.GameMapType != 4) {
                                        if ((this.play_stat[var1][1] & 32) == 0 && this.play_stat[var1][64] + this.play_stat[var1][64] > 0) {
                                            var10000 = this.play_stat[var1];
                                            var10000[1] |= 32;
                                            this.play_stat[var1][0] = 80;
                                        } else if ((this.play_stat[var1][1] & 64) != 0) {
                                            this.play_stat[var1][0] = 86;
                                            if (var1 == 0) {
                                                this.SndPlay(3, 17);
                                            }
                                        } else {
                                            this.play_stat[var1][0] = 101;
                                        }
                                    } else if (this.GameSelectType == 1 && (this.play_stat[var1][1] & 32) == 0 && this.play_stat2[var1][0] > 0) {
                                        var10000 = this.play_stat[var1];
                                        var10000[1] |= 32;
                                        this.play_stat[var1][0] = 80;
                                    } else {
                                        if (this.GameSelectType == 0 && (this.play_stat[var1][1] & 64) != 0 && this.play_stat2[var1][0] != 0) {
                                            this.play_stat[var1][0] = 86;
                                            if (var1 == 0) {
                                                this.SndPlay(3, 17);
                                            }
                                            break;
                                        }

                                        this.play_stat[var1][0] = 101;
                                    }
                                }
                                break;
                            case 101:
                                if (this.play_stat[var1][65] != 0) {
                                    if (this.play_stat[var1][64] != 0) {
                                        var10000 = this.play_stat[var1];
                                        var10000[64] -= this.play_stat[var1][65];
                                        if (this.play_stat[var1][64] < 0) {
                                            var10000 = this.play_stat[var1 + 1 & 1];
                                            var10000[64] += 0 - this.play_stat[var1][64];
                                            this.play_stat[var1][64] = 0;
                                        }

                                        this.play_stat[var1][65] = 0;
                                    } else {
                                        var10000 = this.play_stat[var1 + 1 & 1];
                                        var10000[64] += this.play_stat[var1][65];
                                        this.play_stat[var1][65] = 0;
                                    }

                                    this.play_stat[var1][75] = 0;
                                }

                                if ((this.play_stat[var1][1] & 128) != 0) {
                                    var10000 = this.play_stat[var1 + 1 & 1];
                                    var10000[1] |= 64;
                                    var10000 = this.play_stat[var1];
                                    var10000[1] &= -129;
                                    this.play_stat[var1 + 1 & 1][74] = this.play_stat[var1][73];
                                }

                                if ((this.GameMapType == 1 || this.GameMapType == 4) && var1 == 0) {
                                    this.play_stat[var1][0] = 70;
                                    this.play_stat[var1][5] = 0;
                                    break;
                                }

                                this.play_stat[var1][0] = 0;
                                break;
                            case 104:
                                var10000 = this.play_stat[var1];
                                var10000[5] += 2;
                                if (this.play_stat[var1][5] > 60) {
                                    this.play_stat[var1][0] = 96;
                                }
                                break;
                            case 106:
                                for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                                    for(var5 = 352; var5 > 0; var5 -= 16) {
                                        if (this.play_map[var1][var4 + var5 + 16] == 0 && this.play_map[var1][var4 + var5] != 0) {
                                            this.link_map[var1][var4 + var5] = 0;
                                            char[] var26 = this.link_map[var1];
                                            var26[var4 + var5 - 1] = (char)(var26[var4 + var5 - 1] & -2);
                                            var26 = this.link_map[var1];
                                            var26[var4 + var5 + 1] = (char)(var26[var4 + var5 + 1] & -5);

                                            for(var2 = var5 + 16; var2 < 384; var2 += 16) {
                                                if (this.play_map[var1][var4 + var2 + 16] != 0) {
                                                    this.offy_map[var1][var4 + var2] = -((var2 - var5) * 1);
                                                    this.offy_map[var1][var4 + var5] = 0;
                                                    this.play_map[var1][var4 + var2] = this.play_map[var1][var4 + var5];
                                                    this.play_map[var1][var4 + var5] = 0;
                                                    this.link_map[var1][var4 + var2] = this.link_map[var1][var4 + var5];
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }

                                if (this.GameSelectType == 1) {
                                    for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1 && this.play_map[var1][var4 + 352] == 0; ++var4) {
                                    }

                                    if (var4 == this.MapWTBL[this.GameMapType] + 1 && (this.play_stat[var1][1] & '耀') == 0) {
                                        var10000 = this.play_stat[var1];
                                        var10000[1] |= 32768;
                                        var10000 = this.play_stat[var1];
                                        var10000[26] += 10000;
                                        var10000 = this.play_stat[var1];
                                        var10000[10] += 10000;
                                    }
                                }

                                this.play_stat[var1][0] = 66;
                                this.play_stat[var1][17] = 0;
                                break;
                            case 112:
                                if (this.GameMapType != 1 && this.GameMapType != 4) {
                                    this.mode2req = 85;
                                } else if (var1 == 0) {
                                    if (this.play_stat[0][89] - this.play_stat[1][101] <= 0) {
                                        this.mode2req = 85;
                                        var10000 = this.play_stat[0];
                                        var10000[1] |= 4;
                                        if ((this.play_stat[1][88] & 4) != 0) {
                                            var10000 = this.play_stat[1];
                                            var10000[1] |= 4;
                                        }
                                    }
                                } else if ((this.play_stat[1][88] & 4) != 0 && this.play_stat[0][24] - this.play_stat[1][90] >= 0) {
                                    this.mode2req = 85;
                                    var10000 = this.play_stat[1];
                                    var10000[1] |= 4;
                                }
                                break;
                            case 122:
                                if (this.play_stat[var1][72] > 60) {
                                    this.play_stat[var1][0] = 64;
                                    if (this.play_stat[var1][32] == 10 && (this.play_stat[var1][65] != 0 || this.GameSelectType == 0)) {
                                        var10000 = this.play_stat[var1];
                                        var10000[1] |= 512;
                                    }

                                    this.play_stat[var1][106] = 0;
                                    if (this.play_stat[var1][64] - (this.play_stat[var1][65] - this.play_stat[var1][75]) > 0) {
                                        if (this.play_stat[var1][64] - this.play_stat[var1][65] < 0) {
                                            this.play_stat[var1][66] = 0;
                                        } else {
                                            this.play_stat[var1][66] = 1;
                                        }
                                    } else {
                                        this.play_stat[var1][66] = 2;
                                    }
                                }
                            }

                            ++var1;
                        }
                    }
                case 64:
                case 80:
                    if (this.mode2init) {
                        this.rank_in = -1;
                        if (this.GameMapType == 0) {
                            this.rank_in = this.setHiScore(0);
                        } else if (this.GameMapType == 3 || this.GameMapType == 6 || this.GameMapType == 7) {
                            this.rank_in = this.setHiScore(2);
                        }

                        if (this.rank_in != -1) {
                            this.game_msg = 12;
                        }

                        this.play_stat[0][99] = 0;
                        this.play_stat[1][99] = 0;
                        this.nImg[10] = null;
                        this.nImg[11] = null;
                        this.nImg[12] = null;
                        this.nImg[13] = null;
                        if (this.GameSelectType == 1) {
                            if (this.player_num == 2) {
                                if ((this.play_stat[0][1] & 4) != 0) {
                                    this.nImg[10] = this.createImage("fntpj200");
                                    this.nImg[11] = this.createImage("fntpj201");
                                    this.nImg[12] = this.createImage("fntpj011");
                                    this.nImg[13] = this.createImage("fntpj013");
                                } else {
                                    this.nImg[10] = this.createImage("fntpj201");
                                    this.nImg[11] = this.createImage("fntpj200");
                                    this.nImg[12] = this.createImage("fntpj011");
                                    this.nImg[13] = this.createImage("fntpj013");
                                }
                            } else {
                                this.nImg[10] = this.createImage("fntpj200");
                                this.nImg[12] = this.createImage("fntpj011");
                                this.nImg[13] = this.createImage("fntpj013");
                            }
                        } else if (this.player_num == 2) {
                            if ((this.play_stat[0][1] & 4) != 0) {
                                this.nImg[10] = this.createImage("fntcj220");
                                this.nImg[11] = this.createImage("fntcj210");
                                this.nImg[12] = this.createImage("fntcj200");
                                this.nImg[13] = this.createImage("fntcj011");
                            } else {
                                this.nImg[10] = this.createImage("fntcj210");
                                this.nImg[11] = this.createImage("fntcj220");
                                this.nImg[12] = this.createImage("fntcj200");
                                this.nImg[13] = this.createImage("fntcj011");
                            }
                        } else {
                            this.nImg[12] = this.createImage("fntcj200");
                            this.nImg[13] = this.createImage("fntcj011");
                        }

                        if (this.game_msg != 12) {
                            if (this.mode2 == 64) {
                                this.game_msg = 3;
                            } else {
                                this.game_msg = 8;
                            }

                            this.subCur = 0;
                            if (this.GameSelectType == 0) {
                                if ((this.play_stat[0][1] & 4) == 0) {
                                    this.SndLoad(0, 0, 50);
                                    this.SndLoad(0, 1, 51);
                                    this.SndLoad(0, 2, 52);
                                    this.BGMPlay3(0, 0, 1, 2, 1);
                                } else {
                                    this.SndStop_ALL();
                                }
                            } else if ((this.play_stat[0][1] & 4) == 0) {
                                this.SndLoad(0, 0, 41);
                                this.SndLoad(0, 1, 42);
                                this.BGMPlay3(0, 0, 1, -1, 1);
                                if (this.GameMapType != 4 || this.btSrvFlg != 2) {
                                    this.SndLoad(1, 2, 72);
                                    this.SndPlay(3, 2);
                                }
                            } else {
                                this.SndStop_ALL();
                                if (this.GameMapType == 4 && this.btSrvFlg == 2) {
                                    this.SndLoad(1, 0, 73);
                                } else {
                                    this.SndLoad(1, 0, 60);
                                }

                                this.SndPlay(3, 0);
                            }
                        }
                    }

                    if (this.game_msg == 12) {
                        if (this.chkKeyPush(10)) {
                            if (this.mode2 == 64) {
                                this.game_msg = 3;
                            } else {
                                this.game_msg = 8;
                            }

                            this.subCur = 0;
                            if (this.GameSelectType == 0) {
                                if ((this.play_stat[0][1] & 4) == 0) {
                                    this.SndLoad(0, 0, 50);
                                    this.SndLoad(0, 1, 51);
                                    this.SndLoad(0, 2, 52);
                                    this.BGMPlay3(0, 0, 1, 2, 1);
                                }
                            } else if ((this.play_stat[0][1] & 4) == 0) {
                                this.SndLoad(0, 0, 41);
                                this.SndLoad(0, 1, 42);
                                this.BGMPlay3(0, 0, 1, -1, 1);
                                if (this.GameMapType != 4 || this.btSrvFlg != 2) {
                                    this.SndLoad(1, 2, 72);
                                    this.SndPlay(3, 2);
                                }
                            } else {
                                if (this.GameMapType == 4 && this.btSrvFlg == 2) {
                                    this.SndLoad(1, 0, 73);
                                } else {
                                    this.SndLoad(1, 0, 60);
                                }

                                this.BGMPlay3(0, 0, -1, -1, 1);
                            }
                        }
                    } else if (this.mode2 == 64) {
                        if (this.game_msg == 3) {
                            if (this.mode2time > 120) {
                                this.game_msg = 9;
                                if ((this.GameMapType == 1 || this.GameMapType == 4) && (this.btRecvCmd == 11 || (this.btStat & 32) != 0)) {
                                    this.game_msg = 11;
                                    this.mode2req = 10;
                                }
                            }
                        } else if (this.game_msg == 9) {
                            if ((this.GameMapType == 1 || this.GameMapType == 4) && (this.btRecvCmd == 11 || (this.btStat & 32) != 0)) {
                                this.game_msg = 11;
                                this.mode2req = 10;
                            } else if (this.chkKeyPush(10)) {
                                this.SndPlay(3, 3);
                                this.btSendSet(10 + this.subCur);
                                this.game_msg = 0;
                                switch(this.subCur) {
                                case 0:
                                    if (this.GameMapType != 1 && this.GameMapType != 4) {
                                        this.mode2req = 0;
                                    } else {
                                        this.mode2req = 7;
                                    }
                                    break label2745;
                                case 1:
                                    this.game_msg = 11;
                                    this.mode2req = 10;
                                }
                            } else if (this.chkKeyPush(13)) {
                                this.SndPlay(3, 4);
                                if (this.subCur > 0) {
                                    --this.subCur;
                                } else {
                                    this.subCur = 1;
                                }
                            } else if (this.chkKeyPush(16)) {
                                this.SndPlay(3, 4);
                                if (this.subCur < 1) {
                                    ++this.subCur;
                                } else {
                                    this.subCur = 0;
                                }
                            }
                        } else if (this.chkKeyPush(10)) {
                            this.setModeReq(16);
                        }
                    } else if (this.game_msg == 8 && this.mode2time > 60 && this.chkKeyPush(10)) {
                        ++this.GameStageNo;
                        if (this.GameSelectType == 0) {
                            if (this.GameStageNo >= 10) {
                                this.SaveData[32] = 9;
                                this.mode2req = 96;
                            } else {
                                this.SaveData[32] = (byte)this.GameStageNo;
                                this.mode2req = 1;
                            }
                        } else if (this.GameStageNo >= 10) {
                            this.SaveData[33] = 9;
                            this.mode2req = 96;
                        } else {
                            this.SaveData[33] = (byte)this.GameStageNo;
                            this.mode2req = 1;
                        }

                        this.writeRS(0, this.SaveData);
                    }
                    break;
                case 85:
                    if (this.mode2init) {
                        this.commandSet(1, 6);
                        var10000 = this.play_stat[0];
                        var10000[1] &= -32769;
                        var10000 = this.play_stat[1];
                        var10000[1] &= -32769;
                        if (this.player_num == 2) {
                            if (this.GameMapType != 1 && this.GameMapType != 4) {
                                if ((this.play_stat[0][1] & 4) != 0 && (this.play_stat[1][1] & 4) != 0) {
                                    var10000 = this.play_stat[1];
                                    var10000[1] &= -5;
                                }
                            } else {
                                if ((this.play_stat[1][88] & 4) == 0) {
                                    var10000 = this.play_stat[1];
                                    var10000[1] &= -5;
                                } else {
                                    var10000 = this.play_stat[1];
                                    var10000[1] |= 4;
                                }

                                if ((this.play_stat[0][1] & 4) != 0 && (this.play_stat[1][1] & 4) != 0) {
                                    if (this.btSrvFlg == 1) {
                                        var10000 = this.play_stat[0];
                                        var10000[1] &= -5;
                                    } else {
                                        var10000 = this.play_stat[1];
                                        var10000[1] &= -5;
                                    }
                                }
                            }
                        }

                        this.SndStop_ALL();
                        if (this.GameSelectType == 0 && (this.play_stat[0][1] & 4) != 0) {
                            this.SndLoad(1, 0, 59);
                            this.SndPlay(3, 0);
                        }
                    }

                    var9 = false;
                    if (this.GameSelectType == 0) {
                        for(var1 = 0; var1 < this.player_num; ++var1) {
                            if ((this.play_stat[var1][1] & 4) != 0 && (this.play_stat[var1][16] == 0 || this.play_stat[var1][16] >= 32)) {
                                if (this.play_stat[var1][99] > this.MapHTBL[this.GameMapType]) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] &= -3;
                                    var9 = true;
                                } else {
                                    this.play_stat[var1][16] = 0;
                                    var10000 = this.play_stat[var1];
                                    var10000[1] |= 2;
                                    this.play_stat[var1][0] = 64;
                                    this.play_stat[var1][22] = 0;
                                    var5 = (23 - this.play_stat[var1][99]) * 16;
                                    var10002 = this.play_stat[var1][99]++;

                                    for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                                        if (this.GameMapType == 0) {
                                            if (this.play_map[var1][var4 + var5] >= 1 && this.play_map[var1][var4 + var5] <= 16) {
                                                this.clr_map2[var1][this.play_stat[var1][22] * 2] = this.play_map[var1][var4 + var5];
                                                this.clr_map2[var1][this.play_stat[var1][22] * 2 + 1] = (char)(var4 + var5 - this.MapTOPTBL[this.GameMapType] * 16);
                                                this.play_map[var1][var4 + var5] = 0;
                                                var10002 = this.play_stat[var1][22]++;
                                            }
                                        } else {
                                            this.play_map[var1][var4 + var5] = 11;
                                        }
                                    }

                                    this.drawMap1P(var1, this.play_stat[var1][15], true);
                                }
                            }

                            var10000 = this.play_stat[var1];
                            var10000[16] += 8;
                        }
                    }

                    if (this.GameSelectType == 1 || var9) {
                        if (this.GameMapType != 2 && this.GameMapType != 5) {
                            if (this.player_num == 2) {
                                this.mode2req = 64;
                            } else {
                                this.mode2req = 64;
                            }
                        } else if ((this.play_stat[0][1] & 4) == 0) {
                            this.mode2req = 80;
                        } else {
                            this.mode2req = 64;
                        }
                    }
                    break;
                case 96:
                    if (this.mode2init) {
                        this.SndLoad(0, 0, 0);
                        this.SndLoad(0, 1, 1);
                        this.BGMPlay3(0, 0, 1, -1, 0);
                        if (this.GameSelectType == 1) {
                            this.nImg[0] = this.createImageJPG("ed_10");
                        } else {
                            this.nImg[0] = this.createImageJPG("ed_11");
                        }

                        this.subCur = 2;
                        this.writeRS(0, this.SaveData);
                    }

                    if (this.mode2time > 60 && this.chkKeyPush(10)) {
                        if (this.subCur == 0) {
                            this.subCur = 1;
                        } else {
                            this.setModeReq(16);
                        }
                    }
                }
            }

            if (this.mode2 == 2) {
                this.setColor(0);
                this.fillRect(0, 0, 240, 240);
            } else if (this.mode2 == 96) {
                if (this.GameSelectType == 0) {
                    this.drawImage(this.nImg[0], 0, 0);
                } else {
                    this.setColor(0);
                    this.drawImage(this.nImg[0], 0, 30);
                    this.fillRect(0, 0, 240, 30);
                    this.fillRect(0, 210, 240, 30);
                    var4 = this.mode2time / 20 - 10;
                    if (var4 >= 0) {
                        if (var4 > 2) {
                            var4 = 2;
                        }

                        this.setClip(84, 108, 76, 24);
                        this.drawImage(this.nImg[0], 84 - var4 * 76, -72);
                    }
                }
            } else {
                this.drawImage(this.nImg[0], 0, 0);
                if (this.btWriteErr && !this.game_pause) {
                    this.setColor(0);

                    for(var5 = 0; var5 < 240; var5 += 2) {
                        this.drawLine(0, var5, 240, var5);
                    }

                    this.setColor(-1);
                    this.drawStringC(120, 120, "対戦相手がゲーム一時停止中");
                } else if (this.game_pause2 && !this.game_pause) {
                    this.setColor(0);

                    for(var5 = 0; var5 < 240; var5 += 2) {
                        this.drawLine(0, var5, 240, var5);
                    }

                    this.setColor(-1);
                    this.drawStringC(120, 120, "対戦相手がPAUSE中");
                } else if (!this.game_pause && this.mode2 >= 48) {
                    int var11 = this.MapB1TBL[this.GameMapType];

                    for(var1 = 0; var1 < this.player_num; ++var1) {
                        if (this.play_stat[var1][10] >= 1000000) {
                            var10000 = this.play_stat[var1];
                            var10000[25] += this.play_stat[var1][10] / 1000000;
                            this.play_stat[var1][10] %= 1000000;
                            if (this.play_stat[var1][25] > 999) {
                                this.play_stat[var1][25] = 999;
                                this.play_stat[var1][10] = 999999;
                            }
                        }

                        if (this.play_stat[var1][25] > this.play_stat[var1][27]) {
                            if (999999 > this.play_stat[var1][12]) {
                                var2 = (this.play_stat[var1][10] - this.play_stat[var1][12]) / 5;
                                if (var2 < 0) {
                                    var2 = 0 - var2;
                                }

                                if (var2 < 10) {
                                    var2 = 10;
                                }

                                var10000 = this.play_stat[var1];
                                var10000[12] += var2;
                                if (999999 <= this.play_stat[var1][12]) {
                                    var10002 = this.play_stat[var1][27]++;
                                    this.play_stat[var1][12] = 0;
                                }
                            } else {
                                var10002 = this.play_stat[var1][27]++;
                                this.play_stat[var1][12] = 0;
                            }
                        } else if (this.play_stat[var1][10] > this.play_stat[var1][12]) {
                            var2 = (this.play_stat[var1][10] - this.play_stat[var1][12]) / 5;
                            if (var2 < 0) {
                                var2 = 0 - var2;
                            }

                            if (var2 < 10) {
                                var2 = 10;
                            }

                            var10000 = this.play_stat[var1];
                            var10000[12] += var2;
                            if (this.play_stat[var1][10] <= this.play_stat[var1][12]) {
                                this.play_stat[var1][12] = this.play_stat[var1][10];
                            }
                        }
                    }

                    var1 = 0;

                    label2164:
                    while(true) {
                        if (var1 >= this.player_num) {
                            if (this.GameSelectType == 0 && this.player_num == 2) {
                                var1 = 0;

                                while(true) {
                                    if (var1 >= 2) {
                                        break label2164;
                                    }

                                    if ((this.play_stat[var1][1] & 512) != 0) {
                                        var15 = this.FramePosTbl2[var1][this.GameMapType][0];
                                        var10 = this.FramePosTbl2[var1][this.GameMapType][1];
                                        var10000 = this.play_stat[var1];
                                        var10000[106] += 2;
                                        if (this.play_stat[var1][106] <= 32) {
                                            for(var4 = 0; var4 < this.play_stat[var1][22]; ++var4) {
                                                var6 = var15 + (this.clr_map2[var1][var4 * 2 + 1] % 16 - 1) * var11;
                                                var7 = var10 + this.clr_map2[var1][var4 * 2 + 1] / 16 * var11;
                                                var6 += (this.FramePosTbl2[var1][this.GameMapType][4] - 16 - var6) * this.play_stat[var1][106] / 32;
                                                var7 += (this.FramePosTbl2[var1][this.GameMapType][5] + this.Cos(90 * this.play_stat[var1][106] / 32) - var7) * this.play_stat[var1][106] / 32;
                                                this.setClip(var6, var7, 16, 16);
                                                this.drawImage(this.iGem[15], var6 - this.play_stat[var1][106] / 2 % 5 * 16, var7);
                                            }
                                        } else if (this.play_stat[var1][106] <= 46) {
                                            var10000 = this.play_stat[var1];
                                            var10000[1] &= -4097;
                                            var10000 = this.play_stat[var1];
                                            var10000[1] |= 8192;
                                            var6 = this.FramePosTbl2[var1][this.GameMapType][4] - 16;
                                            var7 = this.FramePosTbl2[var1][this.GameMapType][5];
                                            this.setClip(var6, var7, 32, 32);
                                            this.drawImage(this.iGem[12], var6 - (this.play_stat[var1][106] - 32) / 2 * 32, var7);
                                        } else {
                                            var10000 = this.play_stat[var1];
                                            var10000[1] &= -8193;
                                            var10000 = this.play_stat[var1];
                                            var10000[1] &= -513;
                                            this.play_stat[var1][106] = 0;
                                        }
                                    }

                                    ++var1;
                                }
                            }

                            if (this.GameSelectType != 1 || this.player_num != 2) {
                                break;
                            }

                            var1 = 0;

                            while(true) {
                                if (var1 >= 2) {
                                    break label2164;
                                }

                                if ((this.play_stat[var1][1] & 512) != 0) {
                                    var15 = this.FramePosTbl2[var1][this.GameMapType][0];
                                    var10 = this.FramePosTbl2[var1][this.GameMapType][1];
                                    var10000 = this.play_stat[var1];
                                    var10000[106] += 2;
                                    if (this.play_stat[var1][66] == 0) {
                                        if (this.play_stat[var1][106] == 64) {
                                            this.play_stat[var1][75] = 0;
                                        }
                                    } else if (this.play_stat[var1][106] == 32) {
                                        this.play_stat[var1][75] = 0;
                                    }

                                    if (this.play_stat[var1][66] > 1) {
                                        if (this.play_stat[var1][106] <= 32) {
                                            for(var4 = 0; var4 < this.play_stat[var1][22]; ++var4) {
                                                var6 = var15 + (this.clr_map2[var1][var4 * 2 + 1] % 16 - 1) * var11;
                                                var7 = var10 + this.clr_map2[var1][var4 * 2 + 1] / 16 * var11;
                                                var6 += (this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][0] + 42 - var6) * this.play_stat[var1][106] / 32;
                                                var7 += (this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][1] + this.Cos(90 * this.play_stat[var1][106] / 32) * 2 - var7) * this.play_stat[var1][106] / 32;
                                                this.setClip(var6, var7, var11, var11);
                                                this.drawImage(this.iGem[15], var6 - this.play_stat[var1][106] / 2 % 5 * 16, var7);
                                            }
                                        } else if (this.play_stat[var1][106] <= 64) {
                                            var6 = this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][0] + 42;
                                            var7 = this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][1] - 16;
                                            this.setClip(var6, var7, 32, 32);
                                            this.drawImage(this.iGem[12], var6 - (this.play_stat[var1][106] - 32) / 2 * 32, var7);
                                        } else {
                                            var10000 = this.play_stat[var1];
                                            var10000[1] &= -513;
                                            this.play_stat[var1][106] = 0;
                                        }
                                    } else if (this.play_stat[var1][106] <= 32) {
                                        for(var4 = 0; var4 < this.play_stat[var1][22]; ++var4) {
                                            var6 = var15 + (this.clr_map2[var1][var4 * 2 + 1] % 16 - 1) * var11;
                                            var7 = var10 + this.clr_map2[var1][var4 * 2 + 1] / 16 * var11;
                                            var6 += (this.FramePosTbl2[var1][this.GameMapType][0] + 42 - var6) * this.play_stat[var1][106] / 32;
                                            var7 += (this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][1] + this.Cos(90 * this.play_stat[var1][106] / 32) * 2 - var7) * this.play_stat[var1][106] / 32;
                                            this.setClip(var6, var7, var11, var11);
                                            this.drawImage(this.iGem[15], var6 - this.play_stat[var1][106] / 2 % 5 * 16, var7);
                                        }

                                        if (this.play_stat[var1][106] == 32 && (this.GameMapType != 4 || this.btSrvFlg != 1)) {
                                            this.SndPlay(3, 20);
                                        }
                                    } else if (this.play_stat[var1][106] > 64) {
                                        if (this.play_stat[var1][106] <= 96) {
                                            if (this.play_stat[var1][66] == 0) {
                                                var6 = this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][0] + 42;
                                                var7 = this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][1] - 16;
                                                this.setClip(var6, var7, 32, 32);
                                                this.drawImage(this.iGem[12], var6 - (this.play_stat[var1][106] - 64) / 2 * 32, var7);
                                            } else {
                                                var10000 = this.play_stat[var1];
                                                var10000[1] &= -513;
                                                this.play_stat[var1][106] = 0;
                                            }
                                        } else {
                                            var10000 = this.play_stat[var1];
                                            var10000[1] &= -513;
                                            this.play_stat[var1][106] = 0;
                                        }
                                    } else {
                                        var6 = this.FramePosTbl2[var1][this.GameMapType][0] + 42;
                                        var7 = this.FramePosTbl2[var1][this.GameMapType][1] - 16;
                                        this.setClip(var6, var7, 32, 32);
                                        this.drawImage(this.iGem[12], var6 - (this.play_stat[var1][106] - 32) / 2 * 32, var7);
                                        if (this.play_stat[var1][66] == 0) {
                                            var2 = this.play_stat[var1][106] - 32;

                                            for(var4 = 0; var4 < this.play_stat[var1][22]; ++var4) {
                                                var6 = var15 + 42;
                                                var6 += (this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][0] + 42 - var6) * var2 / 32;
                                                var7 = var10 + (this.FramePosTbl2[var1 + 1 & 1][this.GameMapType][1] + this.Cos(90 * var2 / 32) * 2 - var10) / 32;
                                                this.setClip(var6, var7, var11, var11);
                                                this.drawImage(this.iGem[15], var6 - this.play_stat[var1][106] / 2 % 5 * 16, var7);
                                            }
                                        }

                                        this.setClip(0, 0, 240, 240);
                                        this.drawImageC(this.nImg[20], var15 + 42, var10 - 8);
                                    }
                                }

                                ++var1;
                            }
                        }

                        var15 = this.FramePosTbl2[var1][this.GameMapType][0];
                        var10 = this.FramePosTbl2[var1][this.GameMapType][1];
                        if ((this.play_stat[var1][1] & 2) == 0) {
                            this.drawImage(this.nImg[1 + var1], var15, var10);
                            if (this.GameMapType == 0 && this.play_stat[var1][100] == 0) {
                                this.setColor(16777215);
                                var6 = var15;

                                for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                                    var7 = var10;

                                    for(var5 = 16 * this.MapTOPTBL[this.GameMapType]; var5 < 368; var5 += 16) {
                                        if (this.clr_map[var4 + var5] != 0 && this.play_map[var1][var4 + var5] != 0) {
                                            this.drawRect(var6, var7, 16, 16);
                                        }

                                        var7 += 16;
                                    }

                                    var6 += 16;
                                }
                            }
                        } else {
                            this.drawMap1P(var1, this.play_stat[var1][15], false);
                            if (this.play_stat[var1][0] == 64) {
                                if (this.play_stat[var1][15] == 0) {
                                    for(var4 = 0; var4 < this.play_stat[var1][22]; ++var4) {
                                        var6 = var15 + (this.clr_map2[var1][var4 * 2 + 1] % 16 - 1) * var11;
                                        var7 = var10 + this.clr_map2[var1][var4 * 2 + 1] / 16 * var11;
                                        this.setClip(var6, var7, var11, var11);
                                        if (this.play_stat[var1][16] / 2 > 2) {
                                            this.drawImage(this.iGem[11], var6, var7 - (this.play_stat[var1][16] / 2 - 2) / 2 * var11);
                                        }

                                        if (this.play_stat[var1][16] / 2 < 8) {
                                            this.drawImage(this.iGem[11], var6 - 16, var7 - this.play_stat[var1][16] / 2 / 2 * var11);
                                        }

                                        var2 = this.play_stat[var1][13];
                                        if (var2 > 4) {
                                            var2 = 4;
                                        }

                                        while(var2 > 0) {
                                            this.setClip(var6 + (var2 & 1) * 8 - 2, var7 + (var2 - (var4 & 1)) * 4 - this.play_stat[var1][16] / 2, 12, 12);
                                            this.drawImage(this.iGem[11], var6 + (var2 & 1) * 8 - 2 - 32, var7 + (var2 - (var4 & 1)) * 4 - this.play_stat[var1][16] / 2 - this.play_stat[var1][16] / 2 / (var2 + 1) % 6 * 12);
                                            --var2;
                                        }
                                    }
                                } else {
                                    for(var4 = 0; var4 < this.play_stat[var1][22]; ++var4) {
                                        var6 = var15 + (this.clr_map2[var1][var4 * 2 + 1] % 16 - 1) * var11;
                                        var7 = var10 + this.clr_map2[var1][var4 * 2 + 1] / 16 * var11;
                                        if (this.play_stat[var1][16] / 2 < 3) {
                                            this.setClip(var6, var7, var11, var11);
                                            this.drawImage(this.iGem[this.clr_map2[var1][var4 * 2] - 1 + 6], var6 - (1 + this.play_stat[var1][16] / 2 % 8) * var11, var7);
                                        } else if (this.play_stat[var1][16] / 2 < 7) {
                                            for(var5 = 0; var5 < 4; ++var5) {
                                                if (var5 < 2) {
                                                    var6 = var15 + (this.clr_map2[var1][var4 * 2 + 1] % 16 - 1) * var11 + (-var5 * this.play_stat[var1][16] - 3) / 2 * 2;
                                                } else {
                                                    var6 = var15 + (this.clr_map2[var1][var4 * 2 + 1] % 16 - 1) * var11 + ((var5 - 1) * this.play_stat[var1][16] - 3) / 2 * 2;
                                                }

                                                var7 = var10 + this.clr_map2[var1][var4 * 2 + 1] / 16 * var11 + this.Sin(this.play_stat[var1][16] * 90 / 32) / 16;
                                                this.setClip(var6, var7, var11, var11);
                                                this.drawImage(this.iGem[this.clr_map2[var1][var4 * 2] - 1 + 6], var6 + var5 - (1 + this.play_stat[var1][16] / 2 % 8) * var11, var7);
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        if ((this.play_stat[var1][1] & 65536) != 0) {
                            var10000 = this.play_stat[var1];
                            var10000[72] += 2;
                            if ((this.play_stat[var1][72] / 2 & 1) == 0) {
                                this.setColor(16711935);
                                this.drawRect(var15, var10, 96, 208);
                            }

                            var6 = (this.play_stat[var1][2] >> 4) * var11 + var15 - var11;
                            var7 = (this.play_stat[var1][3] * var11 >> 4) + var10 - this.MapTOPTBL[this.GameMapType] * var11;
                            switch(this.play_stat[var1][32]) {
                            case 8:
                                for(var2 = 0; var2 < 12; ++var2) {
                                    if (this.play_stat[var1][72] < 40) {
                                        var4 = var6 + (var2 * 8 - var6 + var15) * this.play_stat[var1][72] / 40;
                                        var5 = var7;
                                    } else {
                                        var4 = var6 + var2 * 8 - var6 + var15;
                                        var5 = var7 + (this.play_stat[var1][72] - 40) * 5;
                                    }

                                    this.setClip(var4, var5, 12, 12);
                                    this.drawImage(this.iGem[11], var4 - 32, var5 - this.mode2time / 2 % 5 * 12);
                                }

                                if (this.play_stat[var1][72] > 80) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] &= -65537;
                                }
                                break;
                            case 9:
                                for(var2 = 0; var2 < 32; ++var2) {
                                    var4 = var6 + this.Sin(var2 * 22) * 2 * (60 - this.play_stat[var1][72] - var2 / 16 * 10) / 60;
                                    var5 = var7 + this.Cos(var2 * 22) * 2 * (60 - this.play_stat[var1][72] - var2 / 16 * 10) / 60;
                                    this.setClip(var4, var5, 12, 12);
                                    this.drawImage(this.iGem[11], var4 - 32, var5 - this.mode2time / 2 % 5 * 12);
                                }

                                if (this.play_stat[var1][72] > 60) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] &= -65537;
                                }
                                break;
                            case 10:
                                for(var2 = 0; var2 < 32; ++var2) {
                                    if (this.play_stat[var1][72] - var2 >= 0) {
                                        var4 = var6 + this.Sin(var2 * 22) * 2 * (this.play_stat[var1][72] - var2) / 60;
                                        var5 = var7 + this.Cos(var2 * 22) * 2 * (this.play_stat[var1][72] - var2) / 60;
                                    } else {
                                        var4 = var6;
                                        var5 = var7;
                                    }

                                    this.setClip(var4, var5, 12, 12);
                                    this.drawImage(this.iGem[11], var4 - 32, var5 - this.mode2time / 2 % 5 * 12);
                                }

                                if (this.play_stat[var1][72] > 60) {
                                    var10000 = this.play_stat[var1];
                                    var10000[1] &= -65537;
                                }
                            }
                        }

                        this.setClip(0, 0, 240, 240);
                        if (this.GameMapType != 6) {
                            if (this.play_stat[var1][98] == 0) {
                                var6 = this.rand(this.MapWTBL[this.GameMapType]) + 1;
                                var7 = this.rand(this.MapHTBL[this.GameMapType]) + this.MapTOPTBL[this.GameMapType];
                                var4 = var6 + var7 * 16;
                                if (this.GameSelectType == 0) {
                                    if (this.play_map[var1][var4] != 0 && this.play_map[var1][var4] != 255) {
                                        this.play_stat[var1][96] = var6;
                                        this.play_stat[var1][97] = var7;
                                        this.play_stat[var1][98] = 1;
                                    }
                                } else if (this.play_map[var1][var4] >= 1 && this.play_map[var1][var4] <= 5 && this.link_map[var1][var4] == 0) {
                                    this.play_stat[var1][96] = var6;
                                    this.play_stat[var1][97] = var7;
                                    this.play_stat[var1][98] = 1;
                                }
                            } else {
                                var6 = this.play_stat[var1][96];
                                var7 = this.play_stat[var1][97];
                                var4 = var6 + var7 * 16;
                                if (this.play_map[var1][var4] != 0 && this.offy_map[var1][var4] == 0 && this.play_map[var1][var4] != 255 && (this.GameSelectType == 0 || this.link_map[var1][var4] == 0)) {
                                    var6 = var15 + (var6 - 1) * this.MapB1TBL[this.GameMapType];
                                    var7 = var10 + (var7 - this.MapTOPTBL[this.GameMapType]) * this.MapB1TBL[this.GameMapType];
                                    this.setClip(var6, var7, this.MapB1TBL[this.GameMapType], this.MapB1TBL[this.GameMapType]);
                                    this.drawImage(this.nImg[0], 0, 0);
                                    if (this.GameSelectType == 0) {
                                        this.drawImage(this.iGem[this.play_map[var1][var4] - 1], var6 - this.play_stat[var1][98] % 4 * this.MapB1TBL[this.GameMapType], var7);
                                        var10002 = this.play_stat[var1][98]++;
                                        if (this.play_stat[var1][98] >= 4) {
                                            this.play_stat[var1][98] = 0;
                                        }
                                    } else {
                                        if (this.GameMapType == 7) {
                                            this.drawImage(this.iGem[this.play_map[var1][var4] - 1 + 6], var6 - (9 * this.MapB1TBL[this.GameMapType] + this.play_stat[var1][98] % 5 * this.MapB1TBL[this.GameMapType]) % 240, var7 - (9 * this.MapB1TBL[this.GameMapType] + this.play_stat[var1][98] % 5 * this.MapB1TBL[this.GameMapType]) / 240 * 24);
                                        } else {
                                            this.drawImage(this.iGem[this.play_map[var1][var4] - 1 + 6], var6 - (9 * this.MapB1TBL[this.GameMapType] + this.play_stat[var1][98] % 5 * this.MapB1TBL[this.GameMapType]), var7);
                                        }

                                        var10002 = this.play_stat[var1][98]++;
                                        int[] var12 = new int[]{10, 8, 12, 10, 5, 3};
                                        if (this.play_stat[var1][98] >= var12[this.play_map[var1][var4] - 1]) {
                                            this.play_stat[var1][98] = 0;
                                        }
                                    }
                                } else {
                                    this.play_stat[var1][98] = 0;
                                }
                            }
                        }

                        if ((this.play_stat[var1][1] & 1) == 1) {
                            if (this.play_stat[var1][15] == 0) {
                                var6 = (this.play_stat[var1][2] * this.MapB1TBL[this.GameMapType] >> 4) + var15 - this.MapB1TBL[this.GameMapType];
                                var7 = (this.play_stat[var1][3] * this.MapB1TBL[this.GameMapType] >> 4) + var10 - this.MapTOPTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType];
                                this.setClip(var6, var7, 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][32] - 1], var6 - this.mode2time / 2 % 4 * this.MapB1TBL[this.GameMapType], var7);
                                this.setClip(var6, var7 - 1 * this.MapB1TBL[this.GameMapType], 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][33] - 1], var6 - this.mode2time / 2 % 4 * this.MapB1TBL[this.GameMapType], var7 - 1 * this.MapB1TBL[this.GameMapType]);
                                this.setClip(var6, var7 - 2 * this.MapB1TBL[this.GameMapType], 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][34] - 1], var6 - this.mode2time / 2 % 4 * this.MapB1TBL[this.GameMapType], var7 - 2 * this.MapB1TBL[this.GameMapType]);
                            } else {
                                if (this.GameMapType == 6) {
                                    var6 = (this.play_stat[var1][2] >> 4) * var11 + var15 - var11;
                                    var7 = (this.play_stat[var1][3] * var11 >> 4) + var10 - this.MapTOPTBL[this.GameMapType] * var11;
                                } else {
                                    var6 = (this.play_stat[var1][2] * this.MapB1TBL[this.GameMapType] >> 4) + var15 - this.MapB1TBL[this.GameMapType];
                                    var7 = (this.play_stat[var1][3] * this.MapB1TBL[this.GameMapType] >> 4) + var10 - this.MapTOPTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType];
                                }

                                this.setClip(var6, var7, var11, var11);
                                if ((this.mode2time / 2 & 2) != 0) {
                                    this.drawImage(this.iGem[this.play_stat[var1][32] - 1], var6, var7);
                                } else {
                                    this.drawImage(this.iGem[this.play_stat[var1][32] - 1 + 6], var6, var7);
                                }

                                switch(this.play_stat[var1][7]) {
                                case 0:
                                    if (this.play_stat[var1][8] == 0) {
                                        var7 -= var11;
                                    } else if (this.play_stat[var1][8] > 0) {
                                        var7 -= var11 / 2;
                                        var6 += var11 / 2;
                                    } else {
                                        var7 -= var11 / 2;
                                        var6 -= var11 / 2;
                                    }
                                    break;
                                case 1:
                                    if (this.play_stat[var1][8] == 0) {
                                        var6 += var11;
                                    } else if (this.play_stat[var1][8] > 0) {
                                        var7 += var11 / 2;
                                        var6 += var11 / 2;
                                    } else {
                                        var7 -= var11 / 2;
                                        var6 += var11 / 2;
                                    }
                                    break;
                                case 2:
                                    if (this.play_stat[var1][8] == 0) {
                                        var7 += var11;
                                    } else if (this.play_stat[var1][8] > 0) {
                                        var6 -= var11 / 2;
                                        var7 += var11 / 2;
                                    } else {
                                        var6 += var11 / 2;
                                        var7 += var11 / 2;
                                    }
                                    break;
                                case 3:
                                    if (this.play_stat[var1][8] == 0) {
                                        var6 -= var11;
                                    } else if (this.play_stat[var1][8] > 0) {
                                        var7 -= var11 / 2;
                                        var6 -= var11 / 2;
                                    } else {
                                        var7 += var11 / 2;
                                        var6 -= var11 / 2;
                                    }
                                }

                                this.setClip(var6, var7, var11, var11);
                                this.drawImage(this.iGem[this.play_stat[var1][33] - 1], var6, var7);
                            }

                            this.setClip(0, 0, 240, 240);
                        }

                        var6 = this.FramePosTbl2[var1][this.GameMapType][2];
                        var7 = this.FramePosTbl2[var1][this.GameMapType][3];
                        int var18;
                        if (this.play_stat[var1][15] == 0) {
                            if (this.play_stat[var1][36] >= 7) {
                                this.setClip(var6, var7, 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][36] - 1], var6 - this.mode2time / 2 % 4 * this.MapB1TBL[this.GameMapType], var7);
                                this.setClip(var6, var7 - 1 * this.MapB1TBL[this.GameMapType], 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][37] - 1], var6 - this.mode2time / 2 % 4 * this.MapB1TBL[this.GameMapType], var7 - 1 * this.MapB1TBL[this.GameMapType]);
                                this.setClip(var6, var7 - 2 * this.MapB1TBL[this.GameMapType], 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][38] - 1], var6 - this.mode2time / 2 % 4 * this.MapB1TBL[this.GameMapType], var7 - 2 * this.MapB1TBL[this.GameMapType]);
                            } else {
                                this.setClip(var6, var7, 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][36] - 1], var6, var7);
                                this.setClip(var6, var7 - 1 * this.MapB1TBL[this.GameMapType], 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][37] - 1], var6, var7 - 1 * this.MapB1TBL[this.GameMapType]);
                                this.setClip(var6, var7 - 2 * this.MapB1TBL[this.GameMapType], 16, 16);
                                this.drawImage(this.iGem[this.play_stat[var1][38] - 1], var6, var7 - 2 * this.MapB1TBL[this.GameMapType]);
                            }

                            if (this.player_num == 2) {
                                this.setClip(0, 0, 240, 240);
                                var6 = this.FramePosTbl2[var1][this.GameMapType][4];
                                var7 = this.FramePosTbl2[var1][this.GameMapType][5] - 14;
                                var18 = 16711680;
                                int var13 = 13565952;
                                int var14 = 9371648;
                                if ((this.play_stat[var1][1] & 4096) != 0) {
                                    var5 = (500 - this.play_stat[var1][108]) * 50 / 500;
                                } else {
                                    var5 = (500 - this.play_stat[var1][28]) * 50 / 500;
                                }

                                if ((this.play_stat[var1][1] & 8192) != 0) {
                                    if ((this.mode2time / 2 & 1) == 0) {
                                        this.setColor(16777215);
                                    } else {
                                        this.setColor(var18);
                                    }

                                    this.fillRect(var6, var7 + 50 - var5, 5, var5);
                                } else {
                                    this.setColor(var14);
                                    this.fillRect(var6, var7 + 50 - var5, 1, var5);
                                    this.fillRect(var6 + 4, var7 + 50 - var5, 1, var5);
                                    this.setColor(var13);
                                    this.fillRect(var6 + 2, var7 + 50 - var5, 1, var5);
                                    this.fillRect(var6 + 3, var7 + 50 - var5, 1, var5);
                                    this.setColor(var18);
                                    this.fillRect(var6 + 1, var7 + 50 - var5, 1, var5);
                                }
                            }
                        } else {
                            if (var1 == 0) {
                                this.setClip(var6 + 16, var7 + 8, 8, 16);
                                this.drawImage(this.iGem[14], var6 + 16 - (this.play_stat[var1][40] - 1) * 16, var7 + 8);
                                this.setClip(var6 + 16, var7 + 8 - 16, 8, 16);
                                this.drawImage(this.iGem[14], var6 + 16 - (this.play_stat[var1][41] - 1) * 16, var7 + 8 - 16);
                            } else {
                                this.setClip(var6 - 8, var7 + 8, 8, 16);
                                this.drawImage(this.iGem[14], var6 - 16 - (this.play_stat[var1][40] - 1) * 16, var7 + 8);
                                this.setClip(var6 - 8, var7 + 8 - 16, 8, 16);
                                this.drawImage(this.iGem[14], var6 - 16 - (this.play_stat[var1][41] - 1) * 16, var7 + 8 - 16);
                            }

                            this.setClip(var6, var7, 16, 16);
                            this.drawImage(this.iGem[14], var6 - (this.play_stat[var1][36] - 1) * 16, var7);
                            this.setClip(var6, var7 - 16, 16, 16);
                            this.drawImage(this.iGem[14], var6 - (this.play_stat[var1][37] - 1) * 16, var7 - 16);
                        }

                        byte var21;
                        if (this.GameSelectType == 1) {
                            if (this.player_num == 2) {
                                this.setClip(0, 0, 240, 240);
                                byte var22;
                                if (var1 == 0) {
                                    var22 = 100;
                                    var21 = 62;
                                } else {
                                    var22 = 104;
                                    var21 = 118;
                                }

                                if (this.play_stat[var1][79] != 0) {
                                    if (var1 == 0) {
                                        if (this.GameMapType == 4) {
                                            if (this.btSrvFlg == 1) {
                                                var4 = 11;
                                            } else {
                                                var4 = 10;
                                            }
                                        } else {
                                            var4 = 11;
                                        }
                                    } else if (this.GameMapType == 4) {
                                        if (this.btSrvFlg == 1) {
                                            var4 = 10;
                                        } else {
                                            var4 = 11;
                                        }
                                    } else {
                                        var4 = this.FaceNoTbl[this.GameStageNo];
                                    }

                                    this.setClip(var22, var21 + this.FaceTbl[var4][0], 36, this.FaceTbl[var4][1]);
                                    this.drawImage(this.nImg[3 + var1], var22, var21 - 54 + this.FaceTbl[var4][0] - (this.play_stat[var1][79] - 1) / 2 * this.FaceTbl[var4][1]);
                                    var10002 = this.play_stat[var1][79]++;
                                    if (this.play_stat[var1][79] >= 4) {
                                        this.play_stat[var1][79] = 0;
                                    }
                                } else if (this.rand(30) == 1) {
                                    this.play_stat[var1][79] = 1;
                                }

                                var6 = var15;
                                var7 = var10 - 16;
                                var18 = 0;
                                if ((this.play_stat[var1][1] & 512) != 0 && this.play_stat[var1][106] < 32) {
                                    var18 = this.play_stat[var1][75];
                                }

                                var4 = this.play_stat[var1 + 1 & 1][65] - this.play_stat[var1 + 1 & 1][75] - (this.play_stat[var1 + 1 & 1][64] + this.play_stat[var1 + 1 & 1][78]);
                                if (var4 < 0) {
                                    var4 = 0;
                                }

                                var2 = this.play_stat[var1][64] + this.play_stat[var1][78] - (this.play_stat[var1][65] - var18) + var4;

                                for(var4 = 0; var4 < 6 && var2 > 0; ++var4) {
                                    byte var25;
                                    if (var2 >= 720) {
                                        var25 = 96;
                                        var2 -= 720;
                                    } else if (var2 >= 360) {
                                        var25 = 80;
                                        var2 -= 360;
                                    } else if (var2 >= 180) {
                                        var25 = 64;
                                        var2 -= 180;
                                    } else if (var2 >= 90) {
                                        var25 = 48;
                                        var2 -= 90;
                                    } else if (var2 >= 30) {
                                        var25 = 32;
                                        var2 -= 30;
                                    } else if (var2 >= 6) {
                                        var25 = 16;
                                        var2 -= 6;
                                    } else {
                                        var25 = 0;
                                        --var2;
                                    }

                                    this.setClip(var6, var7, var11, var11);
                                    this.drawImage(this.iGem[13], var6 - var25, var7);
                                    var6 += 16;
                                }
                            } else {
                                var6 = 180 + this.KabanStat[2];
                                var21 = 52;
                                int[][] var19 = new int[][]{{1, 0}, {2, 1}, {3, 3}, {2, 6}, {2, 8}, {2, 10}};
                                var4 = var19[this.KabanStat[0]][1] + (this.KabanStat[1] >> 2);
                                this.setClip(var6, var21, 32, 32);
                                this.drawImage(this.nImg[3], var6 - (var4 & 3) * 32, var21 - (var4 >> 2) * 32);
                                var10002 = this.KabanStat[1]++;
                                if (var19[this.KabanStat[0]][0] <= this.KabanStat[1] >> 2) {
                                    this.KabanStat[1] = 0;
                                    var10002 = this.KabanStat[5]++;
                                }

                                switch(this.KabanStat[0]) {
                                case 0:
                                    if (this.KabanStat[5] >= 10 && this.rand(10) == 1) {
                                        this.KabanStat[0] = this.rand(6);
                                        this.KabanStat[1] = 0;
                                        this.KabanStat[5] = 0;
                                    }
                                    break;
                                case 1:
                                    if (this.KabanStat[5] > 5) {
                                        this.KabanStat[0] = 0;
                                    }
                                    break;
                                case 2:
                                    if (this.KabanStat[5] >= 1) {
                                        this.KabanStat[0] = 0;
                                    }
                                    break;
                                case 3:
                                    if (this.KabanStat[2] < 15) {
                                        var10002 = this.KabanStat[2]++;
                                    }

                                    if (this.KabanStat[5] >= 3 && this.rand(30) == 1) {
                                        this.KabanStat[0] = 0;
                                    }
                                    break;
                                case 4:
                                    if (this.KabanStat[2] > -15) {
                                        var10002 = this.KabanStat[2]--;
                                    }

                                    if (this.KabanStat[5] >= 3 && this.rand(30) == 1) {
                                        this.KabanStat[0] = 0;
                                    }
                                    break;
                                case 5:
                                    if (this.KabanStat[5] > 1) {
                                        this.KabanStat[0] = 0;
                                    }
                                }
                            }
                        } else if (this.GameMapType == 0) {
                            this.setClip(0, 0, 240, 240);
                            this.drawImage(this.nImg[18], 180, 26);
                            if ((this.play_stat[var1][14] - this.play_stat[var1][100] * 5) / 2 % 5 == 0 || (this.play_stat[var1][14] - this.play_stat[var1][100] * 5) / 2 % 5 == 4) {
                                if (this.simg_anm >= 6) {
                                    this.simg_anm = 0;
                                    this.simg_x = 180 + this.rand(56);
                                    this.simg_y = 26 + this.rand(82);
                                } else {
                                    var6 = this.simg_x;
                                    var7 = this.simg_y;
                                    this.setClip(var6, var7, 12, 12);
                                    this.drawImage(this.iGem[11], var6 - 32, var7 - this.simg_anm * 12);
                                    ++this.simg_anm;
                                }
                            }
                        }

                        this.setClip(0, 0, 240, 240);
                        short var23;
                        if (this.GameSelectType == 0) {
                            if (this.player_num == 1) {
                                var6 = 210;
                                var23 = 130;
                                var5 = 1;

                                for(var4 = 0; var4 < 6; ++var4) {
                                    this.setClip(var6, var23, 8, 10);
                                    this.drawImage(this.nImg[6], var6 - this.play_stat[var1][12] / var5 % 10 * 8, var23);
                                    var5 *= 10;
                                    var6 -= 8;
                                }

                                var5 = 1;

                                for(var4 = 0; var4 < 3; ++var4) {
                                    this.setClip(var6, var23, 8, 10);
                                    this.drawImage(this.nImg[6], var6 - this.play_stat[var1][27] / var5 % 10 * 8, var23);
                                    var5 *= 10;
                                    var6 -= 8;
                                }

                                var6 = 208;
                                var23 = 166;
                                var5 = 1;

                                for(var4 = 0; var4 < 3; ++var4) {
                                    this.setClip(var6, var23, 8, 10);
                                    this.drawImage(this.nImg[6], var6 - this.play_stat[var1][14] / var5 % 10 * 8, var23);
                                    var5 *= 10;
                                    var6 -= 8;
                                }

                                var6 = 208;
                                var23 = 204;
                                var5 = 1;

                                for(var4 = 0; var4 < 6; ++var4) {
                                    this.setClip(var6, var23, 8, 10);
                                    this.drawImage(this.nImg[6], var6 - this.play_stat[var1][20] / var5 % 10 * 8, var23);
                                    var5 *= 10;
                                    var6 -= 8;
                                }

                                var6 = 164;
                                var21 = 83;
                                var5 = 1;

                                for(var4 = 0; var4 < 6; ++var4) {
                                    this.setClip(var6, var21, 8, 15);
                                    this.drawImage(this.nImg[7], var6 - this.play_stat[var1][26] / var5 % 10 * 8, var21);
                                    var5 *= 10;
                                    var6 -= 8;
                                }
                            }
                        } else {
                            if (this.player_num != 2) {
                                var6 = 210;
                                var23 = 207;
                                var5 = 1;

                                for(var4 = 0; var4 < 6; ++var4) {
                                    this.setClip(var6, var23, 10, 14);
                                    this.drawImage(this.nImg[9], var6 - this.play_stat[var1][12] / var5 % 10 * 10, var23);
                                    var5 *= 10;
                                    var6 -= 10;
                                }

                                var5 = 1;

                                for(var4 = 0; var4 < 3; ++var4) {
                                    this.setClip(var6, var23, 10, 14);
                                    this.drawImage(this.nImg[9], var6 - this.play_stat[var1][27] / var5 % 10 * 10, var23);
                                    var5 *= 10;
                                    var6 -= 10;
                                }

                                var6 = 210;
                                var23 = 168;
                                var5 = 1;

                                for(var4 = 0; var4 < 9; ++var4) {
                                    this.setClip(var6, var23, 10, 14);
                                    this.drawImage(this.nImg[8], var6 - this.play_stat[var1][26] / var5 % 10 * 10, var23);
                                    var5 *= 10;
                                    var6 -= 10;
                                }

                                var6 = 170;
                                var23 = 129;
                                var5 = 1;

                                for(var4 = 0; var4 < 5; ++var4) {
                                    this.setClip(var6, var23, 10, 14);
                                    this.drawImage(this.nImg[6], var6 - this.play_stat[var1][20] / var5 % 10 * 10, var23);
                                    var5 *= 10;
                                    var6 -= 10;
                                }

                                var6 = 214;
                                var23 = 129;
                                var5 = 1;

                                for(var4 = 0; var4 < 3; ++var4) {
                                    this.setClip(var6, var23, 10, 14);
                                    this.drawImage(this.nImg[7], var6 - this.play_stat[var1][30] / var5 % 10 * 10, var23);
                                    var5 *= 10;
                                    var6 -= 10;
                                }
                            }

                            if ((this.play_stat[var1][1] & '耀') == 0 && this.play_stat[var1][13] >= 1 && this.mode2 == 48) {
                                short var24;
                                if (var1 == 0) {
                                    var24 = 40;
                                } else {
                                    var24 = 160;
                                }

                                var21 = 100;
                                var5 = 1;
                                this.setClip(var24, var21, 58, 24);
                                this.drawImage(this.nImg[5], var24 - 120, var21);
                                var6 = var24 - 12;
                                var2 = this.play_stat[var1][13];

                                for(var4 = 0; var4 < 2; ++var4) {
                                    this.setClip(var6, var21, 12, 24);
                                    this.drawImage(this.nImg[5], var6 - var2 / var5 % 10 * 12, var21);
                                    var5 *= 10;
                                    if (var2 / var5 == 0) {
                                        break;
                                    }

                                    var6 -= 12;
                                }
                            }
                        }

                        this.setClip(0, 0, 240, 240);
                        if ((this.play_stat[var1][1] & '耀') != 0) {
                            this.drawImage(this.nImg[10], var15 + (this.MapB1TBL[this.GameMapType] * this.MapWTBL[this.GameMapType] - this.nImg[10].getWidth()) / 2, var10 + 60);
                        }

                        ++var1;
                    }
                } else if (this.game_pause) {
                    this.setColor(0);

                    for(var5 = 0; var5 < 240; var5 += 2) {
                        this.drawLine(0, var5, 240, var5);
                    }

                    for(var4 = 0; var4 < this.nImg[12].getWidth(); var4 += 8) {
                        var5 = this.Sin((this.mode2time + var4) * 3 % 360) / 20;
                        this.setClip(120 + var4 - this.nImg[12].getWidth() / 2, 80 + var5, 8, this.nImg[12].getHeight());
                        this.drawImage(this.nImg[12], 120 - this.nImg[12].getWidth() / 2, 80 + var5);
                    }

                    this.setClip(0, 0, 240, 240);
                    this.drawWinG(80, 140 - this.fontH / 2 - 10, 80, 45 + this.fontH);
                    if (this.GameSelectType == 0) {
                        this.setClip(80, 133 + this.subCur * 25, 16, 16);
                        this.drawImage(this.iGem[0], 80, 132 + this.subCur * 25);
                        this.setClip(144, 133 + this.subCur * 25, 16, 16);
                        this.drawImage(this.iGem[0], 144, 132 + this.subCur * 25);
                        this.setClip(0, 0, 240, 240);
                        this.setColor(16777215);
                        this.drawStringC(120, 140, this.titleMenuSTR2[0][0][3]);
                        this.drawStringC(120, 165, this.titleMenuSTR2[0][0][2]);
                    } else {
                        this.setClip(80, 133 + this.subCur * 25, 16, 16);
                        this.drawImage(this.iGem[14], 80, 133 + this.subCur * 25);
                        this.setClip(144, 133 + this.subCur * 25, 16, 16);
                        this.drawImage(this.iGem[14], 144, 133 + this.subCur * 25);
                        this.setClip(0, 0, 240, 240);
                        this.setColor(16777215);
                        this.drawStringC(120, 140, this.titleMenuSTR2[0][0][3]);
                        this.drawStringC(120, 165, this.titleMenuSTR2[0][0][2]);
                    }
                }

                if (this.game_msg != 0) {
                    label1889:
                    switch(this.game_msg) {
                    case 1:
                        if (this.GameMapType == 0) {
                            this.drawImageC(this.nImg[14], this.FramePosTbl2[0][this.GameMapType][0] + 48, 120);
                        } else {
                            if (this.GameSelectType == 0) {
                                this.setColor(0);
                                if (this.GameMapType == 1) {
                                    if (this.mode2time < 20) {
                                        var5 = this.mode2time * 2;
                                    } else {
                                        var5 = 40;
                                    }
                                } else {
                                    var5 = 40;
                                }

                                this.fillRect(0, 120 - var5 / 2, 240, 1 + var5);
                                this.setClip(0, 120 - var5 / 2, 240, 1 + var5);
                            }

                            this.drawImageC(this.nImg[14], 120, 120);
                        }
                        break;
                    case 2:
                        if (this.GameMapType == 0) {
                            this.drawImageC(this.nImg[15], this.FramePosTbl2[0][this.GameMapType][0] + 48, 120);
                        } else {
                            if (this.GameSelectType == 0) {
                                this.setColor(0);
                                if (this.mode2time >= 160) {
                                    var5 = (180 - this.mode2time) * 2;
                                } else {
                                    var5 = 40;
                                }

                                this.fillRect(0, 120 - var5 / 2, 240, 1 + var5);
                                this.setClip(0, 120 - var5 / 2, 240, 1 + var5);
                            }

                            this.drawImageC(this.nImg[15], 120, 120);
                        }
                        break;
                    case 3:
                    case 8:
                    case 9:
                    case 10:
                    case 11:
                        if (this.GameSelectType != 1) {
                            if (this.player_num == 2) {
                                var6 = this.FramePosTbl2[0][this.GameMapType][0] + this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType] / 2;
                                var6 -= this.nImg[10].getWidth() / 2;
                                this.setClip(var6, 80, this.nImg[10].getWidth(), 16);
                                this.drawImage(this.nImg[10], var6, 80 - (this.mode2time / 2 & 1) * 16);
                                var6 = this.FramePosTbl2[1][this.GameMapType][0] + this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType] / 2;
                                var6 -= this.nImg[11].getWidth() / 2;
                                this.setClip(var6, 80, this.nImg[11].getWidth(), 16);
                                this.drawImage(this.nImg[11], var6, 80 - (this.mode2time / 2 & 1) * 16);
                            } else if (this.game_msg != 11) {
                                var6 = this.FramePosTbl2[0][this.GameMapType][0] + this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType] / 2;
                                var6 -= this.nImg[12].getWidth() / 2;
                                this.setClip(var6, 80, this.nImg[12].getWidth(), 16);
                                this.drawImage(this.nImg[12], var6, 80 - (this.mode2time / 2 & 1) * 16);
                            }
                        } else if (this.player_num != 2) {
                            if (this.mode2 == 10) {
                                var7 = 80;
                            } else {
                                var7 = 160 - this.mode2time;
                            }

                            if (var7 < 80) {
                                var7 = 80;
                            }

                            this.drawImageC(this.nImg[10], this.FramePosTbl2[0][this.GameMapType][0] + this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType] / 2, var7);
                        } else {
                            for(var1 = 0; var1 < 2; ++var1) {
                                var6 = this.FramePosTbl2[var1][this.GameMapType][0];
                                if ((this.play_stat[var1][1] & 4) != 0) {
                                    if (this.mode2 == 10) {
                                        var7 = 80;
                                    } else {
                                        var7 = 160 - this.mode2time;
                                    }

                                    if (var7 < 80) {
                                        var7 = 80;
                                    }
                                } else {
                                    var7 = 80;
                                    if (this.mode2time % 60 < 2) {
                                        this.hanabi_no = this.rand(5);
                                        this.hanabi_x = this.rand(90);
                                        this.hanabi_y = this.rand(120);
                                    }

                                    for(var2 = 0; var2 < 16; ++var2) {
                                        var4 = var6 + this.hanabi_x + this.Sin(var2 * 22) * (this.mode2time % 60) / 3 / 60;
                                        var5 = var7 + this.hanabi_y + this.Cos(var2 * 22) * (this.mode2time % 60) / 3 / 60 - this.Sin(this.mode2time % 60 * 4) / 10;
                                        this.setClip(var4, var5, 16, 16);
                                        this.drawImage(this.iGem[6 + (this.hanabi_no + var2) % 5], var4 - 96, var5);
                                    }
                                }

                                this.setClip(0, 0, 240, 240);
                                this.drawImageC(this.nImg[10 + var1], var6 + this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType] / 2, var7);
                            }
                        }

                        this.setClip(0, 0, 240, 240);
                        if (this.game_msg != 10) {
                            if (this.game_msg == 11) {
                                this.setColor(0);

                                for(var5 = 0; var5 < 240; var5 += 2) {
                                    this.drawLine(0, var5, 240, var5);
                                }

                                if (this.GameSelectType == 0) {
                                    this.setClip(120 - this.nImg[12].getWidth() / 2, 100, 86, 16);
                                    this.drawImage(this.nImg[12], 120 - this.nImg[12].getWidth() / 2, 100 - (this.mode2time / 2 & 1) * 16);
                                } else {
                                    this.drawImageC(this.nImg[12], 120, 120);
                                }
                            } else if (this.game_msg == 9) {
                                this.setColor(0);

                                for(var5 = 0; var5 < 240; var5 += 2) {
                                    this.drawLine(0, var5, 240, var5);
                                }

                                for(var4 = 0; var4 < this.nImg[13].getWidth(); var4 += 8) {
                                    var5 = this.Sin((this.mode2time + var4) * 3 % 360) / 20;
                                    this.setClip(120 + var4 - this.nImg[13].getWidth() / 2, 40 + var5, 8, this.nImg[13].getHeight());
                                    this.drawImage(this.nImg[13], 120 - this.nImg[13].getWidth() / 2, 40 + var5);
                                }

                                this.setClip(0, 0, 240, 240);
                                this.drawWinG(30, 140 - this.fontH / 2 - 10, 180, 25 + this.fontH + 20);
                                if (this.GameSelectType == 0) {
                                    this.setClip(40, 133 + this.subCur * 25, 16, 16);
                                    this.drawImage(this.iGem[0], 40, 133 + this.subCur * 25);
                                    this.setClip(184, 133 + this.subCur * 25, 16, 16);
                                    this.drawImage(this.iGem[0], 184, 133 + this.subCur * 25);
                                    this.setClip(0, 0, 240, 240);
                                } else {
                                    this.setClip(40, 133 + this.subCur * 25, 16, 16);
                                    this.drawImage(this.iGem[14], 40, 133 + this.subCur * 25);
                                    this.setClip(184, 133 + this.subCur * 25, 16, 16);
                                    this.drawImage(this.iGem[14], 184, 133 + this.subCur * 25);
                                    this.setClip(0, 0, 240, 240);
                                }

                                this.setColor(16777215);
                                this.drawStringC(120, 140, "ゲームをつづける");
                                this.drawStringC(120, 165, "おわる");
                            }
                        }
                    case 4:
                    case 7:
                    case 13:
                    case 14:
                    case 15:
                    case 16:
                    case 17:
                    case 18:
                    case 19:
                    case 20:
                    default:
                        break;
                    case 5:
                        var6 = this.FramePosTbl2[0][this.GameMapType][0] + (this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType] - 88) / 2;
                        String[] var16;
                        String[] var20;
                        if (this.GameMapType == 4) {
                            var7 = this.FramePosTbl2[0][this.GameMapType][1] + 30 - 8;
                            var1 = 0;

                            while(true) {
                                if (var1 >= 2) {
                                    break label1889;
                                }

                                var6 = this.FramePosTbl2[var1][this.GameMapType][0] + (this.MapWTBL[this.GameMapType] * this.MapB1TBL[this.GameMapType] - 88) / 2;
                                this.drawWinG(var6, var7 - 10, 88, 100 + this.fontH + 20);
                                this.setColor(65535);
                                if (var1 == 0) {
                                    this.drawImage(this.nImg[19], var6 + 32 + 14, var7 + 10 - 10 - 12 + this.subCur * 25);
                                    var4 = this.subCur;
                                    if (this.GameSelectType == 1 && this.mode2 == 16) {
                                        this.setClip(var6 + 5, var7 - 8 + this.subCur * 25, 16, 16);
                                        this.drawImage(this.iGem[6], var6 + 5 - 144 - this.mode2time / 2 / 4 % this.PuyoTbl[0] * 16, var7 - 8 + this.subCur * 25);
                                        this.setClip(0, 0, 240, 240);
                                    }
                                } else {
                                    if (this.btSubCmd < 0 || this.btSubCmd > 4) {
                                        this.btSubCmd = 2;
                                    }

                                    this.drawImage(this.nImg[19], var6, var7 + 10 - 10 - 12 + this.btSubCmd * 25);
                                    var4 = this.btSubCmd;
                                    if (this.btRecvCmd == 2) {
                                        this.setLevel = 2;
                                    }

                                    if (this.setLevel == 2) {
                                        this.setClip(var6 + 5 + 32 + 14 + 18, var7 - 8 + this.btSubCmd * 25, 16, 16);
                                        this.drawImage(this.iGem[6], var6 + 5 + 32 + 18 + 14 - 144 - this.mode2time / 2 / 4 % 8 * 16, var7 - 8 + this.btSubCmd * 25);
                                        this.setClip(0, 0, 240, 240);
                                    }
                                }

                                this.setColor(16777215);
                                this.drawString2C(var6 + 44, var7 + 10 - 10, 16777215, 4210752, this.titleMenuSTR2[0][3][0]);
                                this.drawString2C(var6 + 44, var7 + 10 - 10 + 25, 16777215, 4210752, this.titleMenuSTR2[0][3][1]);
                                this.drawString2C(var6 + 44, var7 + 10 - 10 + 50, 16777215, 4210752, this.titleMenuSTR2[0][3][2]);
                                this.drawString2C(var6 + 44, var7 + 10 - 10 + 75, 16777215, 4210752, this.titleMenuSTR2[0][3][3]);
                                this.drawString2C(var6 + 44, var7 + 10 - 10 + 100, 16777215, 4210752, this.titleMenuSTR2[0][3][4]);
                                this.drawWinG(var6, var7 - 10 + 100 + this.fontH + 20 + 16, 88, this.fontH * 2 + 8);
                                this.setColor(16777215);
                                var20 = new String[]{"+2", "+1", " 0", "-1", "-2"};
                                var16 = new String[]{"3", "4", "4", "4", "5"};
                                this.drawString(var6 + 44 - 35, var7 - 10 + 100 + this.fontH + 20 + 20, this.titleMenuSTR2[0][3][6] + var20[var4]);
                                this.drawString(var6 + 44 - 35, var7 - 10 + 100 + this.fontH + 20 + 20 + this.fontH, this.titleMenuSTR2[0][3][5] + var16[var4]);
                                ++var1;
                            }
                        } else {
                            var7 = this.FramePosTbl2[0][this.GameMapType][1] + 40;
                            this.drawWinG(var6, var7 - 10, 88, 93);
                            if (this.GameSelectType == 0) {
                                this.setClip(var6 + 2, var7 + 10 - 8 + this.subCur * 25, 16, 16);
                                this.drawImage(this.iGem[0], var6 + 2, var7 + 10 - 8 + this.subCur * 25);
                                this.setClip(var6 + 2 + 84 - 16, var7 + 10 - 8 + this.subCur * 25, 16, 16);
                                this.drawImage(this.iGem[0], var6 + 2 + 84 - 16, var7 + 10 - 8 + this.subCur * 25);
                                this.setClip(0, 0, 240, 240);
                                this.setColor(16777215);
                                this.drawStringC(var6 + 44, var7 + 10, "EASY");
                                this.drawStringC(var6 + 44, var7 + 10 + 25, "NORMAL");
                                this.drawStringC(var6 + 44, var7 + 10 + 50, "HARD");
                                this.drawWinG(var6, var7 - 10 + 93 + 16, 88, this.fontH * 2 + 16);
                                this.setColor(16777215);
                                var20 = new String[]{"0", "20000", "50000"};
                                var16 = new String[]{"0", "5", "10"};
                                this.drawString(var6 + 44 - 35, var7 - 10 + 93 + 16 + 8, "SCORE+" + var20[this.subCur]);
                                this.drawString(var6 + 44 - 35, var7 - 10 + 93 + 16 + 8 + this.fontH, "LEVEL " + var16[this.subCur]);
                            } else {
                                this.setColor(16776960);
                                this.drawImage(this.nImg[19], var6 + 32 + 14, var7 + 10 - 12 + this.subCur * 25);
                                this.setColor(16777215);
                                this.drawString2C(var6 + 44, var7 + 10, 16777215, 4210752, this.titleMenuSTR2[0][3][1]);
                                this.drawString2C(var6 + 44, var7 + 10 + 25, 16777215, 4210752, this.titleMenuSTR2[0][3][2]);
                                this.drawString2C(var6 + 44, var7 + 10 + 50, 16777215, 4210752, this.titleMenuSTR2[0][3][3]);
                                this.drawWinG(var6, var7 - 10 + 93 + 16, 88, this.fontH + 16);
                                this.setColor(16777215);
                                var20 = new String[]{"3", "4", "5"};
                                this.drawStringC(var6 + 44, var7 - 10 + 93 + 16 + 8 + 4, this.titleMenuSTR2[0][3][5] + var20[this.subCur]);
                            }
                            break;
                        }
                    case 6:
                        if (this.GameSelectType == 0) {
                            this.setColor(0);
                            if (this.mode2time < 20) {
                                var5 = this.mode2time * 2;
                            } else {
                                var5 = 40;
                            }

                            this.fillRect(0, 120 - var5 / 2, 240, 1 + var5);
                            this.setClip(0, 120 - var5 / 2, 240, 1 + var5);
                            this.drawImage(this.nImg[16], 69, 109);
                            this.setClip(169, 109, 10, 26);
                            if (this.GameStageNo == 9) {
                                this.drawImage(this.nImg[17], 159, 109);
                                this.setClip(179, 109, 10, 26);
                                this.drawImage(this.nImg[17], 179, 109);
                            } else {
                                this.drawImage(this.nImg[17], 169 - (this.GameStageNo + 1) * 10, 109);
                            }
                        } else {
                            this.drawImage(this.nImg[16], 56, 107);
                            this.setClip(170, 107, 22, 26);
                            if (this.GameStageNo == 9) {
                                this.drawImage(this.nImg[17], 148, 107);
                                this.setClip(192, 107, 22, 26);
                                this.drawImage(this.nImg[17], 192, 107);
                            } else {
                                this.drawImage(this.nImg[17], 170 - (this.GameStageNo + 1) * 22, 107);
                            }
                        }
                        break;
                    case 12:
                        this.drawHiScore(this.rank_in);
                    }
                }
            }

            if (this.GameMapType == 1 || this.GameMapType == 4) {
                this.setClip(0, 0, 240, 240);
                this.setColor(0);
                this.fillRect(208, 2, 30, 8);
                this.setClip(0, 0, 240, 240);
                this.drawImage(this.nImg[22 + (this.mode2time / 2 / 4 & 1)], 216, 2);
                this.drawImage(this.nImg[24 + (this.mode2time / 2 / 4 & 1)], 208, 2);
                this.drawImage(this.nImg[24 + (this.mode2time / 2 / 4 + 1 & 1)], 230, 2);
            }

        }
    }

    void drawMap1P(int var1, int var2, boolean var3) {
        int var10 = this.MapB1TBL[this.GameMapType];
        int var8;
        int var9;
        Graphics var11;
        if (var3) {
            var8 = 0;
            var9 = 0;
            var11 = this.nImg[1 + var1].getGraphics();
            this.pushGraphics(var11, 0, 0);
            this.drawImage(this.nImg[0], -this.FramePosTbl2[var1][this.GameMapType][0], -this.FramePosTbl2[var1][this.GameMapType][1]);
        } else {
            var8 = this.FramePosTbl2[var1][this.GameMapType][0];
            var9 = this.FramePosTbl2[var1][this.GameMapType][1];
        }

        int var6 = var8;
        int var4;
        int var5;
        int var7;
        if (var2 == 0) {
            for(var4 = 1; var4 < 7; ++var4) {
                var7 = var9;

                for(var5 = 0; var5 < this.MapHTBL[this.GameMapType]; ++var5) {
                    if (this.play_map[var1][var4 + (var5 + this.MapTOPTBL[this.GameMapType]) * 16] != 0) {
                        if (this.play_map[var1][var4 + var5] >= 7 && this.play_map[var1][var4 + var5] <= '\n') {
                            this.setClip(var6, var7 + this.offy_map[var1][var4 + (var5 + this.MapTOPTBL[this.GameMapType]) * 16], 16, 16);
                            this.drawImage(this.iGem[this.play_map[var1][var4 + (var5 + this.MapTOPTBL[this.GameMapType]) * 16] - 1], var6 - this.mode2time / 2 % 4 * this.MapB1TBL[this.GameMapType], var7 + this.offy_map[var1][var4 + (var5 + this.MapTOPTBL[this.GameMapType]) * 16]);
                        } else {
                            this.setClip(var6, var7 + this.offy_map[var1][var4 + (var5 + this.MapTOPTBL[this.GameMapType]) * 16], 16, 16);
                            this.drawImage(this.iGem[this.play_map[var1][var4 + (var5 + this.MapTOPTBL[this.GameMapType]) * 16] - 1], var6, var7 + this.offy_map[var1][var4 + (var5 + this.MapTOPTBL[this.GameMapType]) * 16]);
                        }
                    }

                    var7 += var10;
                }

                var6 += var10;
            }
        } else {
            boolean var18 = true;
            if (this.play_stat[var1][0] == 48 || this.play_stat[var1][0] == 69 || this.play_stat[var1][0] == 49) {
                var18 = false;
            }

            for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                var7 = var9;
                int var13 = var4 + this.MapTOPTBL[this.GameMapType] * 16;

                for(var5 = 0; var5 < this.MapHTBL[this.GameMapType]; ++var5) {
                    if (this.play_map[var1][var13] != 0) {
                        int var12 = this.offy_map[var1][var13] * var10 >> 4;
                        this.setClip(var6, var7 + var12, var10, var10);
                        if (this.offy_map[var1][var13] != 0 && var18) {
                            if (this.offy_map[var1][var13] < 0) {
                                this.drawImage(this.iGem[this.play_map[var1][var13] - 1], var6, var7 + var12);
                            } else if (this.GameMapType == 6) {
                                this.drawImage(this.iGem[this.play_map[var1][var13] - 1], var6, var7);
                            } else {
                                int var15 = var10 / this.offy_map[var1][var13] - 1;
                                int var14 = var10 - var15;
                                int var17 = 0;

                                for(int var16 = 0; var16 < this.offy_map[var1][var13]; ++var16) {
                                    this.setClip(var6, var7 + var14, var10, var15);
                                    this.drawImage(this.iGem[this.play_map[var1][var13] - 1], var6, var7 + var17);
                                    var14 -= var15;
                                    ++var17;
                                }
                            }
                        } else if (!var18) {
                            this.setClip(var6, var7, var10, var10);
                            if (this.GameMapType == 7) {
                                this.drawImage(this.iGem[this.play_map[var1][var13] - 1], var6 - this.link_map[var1][var13] * var10 % 240, var7 - this.link_map[var1][var13] * var10 / 240 * 24);
                            } else {
                                this.drawImage(this.iGem[this.play_map[var1][var13] - 1], var6 - this.link_map[var1][var13] * var10, var7);
                            }
                        } else if (this.GameMapType == 7) {
                            this.drawImage(this.iGem[this.play_map[var1][var13] - 1], var6 - this.link_map[var1][var13] * var10 % 240, var7 + var12 - this.link_map[var1][var13] * var10 / 240 * 24);
                        } else {
                            this.drawImage(this.iGem[this.play_map[var1][var13] - 1], var6 - this.link_map[var1][var13] * var10, var7 + var12);
                        }
                    }

                    var7 += var10;
                    var13 += 16;
                }

                var6 += var10;
            }
        }

        if (var3) {
            this.popGraphics();
            var11 = null;
        }

    }

    boolean chkMapHit(int var1, int[] var2) {
        int var3 = var2[2] >> 4;
        int var4 = (var2[3] >> 4) + 1;
        if (var2[15] == 0) {
            if (this.play_map[var1][var4 * 16 + var3] != 0) {
                return true;
            }
        } else {
            if (var2[7] == 2) {
                if (var4 >= 23) {
                    return true;
                }

                if (this.play_map[var1][var4 * 16 + var3 + 16] != 0) {
                    return true;
                }

                return false;
            }

            if (this.play_map[var1][var4 * 16 + var3] != 0) {
                return true;
            }

            if (var2[7] == 1 && this.play_map[var1][var4 * 16 + var3 + 1] != 0) {
                return true;
            }

            if (var2[7] == 3 && this.play_map[var1][var4 * 16 + var3 - 1] != 0) {
                return true;
            }
        }

        return false;
    }

    boolean chkMapHit_LR(int var1, int[] var2, int var3) {
        int var4 = (var2[2] >> 4) + var3;
        int var5 = var2[3] + 15 >> 4;
        return this.play_map[var1][var5 * 16 + var4] != 0;
    }

    boolean chkMapClr(int var1, int[] var2, char[] var3, char[] var4, char[] var5) {
        boolean var6 = false;
        boolean var11 = false;
        var2[11] = 0;
        int var7;
        int var8;
        int var10;
        int var10002;
        if (var2[15] == 0) {
            for(var7 = this.MapTOPTBL[this.GameMapType] * 16; var7 < 368; ++var7) {
                this.clr_map[var7] = 0;
            }

            var2[1] &= -257;
            var2[1] &= -16385;
            char var9;
            if (var2[13] == 0) {
                if (this.player_num == 2) {
                    var7 = (var2[2] >> 4) + (var2[3] >> 4) * 16;
                    if (var2[32] == 8) {
                        var2[1] |= 256;
                        var2[1] |= 1024;
                        var6 = true;
                        this.clr_map[var7 - 32] = 255;
                        this.clr_map[var7 - 16] = 255;
                        this.clr_map[var7] = 255;
                        var2[1] |= 16384;
                        var2[73] = 0;

                        for(var8 = 0; var8 < 3 && var3[353 - var8 * 16] == 11; ++var8) {
                            for(int var15 = 1; var15 < 7; ++var15) {
                                this.clr_map[var15 + 352 - var8 * 16] = 255;
                            }

                            var2[1] |= 128;
                            var10002 = var2[73]++;
                        }

                        if (var8 == 0) {
                            for(var8 = 1; var8 < this.MapWTBL[this.GameMapType] + 1; ++var8) {
                                if (var3[var8 + 352] != 0) {
                                    this.clr_map[var8 + 352] = 255;
                                }
                            }
                        }
                    } else if (var2[32] == 9) {
                        var2[1] |= 256;
                        var2[1] |= 1024;
                        var6 = true;
                        this.clr_map[var7 - 32] = 255;
                        this.clr_map[var7 - 16] = 255;
                        this.clr_map[var7] = 255;
                        var2[1] |= 128;
                        var2[73] = 2;
                    } else if (var2[32] == 10) {
                        var9 = var3[var7 + 16];
                        var6 = true;
                        var2[1] |= 256;
                        var2[1] |= 1024;
                        if (var9 != 255 && var9 <= 6) {
                            for(var8 = this.MapTOPTBL[this.GameMapType] * 16; var8 < 368; ++var8) {
                                if (var3[var8] == var9) {
                                    this.clr_map[var8] = 255;
                                }
                            }
                        } else {
                            var11 = true;
                            var2[10] += 10000;
                        }

                        this.clr_map[var7 - 32] = 255;
                        this.clr_map[var7 - 16] = 255;
                        this.clr_map[var7] = 255;
                    }

                    if (var6) {
                        if (var7 < this.MapTOPTBL[this.GameMapType] * 16) {
                            var3[var7] = 0;
                            this.clr_map[var7] = 0;
                        }

                        if (var7 - 32 < this.MapTOPTBL[this.GameMapType] * 16) {
                            var3[var7 - 32] = 0;
                            this.clr_map[var7 - 32] = 0;
                        }

                        if (var7 - 16 < this.MapTOPTBL[this.GameMapType] * 16) {
                            var3[var7 - 16] = 0;
                            this.clr_map[var7 - 16] = 0;
                        }
                    }
                } else {
                    for(var7 = this.MapTOPTBL[this.GameMapType] * 16; var7 < 368; ++var7) {
                        if (var3[var7] == 7) {
                            var9 = var3[var7 + 16];
                            this.clr_map[var7] = 255;
                            var6 = true;
                            if (var9 != 127 && var9 != 7) {
                                for(var8 = this.MapTOPTBL[this.GameMapType] * 16; var8 < 368; ++var8) {
                                    if (var3[var8] == var9) {
                                        this.clr_map[var8] = 255;
                                    }
                                }
                            } else if (var9 == 127) {
                                var2[11] += 10000;
                            }
                        }
                    }
                }
            }

            for(var10 = this.MapTOPTBL[this.GameMapType] * 16; var10 < 368; ++var10) {
                if (var3[var10] >= 1 && var3[var10] <= 7) {
                    var9 = var3[var10];
                    char[] var10000;
                    if ((this.clr_map[var10] & 1) == 0 && var9 == var3[var10 + 1] && var9 == var3[var10 + 2]) {
                        var6 = true;
                        var10000 = this.clr_map;
                        var10000[var10] = (char)(var10000[var10] | 129);

                        for(var7 = 1; var7 < 8 && var9 == var3[var10 + var7]; ++var7) {
                            var10000 = this.clr_map;
                            var10000[var10 + var7] = (char)(var10000[var10 + var7] | 129);
                        }
                    }

                    if ((this.clr_map[var10] & 2) == 0 && var9 == var3[var10 + 16] && var9 == var3[var10 + 32]) {
                        var6 = true;
                        var10000 = this.clr_map;
                        var10000[var10] = (char)(var10000[var10] | 130);

                        for(var7 = 16; var7 < 272 && var9 == var3[var10 + var7]; var7 += 16) {
                            var10000 = this.clr_map;
                            var10000[var10 + var7] = (char)(var10000[var10 + var7] | 130);
                        }
                    }

                    if ((this.clr_map[var10] & 4) == 0 && var9 == var3[var10 + 17] && var9 == var3[var10 + 34]) {
                        var6 = true;
                        var10000 = this.clr_map;
                        var10000[var10] = (char)(var10000[var10] | 132);

                        for(var7 = 17; var7 < 272 && var9 == var3[var10 + var7]; var7 += 17) {
                            var10000 = this.clr_map;
                            var10000[var10 + var7] = (char)(var10000[var10 + var7] | 132);
                        }
                    }

                    if ((this.clr_map[var10] & 8) == 0 && var9 == var3[var10 + 15] && var9 == var3[var10 + 30]) {
                        var6 = true;
                        var10000 = this.clr_map;
                        var10000[var10] = (char)(var10000[var10] | 136);

                        for(var7 = 15; var7 < 272 && var9 == var3[var10 + var7]; var7 += 15) {
                            var10000 = this.clr_map;
                            var10000[var10 + var7] = (char)(var10000[var10 + var7] | 136);
                        }
                    }
                }
            }
        } else {
            for(var7 = this.MapTOPTBL[this.GameMapType] * 16; var7 < 368; ++var7) {
                this.clr_map[var7] = 0;
                var5[var7] = 0;
            }

            for(var10 = this.MapTOPTBL[this.GameMapType] * 16; var10 < 368; ++var10) {
                if (var3[var10] >= 1 && var3[var10] <= 5 && this.clr_map[var10] == 0) {
                    this.clr_pos[0] = var10;
                    var7 = this.chkMapClr_SUB(var10, var3, this.clr_map, 1);
                    if (var7 < 4) {
                        for(var8 = 0; var8 < var7; ++var8) {
                            var5[this.clr_pos[var8]] = this.clr_map[this.clr_pos[var8]];
                            this.clr_map[this.clr_pos[var8]] = 127;
                        }
                    } else {
                        for(var8 = 0; var8 < var7; ++var8) {
                            var5[this.clr_pos[var8]] = this.clr_map[this.clr_pos[var8]];
                            this.clr_map[this.clr_pos[var8]] = 255;
                        }

                        var6 = true;
                    }
                }
            }
        }

        if (var6) {
            var10002 = var2[13]++;
            var2[22] = 0;
            if (var2[30] < var2[13]) {
                var2[30] = var2[13];
            }

            if (this.GameSelectType == 0) {
                for(var7 = this.MapTOPTBL[this.GameMapType] * 16; var7 < 368; ++var7) {
                    if ((this.clr_map[var7] & 128) == 128) {
                        var4[var2[22] * 2] = var3[var7];
                        var4[var2[22] * 2 + 1] = (char)(var7 - this.MapTOPTBL[this.GameMapType] * 16);
                        var3[var7] = 0;
                        var10002 = var2[22]++;
                    }
                }

                var2[20] += var2[22];
                if (var2[20] > 99999) {
                    var2[20] = 99999;
                }

                if (this.GameMapType != 0) {
                    var2[14] = var2[20] / 50 + 0;
                } else {
                    var2[14] = var2[20] / 50 + var2[100] * 5;
                }

                if (var2[14] > 999) {
                    var2[14] = 999;
                }

                if (this.GameMapType == 0) {
                    var2[28] -= var2[22];
                } else {
                    var2[108] = var2[28];
                    if (var11) {
                        var2[1] |= 4096;
                        var2[28] -= 250;
                    }

                    if ((var2[1] & 1024) == 0) {
                        var2[1] |= 4096;
                        var2[28] -= var2[22] * this.colMagicPowTbl[1] + var2[13] * this.colMagicPowTbl[0];
                    } else if (var2[32] == 10) {
                        var2[28] -= (var2[22] - 3) * this.colMagicPowTbl[1] + var2[13] * this.colMagicPowTbl[0];
                        if (var2[22] > 3) {
                            var2[1] |= 4096;
                        }
                    }
                }

                if (var2[28] < 0) {
                    var2[28] = 0;
                }

                byte var16;
                if (var2[22] == 3) {
                    var16 = 1;
                } else {
                    var16 = 2;
                }

                var2[11] += 30 * (var2[14] + 1) * var2[13] * var16;
                var2[10] += var2[11];
            } else {
                int[] var12 = new int[]{0, 0, 0, 0, 0, 0, 0};

                for(var7 = this.MapTOPTBL[this.GameMapType] * 16; var7 < 368; ++var7) {
                    if ((this.clr_map[var7] & 128) == 128) {
                        if (var3[var7] <= 6) {
                            ++var12[var3[var7]];
                        }

                        var4[var2[22] * 2] = var3[var7];
                        var4[var2[22] * 2 + 1] = (char)(var7 - this.MapTOPTBL[this.GameMapType] * 16);
                        var3[var7] = 0;
                        var10002 = var2[22]++;
                        if (var3[var7 - 1] == 6) {
                            var4[var2[22] * 2] = 6;
                            var4[var2[22] * 2 + 1] = (char)(var7 - 1 - this.MapTOPTBL[this.GameMapType] * 16);
                            var3[var7 - 1] = 0;
                            var10002 = var2[22]++;
                        }

                        if (var3[var7 + 1] == 6) {
                            var4[var2[22] * 2] = 6;
                            var4[var2[22] * 2 + 1] = (char)(var7 + 1 - this.MapTOPTBL[this.GameMapType] * 16);
                            var3[var7 + 1] = 0;
                            var10002 = var2[22]++;
                        }

                        if (var3[var7 - 16] == 6) {
                            var4[var2[22] * 2] = 6;
                            var4[var2[22] * 2 + 1] = (char)(var7 - 16 - this.MapTOPTBL[this.GameMapType] * 16);
                            var3[var7 - 16] = 0;
                            var10002 = var2[22]++;
                        }

                        if (var3[var7 + 16] == 6) {
                            var4[var2[22] * 2] = 6;
                            var4[var2[22] * 2 + 1] = (char)(var7 + 16 - this.MapTOPTBL[this.GameMapType] * 16);
                            var3[var7 + 16] = 0;
                            var10002 = var2[22]++;
                        }
                    }
                }

                var2[107] = 0;

                for(var7 = 1; var7 < 7; ++var7) {
                    if (var12[var7] > var2[107]) {
                        var2[107] = var12[var7];
                    }
                }

                var2[20] += var2[22];
                if (var2[20] > 99999) {
                    var2[20] = 99999;
                }

                var2[14] = var2[20] / 50 + 0;
                if (var2[14] > 999) {
                    var2[14] = 999;
                }

                var2[11] += var2[22] * (var2[22] - 3) * 10;
                var2[11] += (var2[13] - 1) * 300;
                var2[10] += var2[11];
                if (this.player_num == 2) {
                    int var13 = var2[22] - 3 + (var2[13] - 1) * 4;
                    if (this.GameMapType == 4) {
                        int[] var14 = new int[]{15, 10, 9, 8, 7};
                        var13 = var13 * var14[var2[100]] / 10;
                    } else if (var1 == 0) {
                        var13 = var13 * 9 / 10;
                    }

                    var2[65] += var13;
                    var2[68] += var13;
                    var2[75] = var13;
                }
            }

            var2[26] = var2[11];
        }

        return var6;
    }

    int chkMapClr_SUB(int var1, char[] var2, char[] var3, int var4) {
        char var5 = var2[var1];
        if (var2[var1 + 1] == var5 && (var3[var1 + 1] & 4) == 0) {
            this.clr_pos[var4++] = var1 + 1;
            var3[var1] = (char)(var3[var1] | 1);
            var3[var1 + 1] = (char)(var3[var1 + 1] | 4);
            var4 = this.chkMapClr_SUB(var1 + 1, var2, var3, var4);
        }

        if (var2[var1 + 16] == var5 && (var3[var1 + 16] & 8) == 0) {
            this.clr_pos[var4++] = var1 + 16;
            var3[var1 + 16] = (char)(var3[var1 + 16] | 8);
            var3[var1] = (char)(var3[var1] | 2);
            var4 = this.chkMapClr_SUB(var1 + 16, var2, var3, var4);
        }

        if (var2[var1 - 1] == var5 && (var3[var1 - 1] & 1) == 0) {
            this.clr_pos[var4++] = var1 - 1;
            var3[var1] = (char)(var3[var1] | 4);
            var3[var1 - 1] = (char)(var3[var1 - 1] | 1);
            var4 = this.chkMapClr_SUB(var1 - 1, var2, var3, var4);
        }

        if (var2[var1 - 16] == var5 && var1 - 16 >= 16 * this.MapTOPTBL[this.GameMapType] && (var3[var1 - 16] & 2) == 0) {
            this.clr_pos[var4++] = var1 - 16;
            var3[var1 - 16] = (char)(var3[var1 - 16] | 2);
            var3[var1] = (char)(var3[var1] | 8);
            var4 = this.chkMapClr_SUB(var1 - 16, var2, var3, var4);
        }

        return var4;
    }

    int setHiScore(int var1) {
        boolean var2 = false;
        boolean var3 = false;
        int var9 = -1;
        byte var11 = 40;
        short var10;
        switch(var1) {
        case 0:
            var10 = 128;
            break;
        case 2:
            var10 = 256;
            break;
        default:
            return var9;
        }

        int var8;
        for(var8 = 0; var8 < 5; ++var8) {
            int var4 = this.SaveData[var10 + var8 * 8] << 24 & -16777216 | this.SaveData[var10 + var8 * 8 + 1] << 16 & 16711680 | this.SaveData[var10 + var8 * 8 + 2] << 8 & '?' | this.SaveData[var10 + var8 * 8 + 3] & 255;
            int var5 = this.SaveData[var10 + var8 * 8 + 4] << 24 & -16777216 | this.SaveData[var10 + var8 * 8 + 5] << 16 & 16711680 | this.SaveData[var10 + var8 * 8 + 6] << 8 & '?' | this.SaveData[var10 + var8 * 8 + 7] & 255;
            if (var5 < this.play_stat[0][25] || var5 == this.play_stat[0][25] && var4 < this.play_stat[0][10]) {
                break;
            }
        }

        if (var8 != 5) {
            for(int var6 = 4; var8 <= var6; --var6) {
                for(int var7 = 0; var7 < 8; ++var7) {
                    this.SaveData[var10 + var6 * 8 + var7] = this.SaveData[var10 + (var6 - 1) * 8 + var7];
                }

                this.SaveData[var10 + var11 + var6 * 4] = this.SaveData[var10 + var11 + (var6 - 1) * 4];
                this.SaveData[var10 + var11 + var6 * 4 + 1] = this.SaveData[var10 + var11 + (var6 - 1) * 4 + 1];
                this.SaveData[var10 + var11 + var6 * 4 + 2] = this.SaveData[var10 + var11 + (var6 - 1) * 4 + 2];
                this.SaveData[var10 + var11 + var6 * 4 + 3] = this.SaveData[var10 + var11 + (var6 - 1) * 4 + 3];
                this.SaveData[var10 + var11 + 32 + var6 * 2] = this.SaveData[var10 + var11 + 32 + (var6 - 1) * 2];
                this.SaveData[var10 + var11 + 32 + var6 * 2 + 1] = this.SaveData[var10 + var11 + 32 + (var6 - 1) * 2 + 1];
                this.SaveData[var10 + var11 + 48 + var6 * 2] = this.SaveData[var10 + var11 + 48 + (var6 - 1) * 2];
                this.SaveData[var10 + var11 + 48 + var6 * 2 + 1] = this.SaveData[var10 + var11 + 48 + (var6 - 1) * 2 + 1];
            }

            this.SaveData[var10 + var8 * 8 + 0] = (byte)(this.play_stat[0][10] >> 24 & 255);
            this.SaveData[var10 + var8 * 8 + 1] = (byte)(this.play_stat[0][10] >> 16 & 255);
            this.SaveData[var10 + var8 * 8 + 2] = (byte)(this.play_stat[0][10] >> 8 & 255);
            this.SaveData[var10 + var8 * 8 + 3] = (byte)(this.play_stat[0][10] & 255);
            this.SaveData[var10 + var8 * 8 + 4] = (byte)(this.play_stat[0][25] >> 24 & 255);
            this.SaveData[var10 + var8 * 8 + 5] = (byte)(this.play_stat[0][25] >> 16 & 255);
            this.SaveData[var10 + var8 * 8 + 6] = (byte)(this.play_stat[0][25] >> 8 & 255);
            this.SaveData[var10 + var8 * 8 + 7] = (byte)(this.play_stat[0][25] & 255);
            this.SaveData[var10 + var11 + var8 * 4 + 0] = (byte)(this.play_stat[0][20] >> 24 & 255);
            this.SaveData[var10 + var11 + var8 * 4 + 1] = (byte)(this.play_stat[0][20] >> 16 & 255);
            this.SaveData[var10 + var11 + var8 * 4 + 2] = (byte)(this.play_stat[0][20] >> 8 & 255);
            this.SaveData[var10 + var11 + var8 * 4 + 3] = (byte)(this.play_stat[0][20] & 255);
            this.SaveData[var10 + var11 + 32 + var8 * 2 + 0] = (byte)(this.play_stat[0][30] >> 8 & 255);
            this.SaveData[var10 + var11 + 32 + var8 * 2 + 1] = (byte)(this.play_stat[0][30] & 255);
            this.SaveData[var10 + var11 + 48 + var8 * 2 + 0] = (byte)(this.play_stat[0][14] >> 8 & 255);
            this.SaveData[var10 + var11 + 48 + var8 * 2 + 1] = (byte)(this.play_stat[0][14] & 255);
            this.writeRS(0, this.SaveData);
            var9 = var8;
        }

        return var9;
    }

    void drawWinG(int var1, int var2, int var3, int var4) {
        var4 = var4 / 8 * 8;

        for(int var5 = 0; var5 < var3; var5 += 8) {
            this.setClip(var1 + var5, var2 - 8, 8, 8);
            this.drawImage(this.nImg[33], var1 + var5 - 8, var2 - 8);
            this.setClip(var1 + var5, var2 + var4, 8, 8);
            this.drawImage(this.nImg[33], var1 + var5 - 8, var2 + var4 - 16);
        }

        for(int var6 = 0; var6 < var4; var6 += 8) {
            this.setClip(var1 - 8, var2 + var6, 8, 8);
            this.drawImage(this.nImg[33], var1 - 8, var2 + var6 - 8);
            this.setClip(var1 + var3, var2 + var6, 8, 8);
            this.drawImage(this.nImg[33], var1 + var3 - 16, var2 + var6 - 8);
        }

        this.setClip(var1 - 8, var2 - 8, 8, 8);
        this.drawImage(this.nImg[33], var1 - 8, var2 - 8);
        this.setClip(var1 + var3, var2 - 8, 8, 8);
        this.drawImage(this.nImg[33], var1 + var3 - 16, var2 - 8);
        this.setClip(var1 - 8, var2 + var4, 8, 8);
        this.drawImage(this.nImg[33], var1 - 8, var2 + var4 - 16);
        this.setClip(var1 + var3, var2 + var4, 8, 8);
        this.drawImage(this.nImg[33], var1 + var3 - 16, var2 + var4 - 16);
        this.setClip(0, 0, 240, 240);
        if (this.GameSelectType == 0) {
            this.setColor(4259840);
        } else {
            this.setColor(16751686);
        }

        this.fillRect(var1, var2, var3, var4);
    }

    void comcom_main() {
        byte var1 = 1;
        this.now_key[var1] = 0L;
        this.push_key[var1] = 0L;
        if (this.GameSelectType == 0) {
            this.com_func00(this.play_map[var1], this.clr_map, this.play_stat[var1]);
        } else {
            this.com_func10(this.play_map[var1], this.clr_map, this.play_stat[var1]);
        }

    }

    void com_sub01(char[] var1, int[] var2) {
        var2[121] = 384;
        var2[122] = 0;

        for(int var3 = 1; var3 < this.MapWTBL[this.GameMapType] + 1; ++var3) {
            int var4;
            for(var4 = 16 * this.MapTOPTBL[this.GameMapType]; var4 < 368; var4 += 16) {
                if (var1[var3 + var4] != 0) {
                    if (var2[121] > var4) {
                        var2[121] = var4;
                        var2[122] = var3;
                    }
                    break;
                }
            }

            var2[80 + var3] = (char)(var4 - 16);
        }

    }

    void com_sub00(char[] var1, char[] var2, int[] var3) {
        var3[123] = 0;
        var3[124] = 0;
        boolean var8 = false;
        boolean var9 = false;
        var3[113] = 0;
        var3[114] = 0;

        for(int var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
            if (var3[80 + var4] >= 16 * this.MapTOPTBL[this.GameMapType]) {
                for(int var10 = 0; var10 < 3; ++var10) {
                    int var15 = 0;
                    int var16 = 0;
                    var1[var4 + var3[80 + var4]] = (char)var3[32 + var10 % 3];
                    var1[var4 + var3[80 + var4] - 16] = (char)var3[32 + (var10 + 1) % 3];
                    var1[var4 + var3[80 + var4] - 32] = (char)var3[32 + (var10 + 2) % 3];

                    for(int var5 = 0; var5 < 3; ++var5) {
                        boolean var14 = false;
                        int var11 = var4 + var3[80 + var4] - var5 * 16;
                        char var6 = var1[var11];
                        int var7 = 1;
                        int var13 = var11;

                        int var12;
                        for(var12 = 1; var12 < 16 && var6 == var1[var11 + var12]; ++var12) {
                            ++var7;
                        }

                        for(var12 = 1; var12 < 16 && var6 == var1[var11 - var12]; ++var12) {
                            ++var7;
                            var13 = var11 - var12;
                        }

                        var16 += var7 - 1;
                        if (var7 >= 3) {
                            var15 += var7 - 1;
                            var14 = true;

                            for(var12 = 0; var12 < var7; ++var12) {
                                var2[var13 + var12] = (char)(var2[var13 + var12] | 1 << var10);
                            }
                        }

                        var7 = 1;
                        var13 = var11;

                        for(var12 = 16; var12 < 272 && var6 == var1[var11 + var12]; var12 += 16) {
                            ++var7;
                        }

                        for(var12 = 16; var12 < 272 && var11 - var12 >= 16 * this.MapTOPTBL[this.GameMapType] && var6 == var1[var11 - var12]; var12 += 16) {
                            ++var7;
                            var13 = var11 - var12;
                        }

                        var16 += var7 - 1;
                        if (var7 >= 3) {
                            var15 += var7 - 1;
                            var14 = true;

                            for(var12 = 0; var12 < var7; ++var12) {
                                var2[var13 + var12 * 16] = (char)(var2[var13 + var12 * 16] | 1 << var10);
                            }
                        }

                        var7 = 1;
                        var13 = var11;

                        for(var12 = 17; var12 < 272 && var6 == var1[var11 + var12]; var12 += 17) {
                            ++var7;
                        }

                        for(var12 = 17; var12 < 272 && var11 - var12 >= 16 * this.MapTOPTBL[this.GameMapType] && var6 == var1[var11 - var12]; var12 += 17) {
                            ++var7;
                            var13 = var11 - var12;
                        }

                        var16 += var7 - 1;
                        if (var7 >= 3) {
                            var15 += var7 - 1;
                            var14 = true;

                            for(var12 = 0; var12 < var7; ++var12) {
                                var2[var13 + var12 * 17] = (char)(var2[var13 + var12 * 17] | 1 << var10);
                            }
                        }

                        var7 = 1;
                        var13 = var11;

                        for(var12 = 15; var12 < 272 && var6 == var1[var11 + var12]; var12 += 15) {
                            ++var7;
                        }

                        for(var12 = 15; var12 < 272 && var11 - var12 >= 16 * this.MapTOPTBL[this.GameMapType] && var6 == var1[var11 - var12]; var12 += 15) {
                            ++var7;
                            var13 = var11 - var12;
                        }

                        var16 += var7 - 1;
                        if (var7 >= 3) {
                            var15 += var7 - 1;
                            var14 = true;

                            for(var12 = 0; var12 < var7; ++var12) {
                                var2[var13 + var12 * 15] = (char)(var2[var13 + var12 * 15] | 1 << var10);
                            }
                        }

                        if (var14) {
                            ++var15;
                        }
                    }

                    if (var16 >= var3[124] && (var16 > var3[124] || var3[80 + var3[116]] < var3[80 + var4])) {
                        var3[124] = var16;
                        var3[115] = var10;
                        var3[116] = var4;
                    }

                    if (var15 >= var3[123] && (var15 > var3[123] || var3[80 + var3[114]] < var3[80 + var4])) {
                        var3[123] = var15;
                        var3[113] = var10;
                        var3[114] = var4;
                    }
                }

                var1[var4 + var3[80 + var4]] = 0;
                var1[var4 + var3[80 + var4] - 16] = 0;
                var1[var4 + var3[80 + var4] - 32] = 0;
            }
        }

    }

    void com_func00(char[] var1, char[] var2, int[] var3) {
        byte var4 = 1;
        int var5;
        switch(var3[112]) {
        case 0:
            this.com_sub01(var1, var3);
            var3[117] = this.ComLevelTbl[this.GameStageNo][0] + this.MapTOPTBL[this.GameMapType];
            var3[118] = this.ComLevelTbl[this.GameStageNo][1];
            var3[119] = this.ComLevelTbl[this.GameStageNo][7];
            if (var3[32] >= 7) {
                var3[112] = 3;
            } else {
                this.com_sub00(var1, var2, var3);
                if (this.ComLevelTbl[this.GameStageNo][3] < this.game_time / 3600) {
                    var3[112] = 2;
                } else {
                    if (this.ComLevelTbl2[this.GameStageNo][4] > var3[121] / 16 - this.MapTOPTBL[this.GameMapType]) {
                    }

                    if (var3[123] == 0 && var3[124] == 0) {
                        var3[112] = 2;
                    } else {
                        switch(this.ComLevelTbl[this.GameStageNo][2]) {
                        case 0:
                        case 1:
                            if (var3[123] == 0) {
                                var3[113] = var3[115];
                                var3[114] = var3[116];
                            }

                            if (this.rand(10) >= this.ComLevelTbl[this.GameStageNo][6]) {
                                var3[112] = 1;
                            } else {
                                var3[112] = 2;
                            }

                            return;
                        default:
                            if (this.rand(10) >= this.ComLevelTbl[this.GameStageNo][6]) {
                                var3[112] = 1;
                                var3[113] = var3[115];
                                var3[114] = var3[116];
                            } else {
                                var3[112] = 2;
                            }
                        }
                    }
                }
            }
            break;
        case 1:
            if (var3[119] <= 0) {
                if (var3[118] > 0) {
                    var3[118] -= 2;
                } else {
                    if (var3[2] >> 4 != var3[114]) {
                        var3[118] = this.ComLevelTbl[this.GameStageNo][1];
                        if (var3[2] >> 4 > var3[114]) {
                            this.push_key[var4] = this.keyTbl[14];
                        } else {
                            this.push_key[var4] = this.keyTbl[15];
                        }
                    } else if (var3[113] != 0) {
                        var3[118] = this.ComLevelTbl[this.GameStageNo][1];
                        int var10002 = var3[113]--;
                        this.push_key[var4] = this.keyTbl[10];
                    } else if (var3[117] <= var3[3] >> 4) {
                        this.push_key[var4] = this.keyTbl[16];
                    }

                    this.now_key[var4] = this.push_key[var4];
                }
            } else {
                var3[119] -= 2;
            }
            break;
        case 2:
            for(var5 = 1; var5 < this.MapWTBL[this.GameMapType] + 1; ++var5) {
                if (var3[80 + var5] >= var3[124]) {
                    var3[123] = var5;
                    var3[124] = var3[80 + var5];
                }
            }

            var3[112] = 1;
            var3[113] = this.rand(10);
            var3[114] = var3[123];
            break;
        case 3:
            boolean var7 = false;
            byte var8;
            if (this.ComLevelTbl2[this.GameStageNo][4] > var3[121] / 16 - this.MapTOPTBL[this.GameMapType]) {
                var8 = 3;
            } else {
                var8 = 0;
            }

            var5 = 0;

            int var6;
            for(var6 = 0; var6 < 3 && this.rand(100) >= this.ComLevelTbl[this.GameStageNo][8 + var6 + var8] + var5; ++var6) {
                var5 += this.ComLevelTbl[this.GameStageNo][8 + var6 + var8];
            }

            if (var6 == 3) {
                var6 = this.rand(3);
            }

            switch(var6) {
            case 0:
                var3[113] = 1;
                var3[114] = var3[2] >> 4;
                var5 = 1;

                for(; var5 < this.MapWTBL[this.GameMapType] + 1; ++var5) {
                    if (var3[80 + var5] >= var3[124]) {
                        var3[123] = var5;
                        var3[124] = var3[80 + var5];
                    }
                }

                var3[114] = var3[123];
                break;
            case 1:
                var3[113] = 0;
                var3[114] = var3[2] >> 4;
                break;
            case 2:
                var3[113] = 2;
                var3[114] = var3[2] >> 4;
            }

            var3[112] = 1;
        }

    }

    int chkMapClr_SUB3(int var1, char[] var2, char[] var3, int var4) {
        char var5 = var2[var1];
        if (var2[var1 + 1] == var5 && (var3[var1 + 1] & 4) == 0) {
            this.clr_pos2[var4++] = var1 + 1;
            var3[var1] = (char)(var3[var1] | 1);
            var3[var1 + 1] = (char)(var3[var1 + 1] | 4);
            var4 = this.chkMapClr_SUB3(var1 + 1, var2, var3, var4);
        }

        if (var2[var1 - 16] == var5 && var1 - 16 >= 16 * this.MapTOPTBL[this.GameMapType] && (var3[var1 - 16] & 2) == 0) {
            this.clr_pos2[var4++] = var1 - 16;
            var3[var1 + 16] = (char)(var3[var1 + 16] | 2);
            var3[var1] = (char)(var3[var1] | 8);
            var4 = this.chkMapClr_SUB3(var1 - 16, var2, var3, var4);
        }

        if (var2[var1 + 16] == var5 && (var3[var1 + 16] & 8) == 0) {
            this.clr_pos2[var4++] = var1 + 16;
            var3[var1 + 16] = (char)(var3[var1 + 16] | 8);
            var3[var1] = (char)(var3[var1] | 2);
            var4 = this.chkMapClr_SUB3(var1 + 16, var2, var3, var4);
        }

        if (var2[var1 - 1] == var5 && (var3[var1 - 1] & 1) == 0) {
            this.clr_pos2[var4++] = var1 - 1;
            var3[var1] = (char)(var3[var1] | 4);
            var3[var1 - 1] = (char)(var3[var1 - 1] | 1);
            var4 = this.chkMapClr_SUB3(var1 - 1, var2, var3, var4);
        }

        return var4;
    }

    void com_sub15(char[] var1, char[] var2, int[] var3, int var4) {
        var3[123] = 0;
        var3[124] = 0;
        var3[125] = 0;
        var3[93] = 0;

        int var12;
        for(var12 = this.MapTOPTBL[this.GameMapType] * 16; var12 < 368; ++var12) {
            var2[var12] = 0;
        }

        var3[113] = 0;
        int var16 = 0;
        int var5;
        int var17;
        byte var18;
        if ((var4 & 32) != 0) {
            var5 = this.MapWTBL[this.GameMapType];
            var17 = 0;
            var18 = -1;
        } else {
            var5 = 1;
            var17 = this.MapWTBL[this.GameMapType] + 1;
            var18 = 1;
        }

        for(var3[114] = var5; var5 != var17; var5 += var18) {
            if (((var4 & 1) == 0 || var5 > 4) && ((var4 & 512) == 0 || var5 > 5) && ((var4 & 128) == 0 || var5 < 5) && ((var4 & 16) == 0 || var5 < 3) && ((var4 & 256) == 0 || var5 < 2) && ((var4 & 64) == 0 || var5 > 2 && var5 < 5) && ((var4 & 128) == 0 || var5 > 1 && var5 < 6) && var3[80 + var5] > 16 * this.MapTOPTBL[this.GameMapType]) {
                for(int var11 = 0; var11 < 4; ++var11) {
                    if (((var4 & 2) == 0 || var11 == 0) && (var11 != 1 || var5 < this.MapWTBL[this.GameMapType]) && (var11 != 3 || var5 > 1)) {
                        boolean var10 = false;
                        byte var8 = 1;
                        boolean var9 = false;
                        switch(var11) {
                        case 0:
                            var1[var5 + var3[80 + var5] - 16] = (char)var3[33];
                            var1[var5 + var3[80 + var5]] = (char)var3[32];
                            this.clr_pos[0] = var5 + var3[80 + var5] - 16;
                            break;
                        case 1:
                            var1[var5 + 1 + var3[80 + var5 + 1]] = (char)var3[33];
                            var1[var5 + var3[80 + var5]] = (char)var3[32];
                            this.clr_pos[0] = var5 + 1 + var3[80 + var5 + 1];
                            break;
                        case 2:
                            var1[var5 + var3[80 + var5] - 16] = (char)var3[32];
                            var1[var5 + var3[80 + var5]] = (char)var3[33];
                            this.clr_pos[0] = var5 + var3[80 + var5] - 16;
                            break;
                        case 3:
                            var1[var5 - 1 + var3[80 + var5 - 1]] = (char)var3[33];
                            var1[var5 + var3[80 + var5]] = (char)var3[32];
                            this.clr_pos[0] = var5 - 1 + var3[80 + var5 - 1];
                        }

                        int var20 = this.chkMapClr_SUB(this.clr_pos[0], var1, var2, var8);
                        this.clr_pos[var20] = var5 + var3[80 + var5];
                        int var21 = this.chkMapClr_SUB(var5 + var3[80 + var5], var1, var2, var20 + 1);
                        var21 -= var20;

                        for(var12 = 0; var12 < var20 + var21; ++var12) {
                            var2[this.clr_pos[var12]] = 0;
                        }

                        int var22 = var20 + var21;
                        if (var20 < 4 && var21 < 4) {
                            if (var22 >= var3[124]) {
                                if (var22 > var3[124]) {
                                    var3[124] = var22;
                                    var3[116] = var5;
                                    var3[115] = var11;
                                } else if (var3[33] != var3[32] && (var3[115] & 1) == 0 && (var11 & 1) == 1) {
                                    var3[124] = var22;
                                    var3[116] = var5;
                                    var3[115] = var11;
                                } else if (var3[33] == var3[32] && (var3[115] & 1) == 1 && (var11 & 1) == 0) {
                                    var3[124] = var22;
                                    var3[116] = var5;
                                    var3[115] = var11;
                                } else if (var3[80 + var3[116]] <= var3[80 + var5]) {
                                    var3[124] = var22;
                                    var3[116] = var5;
                                    var3[115] = var11;
                                }
                            }
                        } else {
                            var22 = 0;
                            int var14 = 0;
                            int var15 = 0;
                            int var19;
                            if (var20 >= 4) {
                                var14 += var20;

                                for(var19 = 0; var19 < var20; ++var19) {
                                    if (var1[this.clr_pos[var19] - 1] == 6) {
                                        ++var22;
                                    }

                                    if (var1[this.clr_pos[var19] + 1] == 6) {
                                        ++var22;
                                    }

                                    if (var1[this.clr_pos[var19] + 16] == 6) {
                                        ++var22;
                                    }

                                    if (var1[this.clr_pos[var19] - 16] == 6) {
                                        ++var22;
                                    }
                                }
                            } else {
                                var15 += var20;
                            }

                            if (var21 >= 4) {
                                var14 += var21;

                                for(var19 = var20; var19 < var20 + var21; ++var19) {
                                    if (var1[this.clr_pos[var19] - 1] == 6) {
                                        ++var22;
                                    }

                                    if (var1[this.clr_pos[var19] + 1] == 6) {
                                        ++var22;
                                    }

                                    if (var1[this.clr_pos[var19] + 16] == 6) {
                                        ++var22;
                                    }

                                    if (var1[this.clr_pos[var19] - 16] == 6) {
                                        ++var22;
                                    }
                                }
                            } else {
                                var15 += var20;
                            }

                            if (var3[125] < var22) {
                                var3[125] = var22;
                                var3[126] = var5;
                                var3[127] = var11;
                            }

                            if (var14 <= var3[123] && var3[80 + var3[114]] / 16 > var3[80 + var5] / 16) {
                                if (var14 == var3[123] && var15 > var16) {
                                    var16 = var15;
                                    var3[123] = var14;
                                    var3[114] = var5;
                                    var3[113] = var11;
                                }
                            } else {
                                var3[123] = var14;
                                var3[114] = var5;
                                var3[113] = var11;
                                var16 = var15;
                            }
                        }

                        switch(var11) {
                        case 0:
                        case 2:
                            var1[var5 + var3[80 + var5] - 16] = 0;
                            break;
                        case 1:
                            var1[var5 + 1 + var3[80 + var5 + 1]] = 0;
                            break;
                        case 3:
                            var1[var5 - 1 + var3[80 + var5 - 1]] = 0;
                        }

                        var1[var5 + var3[80 + var5]] = 0;
                    }
                }
            }
        }

    }

    void com_sub12(char[] var1, char[] var2, int[] var3, int var4) {
        int var16;
        byte var17;
        int var5;
        if ((var4 & 32) != 0) {
            var5 = this.MapWTBL[this.GameMapType];
            var16 = 0;
            var17 = -1;
        } else {
            var5 = 1;
            var16 = this.MapWTBL[this.GameMapType] + 1;
            var17 = 1;
        }

        var3[123] = 0;
        var3[113] = 0;

        for(var3[114] = var5; var5 != var16; var5 += var17) {
            if (((var4 & 1) == 0 || var5 > 4) && ((var4 & 128) == 0 || var5 < 5) && ((var4 & 16) == 0 || var5 < 3) && ((var4 & 64) == 0 || var5 > 2 && var5 < 5) && ((var4 & 128) == 0 || var5 > 1 && var5 < 6) && var3[80 + var5] > 16 * this.MapTOPTBL[this.GameMapType]) {
                for(int var13 = 0; var13 < 4; ++var13) {
                    int var11 = var13 + 3 & 3;
                    if ((var11 != 1 || var5 < this.MapWTBL[this.GameMapType]) && (var11 != 3 || var5 > 1)) {
                        int var8 = 0;

                        int var12;
                        for(var12 = 1; var12 < 4 && var1[var5 + var3[80 + var5] + 16 * var12] == (char)var3[32]; ++var12) {
                            ++var8;
                        }

                        label111:
                        switch(var11) {
                        case 0:
                        case 2:
                            if (var3[32] == var3[33]) {
                                ++var8;
                            }
                            break;
                        case 1:
                            var12 = 1;

                            while(true) {
                                if (var12 >= 4 || var1[var5 + 1 + var3[80 + var5 + 1] + 16 * var12] != (char)var3[33]) {
                                    break label111;
                                }

                                ++var8;
                                ++var12;
                            }
                        case 3:
                            for(var12 = 1; var12 < 4 && var1[var5 - 1 + var3[80 + var5 - 1] + 16 * var12] == (char)var3[33]; ++var12) {
                                ++var8;
                            }
                        }

                        if (var8 >= var3[123] && (var3[80 + var3[114]] / 16 < var3[80 + var5] / 16 || var8 > var3[123])) {
                            var3[123] = var8;
                            var3[114] = var5;
                            var3[113] = var11;
                        }
                    }
                }
            }
        }

    }

    void com_func10(char[] var1, char[] var2, int[] var3) {
        byte var7 = 1;
        byte var6 = 0;
        int var4;
        switch(var3[112]) {
        case 0:
            this.com_sub01(var1, var3);
            var3[117] = this.ComLevelTbl2[this.GameStageNo][0] + this.MapTOPTBL[this.GameMapType];
            var3[118] = this.ComLevelTbl2[this.GameStageNo][1];
            var3[119] = this.ComLevelTbl2[this.GameStageNo][7];
            var3[123] = 0;
            var3[124] = 0;
            var3[114] = 0;
            if (this.ComLevelTbl2[this.GameStageNo][2] == 9) {
                var3[112] = 2;
            } else if (this.ComLevelTbl2[this.GameStageNo][3] < this.game_time / 3600) {
                var3[112] = 3;
            } else {
                byte var5;
                int var8;
                switch(this.ComLevelTbl2[this.GameStageNo][2]) {
                case 0:
                    var8 = 0;
                    var4 = 1;

                    for(; var4 < 7; ++var4) {
                        if (var3[80 + var4] <= 16 * (this.MapTOPTBL[this.GameMapType] + 8)) {
                            ++var8;
                        }
                    }

                    if (this.ComLevelTbl2[this.GameStageNo][4] > var3[83] / 16 - this.MapTOPTBL[this.GameMapType]) {
                        var8 = 10;
                    }

                    if (var8 >= 2) {
                        this.com_sub15(var1, var2, var3, 0);
                    } else {
                        this.com_sub15(var1, var2, var3, 1);
                        var6 = 1;
                    }
                    break;
                case 1:
                    var8 = 0;

                    for(var4 = 1; var4 < 7; ++var4) {
                        if (var3[80 + var4] <= 16 * (this.MapTOPTBL[this.GameMapType] + 4)) {
                            ++var8;
                        }
                    }

                    if (this.ComLevelTbl2[this.GameStageNo][4] > var3[83] / 16 - this.MapTOPTBL[this.GameMapType]) {
                        var8 = 10;
                    }

                    if (var8 >= 2) {
                        this.com_sub15(var1, var2, var3, 32);
                    } else {
                        this.com_sub15(var1, var2, var3, 1);
                        if (var3[123] >= 5) {
                            var3[112] = 1;
                            var6 = 1;
                        } else {
                            this.com_sub12(var1, var2, var3, 0);
                            var6 = 8;
                        }
                    }
                    break;
                case 2:
                    var5 = 0;
                    if (this.ComLevelTbl2[this.GameStageNo][4] > var3[83] / 16 - this.MapTOPTBL[this.GameMapType]) {
                        var5 = 10;
                    }

                    if (var5 >= 2) {
                        this.com_sub15(var1, var2, var3, 32);
                    } else {
                        this.com_sub15(var1, var2, var3, 128);
                        var6 = 1;
                    }
                    break;
                case 3:
                    var5 = 0;
                    if (this.ComLevelTbl2[this.GameStageNo][4] > var3[83] / 16 - this.MapTOPTBL[this.GameMapType]) {
                        var5 = 10;
                    }

                    if (var5 >= 2) {
                        this.com_sub15(var1, var2, var3, 32);
                    } else {
                        this.com_sub15(var1, var2, var3, 32);
                        var6 = 1;
                    }
                    break;
                case 4:
                    if (this.ComLevelTbl2[this.GameStageNo][4] > var3[83] / 16 - this.MapTOPTBL[this.GameMapType]) {
                        this.com_sub15(var1, var2, var3, 0);
                        var6 = 1;
                    } else {
                        this.com_sub15(var1, var2, var3, 128);
                        if (var3[123] >= 5) {
                            var3[112] = 1;
                            var6 = 1;
                        } else {
                            this.com_sub12(var1, var2, var3, 0);
                            var6 = 8;
                        }
                    }
                    break;
                case 5:
                    if (var3[32] != 2 && var3[33] != 2) {
                        this.com_sub15(var1, var2, var3, 1);
                        break;
                    }

                    this.com_sub15(var1, var2, var3, 16);
                    break;
                case 6:
                    if (this.ComLevelTbl2[this.GameStageNo][4] > var3[83] / 16 - this.MapTOPTBL[this.GameMapType]) {
                        this.com_sub15(var1, var2, var3, 0);
                        var6 = 0;
                    } else {
                        this.com_sub15(var1, var2, var3, 0);
                        var6 = 9;
                    }
                    break;
                case 7:
                    if (var3[32] != 1 && var3[33] != 1) {
                        this.com_sub15(var1, var2, var3, 1);
                        break;
                    }

                    this.com_sub15(var1, var2, var3, 16);
                    break;
                case 8:
                    if (var3[81] / 16 > this.MapTOPTBL[this.GameMapType] - 1 && var3[82] / 16 > this.MapTOPTBL[this.GameMapType] - 3) {
                        this.com_sub15(var1, var2, var3, 256);
                        var6 = 1;
                    } else if (var3[86] / 16 > this.MapTOPTBL[this.GameMapType] - 1 && var3[85] / 16 > this.MapTOPTBL[this.GameMapType] - 3) {
                        this.com_sub15(var1, var2, var3, 544);
                        var6 = 1;
                    } else {
                        this.com_sub15(var1, var2, var3, 0);
                        var6 = 0;
                    }
                }

                if (var6 == 2) {
                    if (var3[123] > 0) {
                        var3[112] = 1;
                    } else if (var3[124] > 0) {
                        var3[114] = var3[116];
                        var3[113] = var3[115];
                        var3[112] = 1;
                    } else {
                        var3[112] = 9;
                    }
                } else if (var6 == 0) {
                    if (var3[125] > 0) {
                        var3[114] = var3[126];
                        var3[113] = var3[127];
                        var3[112] = 1;
                    } else if (var3[123] > 0) {
                        var3[112] = 1;
                    } else if (var3[124] > 0) {
                        var3[114] = var3[116];
                        var3[113] = var3[115];
                        var3[112] = 1;
                    } else {
                        var3[112] = 2;
                    }
                } else if (var6 == 1) {
                    if (var3[125] > 0) {
                        var3[114] = var3[126];
                        var3[113] = var3[127];
                        var3[112] = 1;
                    } else if (var3[123] >= 5) {
                        var3[112] = 1;
                    } else if (var3[124] >= 1) {
                        var3[114] = var3[116];
                        var3[113] = var3[115];
                        var3[112] = 1;
                    } else if (var3[123] > 0) {
                        var3[112] = 1;
                    } else if (var3[124] > 0) {
                        var3[114] = var3[116];
                        var3[113] = var3[115];
                        var3[112] = 1;
                    } else {
                        var3[112] = 2;
                    }
                } else if (var6 == 8) {
                    var3[112] = 1;
                } else if (var3[123] >= 5) {
                    var3[112] = 1;
                } else {
                    var3[112] = var6;
                }
            }
            break;
        case 1:
            if (var3[119] <= 0) {
                if (var3[118] > 0) {
                    var3[118] -= 2;
                } else {
                    if (var3[113] != 0) {
                        var3[118] = this.ComLevelTbl2[this.GameStageNo][1];
                        int var10002 = var3[113]--;
                        this.push_key[var7] = this.keyTbl[10];
                    } else if (var3[2] >> 4 != var3[114]) {
                        var3[118] = this.ComLevelTbl2[this.GameStageNo][1];
                        if (var3[2] >> 4 > var3[114]) {
                            this.push_key[var7] = this.keyTbl[14];
                        } else {
                            this.push_key[var7] = this.keyTbl[15];
                        }
                    } else if (var3[117] <= var3[3] >> 4) {
                        this.push_key[var7] = this.keyTbl[16];
                    }

                    this.now_key[var7] = this.push_key[var7];
                }
            } else {
                var3[119] -= 2;
            }
            break;
        case 2:
        case 3:
            if (this.rand(5) >= 2) {
                var3[114] = 6;

                for(var4 = this.MapWTBL[this.GameMapType]; var4 >= 1; --var4) {
                    if (var3[80 + var4] > var3[124]) {
                        var3[114] = var4;
                        var3[124] = var3[80 + var4];
                    }
                }
            } else {
                var3[114] = 1;

                for(var4 = 1; var4 < this.MapWTBL[this.GameMapType] + 1; ++var4) {
                    if (var3[80 + var4] > var3[124]) {
                        var3[114] = var4;
                        var3[124] = var3[80 + var4];
                    }
                }
            }

            var3[112] = 1;
            if (var3[112] == 3) {
                var3[113] = this.rand(10);
            } else {
                var3[113] = 0;
            }
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        default:
            break;
        case 9:
            var3[114] = 6;

            for(var4 = this.MapWTBL[this.GameMapType]; var4 >= 1; --var4) {
                if (var3[80 + var4] > var3[124]) {
                    var3[114] = var4;
                    var3[124] = var3[80 + var4];
                }
            }

            var3[112] = 1;
            var3[113] = 0;
        }

    }

    void btStop() {
        this.btStat = 0;
        this.btConnectFlg = false;
    }

    void btInit() {
        this.btStat = 0;
        this.btNetType = 0;
        this.btConnectFlg = false;
        this.btNetSeek = 32;
        this.btm = new btMgr(this);

        try {
            this.p_bt = Bluetooth.getInstance();
        } catch (Exception var2) {
        }

        this.btMode2 = 0;
        this.btStat = 0;
        this.btSrvFlg = 2;
        this.btPlayStat = 2;
        this.btRecvExit2T = false;

        for(int var1 = 0; var1 < 16; ++var1) {
            this.btRecvBuf[var1][0] = 0;
        }

    }

    void btConnectSet(int var1) {
        if (var1 != 160 || this.btNetSeek != 0) {
            this.btNetSeek = var1;
        }

    }

    void btConnectON(boolean var1) {
        if (this.btConnectFlg != var1) {
            if (var1) {
                this.btRecvExit = 0;
                this.btRecvExit2 = false;
            }

            this.btErrTime = 0;
            this.btConnectFlg = var1;
            this.btNetTYPE = 21;
            this.btStat = 0;
            if (!var1) {
                this.btStat |= 32;
                if (this.btNetSeek != 0 && (this.btNetSeek < 32 || this.btNetSeek > 34)) {
                    this.btNetSeek = 160;
                }
            }
        }

    }

    void btSendSet(int var1) {
        this.btNetTYPE = var1;
    }

    void btSend2(byte[] var1) {
        if ((this.btFrame & 1) == 0) {
            try {
                this.btm.doSend(var1);
            } catch (Exception var3) {
            }
        }

    }

    void btSend() {
        if (this.btNetTYPE != 0) {
            int var1;
            for(var1 = 0; var1 < 16; ++var1) {
                this.dat_dat_dat[var1] = 0;
            }

            this.dat_dat_dat[0] = (byte)this.btNetTYPE;
            this.dat_dat_dat[1] = (byte)((int)(this.now_key[0] >> 10 & 255L));
            switch(this.btNetTYPE) {
            case 1:
                this.dat_dat_dat[6] = (byte)this.subCur;
                break;
            case 2:
                this.dat_dat_dat[6] = (byte)this.subCur;
                break;
            case 3:
            case 6:
            case 13:
                this.dat_dat_dat[2] = (byte)(this.play_stat[0][24] >> 24 & 255);
                this.dat_dat_dat[3] = (byte)(this.play_stat[0][24] >> 16 & 255);
                this.dat_dat_dat[4] = (byte)(this.play_stat[0][24] >> 8 & 255);
                this.dat_dat_dat[5] = (byte)(this.play_stat[0][24] & 255);
                this.dat_dat_dat[6] = (byte)(this.play_stat[0][2] >> 4 & 7 | (this.play_stat[0][3] >> 4 & 31) << 3);
                this.dat_dat_dat[7] = (byte)this.play_stat[0][0];
                this.dat_dat_dat[8] = (byte)(this.play_stat[0][7] & 3 | (this.play_stat[1][91] & 1 | (this.play_stat[0][91] & 1) << 1) << 2);
                this.dat_dat_dat[9] = (byte)(this.play_stat[0][1] & 255);
                this.dat_dat_dat[10] = (byte)this.play_stat2[0][0];
                this.dat_dat_dat[11] = (byte)(this.play_stat[0][89] >> 24 & 255);
                this.dat_dat_dat[12] = (byte)(this.play_stat[0][89] >> 16 & 255);
                this.dat_dat_dat[13] = (byte)(this.play_stat[0][89] >> 8 & 255);
                this.dat_dat_dat[14] = (byte)(this.play_stat[0][89] & 255);
                this.dat_dat_dat[15] = this.dat_dat_dat[0];
                break;
            case 4:
                this.dat_dat_dat[2] = (byte)(this.play_stat[0][24] >> 24 & 255);
                this.dat_dat_dat[3] = (byte)(this.play_stat[0][24] >> 16 & 255);
                this.dat_dat_dat[4] = (byte)(this.play_stat[0][24] >> 8 & 255);
                this.dat_dat_dat[5] = (byte)(this.play_stat[0][24] & 255);
            case 5:
            case 7:
            case 8:
            case 9:
            case 14:
            case 15:
            case 16:
            case 17:
            case 18:
            case 19:
            case 20:
            default:
                break;
            case 10:
                this.dat_dat_dat[2] = (byte)(this.play_stat[0][24] >> 24 & 255);
                this.dat_dat_dat[3] = (byte)(this.play_stat[0][24] >> 16 & 255);
                this.dat_dat_dat[4] = (byte)(this.play_stat[0][24] >> 8 & 255);
                this.dat_dat_dat[5] = (byte)(this.play_stat[0][24] & 255);
                this.dat_dat_dat[6] = 0;
                break;
            case 11:
                this.dat_dat_dat[2] = (byte)(this.play_stat[0][24] >> 24 & 255);
                this.dat_dat_dat[3] = (byte)(this.play_stat[0][24] >> 16 & 255);
                this.dat_dat_dat[4] = (byte)(this.play_stat[0][24] >> 8 & 255);
                this.dat_dat_dat[5] = (byte)(this.play_stat[0][24] & 255);
                this.dat_dat_dat[6] = 1;
                break;
            case 12:
                for(var1 = 0; var1 < this.MapHTBL[this.GameMapType] && this.btGetMap[var1] != 0; ++var1) {
                }

                if (var1 == this.MapHTBL[this.GameMapType]) {
                    var1 = 15;
                }

                int var2;
                if (this.btSendMapLine < this.MapHTBL[this.GameMapType]) {
                    var2 = this.btSendMapLine;
                    this.btSendMapLine += 2;
                } else {
                    var2 = this.btRecvMapLine;
                }

                this.dat_dat_dat[2] = (byte)(var2 | var1 << 4 & 240);
                if (var2 != 15) {
                    var1 = (this.MapTOPTBL[this.GameMapType] + var2) * 16;
                    if (var1 < 384) {
                        this.dat_dat_dat[3] = (byte)this.play_map[0][var1 + 1];
                        this.dat_dat_dat[4] = (byte)this.play_map[0][var1 + 2];
                        this.dat_dat_dat[5] = (byte)this.play_map[0][var1 + 3];
                        this.dat_dat_dat[6] = (byte)this.play_map[0][var1 + 4];
                        this.dat_dat_dat[7] = (byte)this.play_map[0][var1 + 5];
                        this.dat_dat_dat[8] = (byte)this.play_map[0][var1 + 6];
                    }

                    var1 = (this.MapTOPTBL[this.GameMapType] + var2 + 1) * 16;
                    if (var1 < 384) {
                        this.dat_dat_dat[9] = (byte)this.play_map[0][var1 + 1];
                        this.dat_dat_dat[10] = (byte)this.play_map[0][var1 + 2];
                        this.dat_dat_dat[11] = (byte)this.play_map[0][var1 + 3];
                        this.dat_dat_dat[12] = (byte)this.play_map[0][var1 + 4];
                        this.dat_dat_dat[13] = (byte)this.play_map[0][var1 + 5];
                        this.dat_dat_dat[14] = (byte)this.play_map[0][var1 + 6];
                    }

                    this.dat_dat_dat[15] = (byte)this.play_stat[0][64];
                }
                break;
            case 21:
                this.dat_dat_dat[2] = 0;
                this.dat_dat_dat[3] = 0;
            }

            try {
                this.btm.doSend(this.dat_dat_dat);
            } catch (Exception var3) {
            }
        }

    }

    void btCleanMessage() {
    }

    void btRecv() {
        if (this.btNetTYPE != 0 && this.btRecvTop != this.btRecvCnt) {
            int var2 = this.btRecvTop2;
            this.btRecvCmd = this.btRecvBuf[var2][0];
            int var5 = this.btRecvBuf[var2][1] & 255;
            var5 <<= 10;
            this.old_key[1] = this.now_key[1];
            this.now_key[1] = (long)var5;
            this.push_key[1] = ~this.old_key[1] & this.now_key[1];
            if (this.btRecvCmd == 12) {
                int var4 = this.btRecvBuf[var2][2] & 15;
                this.btRecvMapLine = (this.btRecvBuf[var2][2] & 240) >> 4;
                if (var4 != 15) {
                    if (this.GameSelectType != 0) {
                        this.play_stat[1][64] = this.btRecvBuf[var2][15];
                    }

                    int var3 = (this.MapTOPTBL[this.GameMapType] + var4) * 16;
                    if (var3 < 384) {
                        this.play_map[1][var3 + 1] = (char)this.btRecvBuf[var2][3];
                        this.play_map[1][var3 + 2] = (char)this.btRecvBuf[var2][4];
                        this.play_map[1][var3 + 3] = (char)this.btRecvBuf[var2][5];
                        this.play_map[1][var3 + 4] = (char)this.btRecvBuf[var2][6];
                        this.play_map[1][var3 + 5] = (char)this.btRecvBuf[var2][7];
                        this.play_map[1][var3 + 6] = (char)this.btRecvBuf[var2][8];
                    }

                    var3 = (this.MapTOPTBL[this.GameMapType] + var4 + 1) * 16;
                    if (var3 < 384) {
                        this.play_map[1][var3 + 1] = (char)this.btRecvBuf[var2][9];
                        this.play_map[1][var3 + 2] = (char)this.btRecvBuf[var2][10];
                        this.play_map[1][var3 + 3] = (char)this.btRecvBuf[var2][11];
                        this.play_map[1][var3 + 4] = (char)this.btRecvBuf[var2][12];
                        this.play_map[1][var3 + 5] = (char)this.btRecvBuf[var2][13];
                        this.play_map[1][var3 + 6] = (char)this.btRecvBuf[var2][14];
                    }

                    this.btGetMap[var4] = 1;
                    this.btGetMap[var4 + 1] = 1;
                }

                return;
            }

            switch(this.btNetTYPE) {
            case 1:
                if (this.btRecvCmd == 1 || this.btRecvCmd == 2) {
                    this.btSubCmd = this.btRecvBuf[var2][6];
                }
                break;
            case 2:
                if (this.btRecvCmd == 1 || this.btRecvCmd == 2) {
                    this.btSubCmd = this.btRecvBuf[var2][6];
                }
                break;
            case 3:
            case 6:
                if (this.btRecvCmd == 3 && this.btRecvBuf[var2][0] == this.btRecvBuf[var2][15]) {
                    this.game_pause2 = false;
                    this.play_stat[1][101] = this.btRecvBuf[var2][2] << 24 & -16777216 | this.btRecvBuf[var2][3] << 16 & 16711680 | this.btRecvBuf[var2][4] << 8 & '?' | this.btRecvBuf[var2][5] & 255;
                    this.play_stat[1][102] = (this.btRecvBuf[var2][6] & 7) << 4;
                    this.play_stat[1][103] = (this.btRecvBuf[var2][6] >> 3 & 31) << 4;
                    this.play_stat[1][104] = this.btRecvBuf[var2][7];
                    this.play_stat[1][105] = this.btRecvBuf[var2][8] & 3;
                    this.play_stat[1][88] = this.btRecvBuf[var2][9];
                    this.play_stat2[0][1] = this.btRecvBuf[var2][10];
                    this.play_stat[1][90] = this.btRecvBuf[var2][11] << 24 & -16777216 | this.btRecvBuf[var2][12] << 16 & 16711680 | this.btRecvBuf[var2][13] << 8 & '?' | this.btRecvBuf[var2][14] & 255;
                    this.play_stat[0][92] = this.btRecvBuf[var2][8] >> 2 & 1;
                    this.play_stat[1][92] = this.btRecvBuf[var2][8] >> 3 & 1;
                    if (this.play_stat[1][0] == 32) {
                        if (this.play_stat[1][104] > 32) {
                            this.play_stat[1][101] = this.play_stat[1][90];
                        }
                    } else if (this.play_stat[1][0] == 69) {
                        this.play_stat[1][101] = this.play_stat[1][90] + 1;
                    } else if (this.play_stat[1][101] < this.play_stat[1][90] + 1) {
                        this.play_stat[1][101] = this.play_stat[1][90] + 1;
                    }
                }

                if (this.btRecvCmd == 6) {
                    this.game_pause2 = true;
                }
            case 4:
            case 7:
            case 8:
            case 9:
            case 12:
            case 13:
            case 14:
            case 15:
            case 16:
            case 17:
            case 18:
            case 19:
            case 20:
            case 21:
            default:
                break;
            case 5:
            case 10:
            case 11:
                this.btSubCmd = this.btRecvBuf[var2][6];
            }

            this.btRecvBuf[var2][0] = -1;
            this.btRecvBuf[var2][15] = -1;
            this.btErrTime = 0;
        } else {
            if (this.btNetTYPE != 3 && this.btNetTYPE != 6 && this.btNetTYPE != 0) {
                this.btErrTime += 2;
                if (this.btErrTime > 240) {
                    this.btStat |= 288;
                }
            }

            this.btRecvCmd = 0;
            byte var1 = 0;
            this.old_key[1] = this.now_key[1];
            this.now_key[1] = (long)var1;
            this.push_key[1] = ~this.old_key[1] & this.now_key[1];
        }

    }

    void btConnect() {
        if ((this.btStat & 16) != 0 && this.btNetSeek == 9) {
            if (this.btRecvTop == this.btRecvCnt) {
                this.btErrTime += 2;
                if (this.btErrTime > 300) {
                    this.btStat |= 288;
                    this.btStat &= -17;
                    this.btErrTime = 0;
                }
            } else {
                this.btErrTime = 0;
            }

            if (this.m_pnt.m_bPause || this.p_chk) {
                this.btStat |= 32;
            }
        } else {
            this.btErrTime = 0;
        }

        int var1;
        byte[] var3;
        switch(this.btNetSeek) {
        case 0:
        case 3:
        case 8:
        default:
            break;
        case 1:
        case 11:
            try {
                this.btSrvFlg = 1;
                this.btStat = 0;
                if (this.btNetSeek == 11) {
                    this.btNetSeek = 12;
                } else {
                    this.btNetSeek = 2;
                }

                this.btRandSeed = this.rand(127);
                this.btSeekStop = false;
                this.btRecvExit2T = false;

                for(var1 = 0; var1 < 16; ++var1) {
                    this.btRecvBuf[var1][0] = 0;
                }

                if (this.btNetSeek == 12) {
                    this.m_dev = this.p_bt.searchAndSelectDevice();
                } else {
                    this.m_dev = this.p_bt.selectDevice();
                }

                if (this.m_dev != null) {
                    this.btNetSeek = 3;
                } else {
                    this.btNetSeek = 255;
                }
            } catch (Exception var10) {
                this.btNetSeek = 255;
            }
            break;
        case 2:
            try {
                if (this.btm.m_dev != null) {
                    switch(this.btm.registerDevice(this.btm.m_dev, true)) {
                    case -1:
                        this.btNetSeek = 255;
                        return;
                    case 1:
                        this.btNetSeek = 5;
                    }
                } else {
                    this.btNetSeek = 255;
                }
            } catch (Exception var4) {
                this.btNetSeek = 255;
            }
            break;
        case 4:
            this.btNetSeek = 2;
            this.btm.registerDevice2(this.m_dev, true);
            break;
        case 5:
            if ((this.btStat & 32) != 0) {
                this.btNetSeek = 255;
            }
            break;
        case 9:
            var3 = new byte[]{20, 0, (byte)this.GameSelectType, (byte)this.btRandSeed, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            if ((this.btStat & 32) != 0) {
                this.btNetSeek = 255;
            } else {
                if (this.btRecvBuf[this.btRecvTop2][0] == 20) {
                    if (this.btRecvBuf[this.btRecvTop2][2] == 1) {
                        this.btNetSeek = 30;
                        var3[0] = 21;
                    } else if (this.btRecvBuf[this.btRecvTop2][2] == 2) {
                        this.btNetSeek = 31;
                    }

                    if (this.btRecvBuf[this.btRecvTop2][4] == 0) {
                        this.btNetSeek = 31;
                    }
                }

                this.btSend2(var3);
            }
            break;
        case 30:
            var3 = new byte[]{21, 0, (byte)this.GameSelectType, (byte)this.btRandSeed, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            this.btSend2(var3);
            break;
        case 31:
            var3 = new byte[]{20, 0, (byte)this.GameSelectType, (byte)this.btRandSeed, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            this.btSend2(var3);
            this.btNetSeek = 160;
            break;
        case 32:
            try {
                this.btMode2 = 0;
                this.btStat = 0;
                this.btSrvFlg = 2;
                this.btPlayStat = 2;
                this.btRecvExit2T = false;

                for(var1 = 0; var1 < 16; ++var1) {
                    this.btRecvBuf[var1][0] = 0;
                }

                return;
            } catch (Exception var11) {
                this.btNetSeek = 255;
                break;
            }
        case 33:
            try {
                this.btMode2 = 0;
                this.btStat = 0;
                this.btSrvFlg = 2;
                this.btPlayStat = 2;
                this.btRecvExit2T = false;

                for(var1 = 0; var1 < 16; ++var1) {
                    this.btRecvBuf[var1][0] = 0;
                }

                this.m_dev = this.p_bt.selectDevice();
                if (this.m_dev != null) {
                    this.btNetSeek = 43;
                    this.btRecvExit2T = false;
                    this.btm.registerDevice2(this.m_dev, false);
                } else {
                    this.btNetSeek = 255;
                }
            } catch (Exception var8) {
                this.btNetSeek = 255;
            }
            break;
        case 34:
            if ((this.btStat & 32) != 0) {
                this.btNetSeek = 255;
            } else {
                var3 = new byte[]{19, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
                this.btSend2(var3);
                if (this.btRecvBuf[this.btRecvTop2][0] == 20) {
                    this.btGameReq = this.btRecvBuf[this.btRecvTop2][2];
                    this.btRandSeed = this.btRecvBuf[this.btRecvTop2][3];
                    if (this.btRecvBuf[this.btRecvTop2][4] == 1) {
                        this.btNetSeek = 255;
                    }
                }
            }
            break;
        case 35:
        case 36:
            if ((this.btStat & 32) != 0) {
                this.btNetSeek = 255;
            } else {
                var3 = new byte[]{20, 0, (byte)(this.btCur + 1), 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
                this.btSend2(var3);
                if (this.btCur == 0) {
                    this.btNetSeek = 81;
                } else if ((this.btStat & 32) != 0) {
                    this.btNetSeek = 255;
                }
            }
            break;
        case 42:
            try {
                this.btMode2 = 0;
                this.btStat = 0;
                this.btSrvFlg = 2;
                this.btPlayStat = 2;
                this.btRecvExit2T = false;

                for(var1 = 0; var1 < 16; ++var1) {
                    this.btRecvBuf[var1][0] = 0;
                }

                this.m_dev = this.p_bt.scan();
                if (this.m_dev != null) {
                    this.btRecvExit2T = false;
                    this.btNetSeek = 43;
                    this.btm.registerDevice2(this.m_dev, false);
                } else {
                    this.btNetSeek = 255;
                }
            } catch (Exception var9) {
                this.btNetSeek = 255;
            }
            break;
        case 43:
            if (this.btm.m_dev != null) {
                switch(this.btm.registerDevice(this.btm.m_dev, true)) {
                case -1:
                    this.btNetSeek = 255;
                    return;
                case 1:
                    this.btNetSeek = 34;
                }
            } else {
                this.btNetSeek = 255;
            }
            break;
        case 80:
            this.btNetSeek = 32;
            break;
        case 81:
            if ((this.btStat & 32) != 0) {
                this.btNetSeek = 255;
            } else {
                var3 = new byte[]{20, 0, (byte)(this.btCur + 1), 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
                this.btSend2(var3);
                if (this.btRecvBuf[this.btRecvTop2][0] == 21) {
                    this.btNetSeek = 82;
                }
            }
            break;
        case 82:
            if ((this.btStat & 32) != 0) {
                this.btNetSeek = 255;
            }
            break;
        case 96:
            var3 = new byte[]{20, 0, (byte)this.GameSelectType, (byte)this.btRandSeed, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            this.btSend2(var3);
            break;
        case 160:
            try {
                this.btm.doClose2();
            } catch (Exception var7) {
                this.btNetSeekE = 1;
            }

            this.btNetSeek = 161;
            break;
        case 161:
            try {
                if (this.btm.doClose5()) {
                    this.btNetSeek = 162;
                }
            } catch (Exception var6) {
                this.btNetSeekE = 1;
            }
            break;
        case 162:
            try {
                this.btm.doClose3();
                this.btm.doClose4();
            } catch (Exception var5) {
                this.btNetSeekE = 1;
            }

            this.btNetSeek = 163;
            break;
        case 163:
            this.btNetSeek = 0;
            break;
        case 255:
            this.btNetSeek = 160;
        }

    }

    int btDeviceListNum() {
        byte var1 = 0;
        return var1;
    }

    int btRecvChk() {
        byte var1 = 0;
        if (this.btNetTYPE == 2) {
            if (this.btRecvCmd >= 2 && this.btRecvCmd <= 18) {
                var1 = 1;
            }
        } else if (this.btNetTYPE == 3) {
            if (this.btRecvCmd == 3) {
                var1 = 1;
            }

            if (this.btRecvCmd == 6) {
                var1 = 1;
            }
        } else {
            var1 = 1;
        }

        return var1;
    }

    int btConnectChk() {
        if (this.btNetSeek == 5) {
            return 1;
        } else if (this.btNetSeek == 8) {
            return 1;
        } else if (this.btNetSeek == 30) {
            return 1;
        } else if (this.btNetSeek == 31) {
            return 2;
        } else if (this.btNetSeek == 96) {
            return 2;
        } else {
            if (this.btNetSeek == 34) {
                if (this.btRecvBuf[this.btRecvTop2][0] == 20) {
                    return 1;
                }
            } else {
                if (this.btNetSeek == 66) {
                    return 1;
                }

                if (this.btNetSeek == 82) {
                    return 1;
                }

                if (this.btNetSeek == 255) {
                    return 255;
                }
            }

            return 0;
        }
    }

    boolean btExec() {
        boolean var1 = false;
        ++this.btFrame;
        if (this.btConnectFlg) {
            try {
                if ((this.btFrame & 1) == 0) {
                    this.btSend();
                }

                this.btRecv();
            } catch (Exception var3) {
                this.btStat |= 32;
            }
        } else {
            this.btConnect();
        }

        this.btRecvTop = this.btRecvCnt;
        this.btRecvTop2 = this.btRecvTop;
        return var1;
    }

    public String btGetFriendlyName() throws Exception {
        return null;
    }

    public Hashtable btGetDeviceList() {
        return null;
    }

    public Hashtable btGetServiceList() {
        return null;
    }

    public void paint2() {
        Graphics var1 = this.g2;
        this.getKeyData1P();
        if (this.m_pnt.m_bPause) {
            if (this.p_chk) {
                this.m_pnt.m_bPause = false;
            }

            this.p_chk = true;
        } else {
            this.p_chk = false;
        }

        if (this.m_pnt.m_bPause || this.p_chk || this.m_pnt.m_bPauseT > 0) {
            if (this.m_pnt.m_bPauseT > 0) {
                --this.m_pnt.m_bPauseT;
            }

            this.push_key_sys = 0L;
            this.now_key_sys = 0L;
        }

        this.commandAction();
        this.gx.lock();

        try {
            if (!this.readExec(var1)) {
                this.gx = var1;
                this.gx.setFont(this.font);
                if (this.btNetSeek <= 164 && this.btNetSeek >= 160) {
                    this.setColor(0);
                    this.fillRect(0, 0, 240, 240);
                    this.setColor(16777215);
                    this.drawStringC(120, 120, "Bluetooth切断中");
                    this.gx.unlock(true);
                    this.gx.lock();
                }

                if (!this.btExec()) {
                    if (this.btNetSeek <= 164 && this.btNetSeek >= 160) {
                        this.setColor(0);
                        this.fillRect(0, 0, 240, 240);
                        this.setColor(16777215);
                        this.drawStringC(120, 120, "Bluetooth切断中");
                        this.gx.unlock(true);
                        return;
                    }

                    if (this.Mode != this.ModeReq) {
                        System.gc();
                        this.commandSet(0, 6);
                        this.commandSet(1, 6);
                        switch(this.Mode) {
                        case 0:
                        default:
                            break;
                        case 1:
                            this.nImg[0] = null;
                            break;
                        case 16:
                            this.SndStop_ALL();
                            this.Release_Title();
                            break;
                        case 32:
                            this.SndStop_ALL();
                            this.Release_Game();
                        }

                        this.Mode = this.ModeReq;
                        switch(this.Mode) {
                        case 0:
                            this.readFile(0);
                            break;
                        case 1:
                            this.readFile(0);
                            break;
                        case 16:
                            this.readFile(0);
                            break;
                        case 32:
                            this.readFile(0);
                            break;
                        case 256:
                            this.writeRS(0, this.SaveData);
                            this.m_pnt.Exit();
                            return;
                        }
                    } else {
                        this.ModeTime += 2;
                        this.setClip(0, 0, 240, 240);
                        switch(this.Mode) {
                        case 0:
                            this.setModeReq(1);
                            break;
                        case 1:
                            if (this.ModeTime >= 120) {
                                this.setModeReq(16);
                            }

                            this.setColor(16777215);
                            this.fillRect(0, 0, 240, 240);
                            this.drawImageC(this.nImg[0], 120, 120);
                            break;
                        case 16:
                            this.Exec_Title();
                            break;
                        case 32:
                            this.Exec_Game();
                        }
                    }
                }
            }

        } catch (Exception var3) {
            this.btStat |= 32;
        }

        this.gx.unlock(true);
        this.paintMode = false;
    }

    void Soft1Key() {
        if (this.chkKeyPush(17)) {
            if (this.SaveData[16] >= 4) {
                this.SaveData[16] = 0;
            } else if (this.SaveData[16] <= 1) {
                this.SaveData[16] = 2;
            } else {
                this.SaveData[16] = 4;
            }

            this.commandSet(0, 0);
            this.SndSetVol(this.SaveData[16]);
            this.writeRS(0, this.SaveData);
        }

    }

    class MyListener implements MediaListener {
        public void mediaAction(MediaPresenter var1, int var2, int var3) {
            if (var2 == 3 && Module.this.BGMflag) {
                Module.this.setPhrase(0, Module.this.SPhrNo[0]);
                Module.this.soundPlay(0, 0);
            }

        }
    }
}
