xeij/DrawingMode.java (17/48)- Source code ソースコード - XEiJ - STUDIO KAMADA
xeij/DrawingMode.java (17/48)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //HST_XWC

      //================================================================================
      //HST_XWP ($0004,$18xx,$1470)
      //  概要
      //    HST  1024ドット16色1プレーン＞スプライト＞テキスト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (h1p()<=1?(hpc(0)!=0?hpc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(h1p())==0?(hpc(h1p())!=0?hpc(h1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):hpc(tev(h1p())))
      //  中間コード2
      //    h1p()<=1?hpc(0)!=0?hpc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(h1p())==0?hpc(h1p())!=0?hpc(h1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):hpc(tev(h1p()))
      //  中間コード3
      //    (v0=h1p())<=1?(v1=hpc(0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):ls1(v0)==0?(v8=hpc(v0))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):hpc(tev(v0))
      //  中間コード4
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=hpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):hpc(tev(p))
      //  中間コード5
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=hpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):hpc(p&-2)
      //  中間コード6
      //    (p=h1p())<=1?(p=hpc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=hpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):hpo(p&-2)
      HST_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPal32G8[p & -2]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPal32G8[p & -2]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //HST_XWP

      //================================================================================
      //HST_XHCT ($0004,$18xx,$1970)
      //  概要
      //    HST  1024ドット16色1プレーン＞スプライト＞テキスト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(hpc(h1p())!=0?hpc(h1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):hpc(h1p())!=0?hpc(h1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
      //  中間コード3
      //    ls1(hpc(tev(v3=h1p())))!=0?mix(hpc(v3),ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)):(v11=hpc(v3))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14)
      //  中間コード4
      //    ls1(hpc(tev(p=h1p())))!=0?mix(hpc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=hpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード5
      //    (hpc((p=h1p())&-2)&1)!=0?mix(hpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=hpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード6
      //    (hpc((p=h1p())&-2)&1)!=0?cto(mix(hpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=hpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
      HST_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 1]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 2]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 3]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 1]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 2]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 3]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //HST_XHCT

      //================================================================================
      //HST_XHPT ($0004,$18xx,$1D70)
      //  概要
      //    HST  1024ドット16色1プレーン＞スプライト＞テキスト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (h1p()<=1?(hpc(0)!=0?hpc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(h1p())==0?(hpc(h1p())!=0?hpc(h1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):mix(hpc(tev(h1p())),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    h1p()<=1?hpc(0)!=0?hpc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(h1p())==0?hpc(h1p())!=0?hpc(h1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(hpc(tev(h1p())),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))
      //  中間コード3
      //    (v0=h1p())<=1?(v1=hpc(0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):ls1(v0)==0?(v8=hpc(v0))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):mix(hpc(tev(v0)),ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19))
      //  中間コード4
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=hpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):mix(hpc(tev(p)),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q))
      //  中間コード5
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=hpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):mix(hpc(p&-2),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))
      //  中間コード6
      //    (p=h1p())<=1?(p=hpc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=hpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):cto(mix(hpc(p&-2),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)))
      HST_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //HST_XHPT

      //================================================================================
      //IST ($0005,$18xx,$0070)
      //  概要
      //    IST  1024ドット256色1プレーン＞スプライト＞テキスト
      //    拡張なし
      //  手順
      //    1番目のカラーが0でないとき
      //      1番目のカラー
      //    さもなくば(1番目のカラーが0のとき)
      //      スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //        スプライトカラー(0は黒)
      //      さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //        テキストカラー(0は黒)
      //  中間コード1
      //    (ipc(i1p())!=0?ipc(i1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))
      //  中間コード2
      //    ipc(i1p())!=0?ipc(i1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
      //  中間コード3
      //    (v0=ipc(i1p()))!=0?v0:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4)
      //  中間コード4
      //    (p=ipc(i1p()))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード5
      //    (p=ipc(i1p()))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード6
      //    (p=ipc(i1p()))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
      IST {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                   GraphicScreen.graM4[ga])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                       GraphicScreen.graM4[ga + 1])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                       GraphicScreen.graM4[ga + 2])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                       GraphicScreen.graM4[ga + 3])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                       GraphicScreen.graM4[ga + 4])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                       GraphicScreen.graM4[ga + 5])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                       GraphicScreen.graM4[ga + 6])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                       GraphicScreen.graM4[ga + 7])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                     GraphicScreen.graM4[ga])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                   GraphicScreen.graM4[ga])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                       GraphicScreen.graM4[ga + 1])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                       GraphicScreen.graM4[ga + 2])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                       GraphicScreen.graM4[ga + 3])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                       GraphicScreen.graM4[ga + 4])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                       GraphicScreen.graM4[ga + 5])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                       GraphicScreen.graM4[ga + 6])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                       GraphicScreen.graM4[ga + 7])]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                     GraphicScreen.graM4[ga])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //IST

      //================================================================================
      //XIST
      //  概要
      //    IST  1024ドット256色1プレーン＞スプライト＞テキスト
      //    拡張あり
      XIST {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //IST_XWC
          case 0b00010001:  //IST_XWC
          case 0b00010010:  //IST_XWC
          case 0b00010011:  //IST_XWC
            IST_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //IST_XWP
          case 0b00010101:  //IST_XWP
          case 0b00010110:  //IST_XWP
          case 0b00010111:  //IST_XWP
            IST_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //IST_XHC
            IST.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //IST_XHCT
            IST_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //IST_XHPT
            IST_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //IST_A
          case 0b01000001:  //IST_A
          case 0b01000010:  //IST_A
          case 0b01000011:  //IST_A
          case 0b01000100:  //IST_A
          case 0b01000101:  //IST_A
          case 0b01000110:  //IST_A
          case 0b01000111:  //IST_A
          case 0b01001000:  //IST_A
          case 0b01001001:  //IST_A
          case 0b01001010:  //IST_A
          case 0b01001011:  //IST_A
          case 0b01001100:  //IST_A
          case 0b01001101:  //IST_A
          case 0b01001110:  //IST_A
          case 0b01001111:  //IST_A
          case 0b01010000:  //IST_A
          case 0b01010001:  //IST_A
          case 0b01010010:  //IST_A
          case 0b01010011:  //IST_A
          case 0b01010100:  //IST_A
          case 0b01010101:  //IST_A
          case 0b01010110:  //IST_A
          case 0b01010111:  //IST_A
          case 0b01011000:  //IST_A
          case 0b01011001:  //IST_A
          case 0b01011010:  //IST_A
          case 0b01011011:  //IST_A
          case 0b01011100:  //IST_A
          case 0b01011101:  //IST_A
          case 0b01011110:  //IST_A
          case 0b01011111:  //IST_A
            I_A.drawRaster (src, dst, rh);
            break;
          default:
            IST.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XIST);
          }  //switch
        }  //drawRaster
      },  //XIST

      //================================================================================
      //IST_XWC ($0005,$18xx,$1070)
      //  概要
      //    IST  1024ドット256色1プレーン＞スプライト＞テキスト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls1(ipc(tev(i1p())))!=0?ipc(i1p()):(ipc(i1p())!=0?ipc(i1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    ls1(ipc(tev(i1p())))!=0?ipc(i1p()):ipc(i1p())!=0?ipc(i1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
      //  中間コード3
      //    ls1(ipc(tev(v3=i1p())))!=0?ipc(v3):(v5=ipc(v3))!=0?v5:ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)
      //  中間コード4
      //    ls1(ipc(tev(p=i1p())))!=0?ipc(p):(q=ipc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード5
      //    (ipc((p=i1p())&-2)&1)!=0?ipc(p):(q=ipc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード6
      //    (ipc((p=i1p())&-2)&1)!=0?ipo(p):(q=ipc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
      IST_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                    GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                        GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                        GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                        GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                        GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                        GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                        GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                        GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                    GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                        GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                        GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                        GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                        GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                        GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                        GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                        GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //IST_XWC

      //================================================================================
      //IST_XWP ($0005,$18xx,$1470)
      //  概要
      //    IST  1024ドット256色1プレーン＞スプライト＞テキスト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (i1p()<=1?(ipc(0)!=0?ipc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(i1p())==0?(ipc(i1p())!=0?ipc(i1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ipc(tev(i1p())))
      //  中間コード2
      //    i1p()<=1?ipc(0)!=0?ipc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(i1p())==0?ipc(i1p())!=0?ipc(i1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ipc(tev(i1p()))
      //  中間コード3
      //    (v0=i1p())<=1?(v1=ipc(0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):ls1(v0)==0?(v8=ipc(v0))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):ipc(tev(v0))
      //  中間コード4
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=ipc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ipc(tev(p))
      //  中間コード5
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=ipc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):ipc(p&-2)
      //  中間コード6
      //    (p=i1p())<=1?(p=ipc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=ipc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):ipo(p&-2)
      IST_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPal32G8[p & -2]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPal32G8[p & -2]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPal32G8[p & -2]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //IST_XWP

      //================================================================================
      //IST_XHCT ($0005,$18xx,$1970)
      //  概要
      //    IST  1024ドット256色1プレーン＞スプライト＞テキスト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ipc(i1p())!=0?ipc(i1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ipc(i1p())!=0?ipc(i1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
      //  中間コード3
      //    ls1(ipc(tev(v3=i1p())))!=0?mix(ipc(v3),ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)):(v11=ipc(v3))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14)
      //  中間コード4
      //    ls1(ipc(tev(p=i1p())))!=0?mix(ipc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=ipc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード5
      //    (ipc((p=i1p())&-2)&1)!=0?mix(ipc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=ipc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード6
      //    (ipc((p=i1p())&-2)&1)!=0?cto(mix(ipc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=ipc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
      IST_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                    GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                        GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                        GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                        GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                        GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                        GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                        GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                        GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                    GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                        GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                        GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                        GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                        GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                        GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                        GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                        GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //IST_XHCT

      //================================================================================
      //IST_XHPT ($0005,$18xx,$1D70)
      //  概要
      //    IST  1024ドット256色1プレーン＞スプライト＞テキスト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (i1p()<=1?(ipc(0)!=0?ipc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(i1p())==0?(ipc(i1p())!=0?ipc(i1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):mix(ipc(tev(i1p())),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    i1p()<=1?ipc(0)!=0?ipc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(i1p())==0?ipc(i1p())!=0?ipc(i1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(ipc(tev(i1p())),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))
      //  中間コード3
      //    (v0=i1p())<=1?(v1=ipc(0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):ls1(v0)==0?(v8=ipc(v0))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):mix(ipc(tev(v0)),ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19))
      //  中間コード4
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=ipc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):mix(ipc(tev(p)),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q))
      //  中間コード5
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=ipc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):mix(ipc(p&-2),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))
      //  中間コード6
      //    (p=i1p())<=1?(p=ipc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=ipc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):cto(mix(ipc(p&-2),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)))
      IST_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = VideoController.vcnPal16G8[0]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = VideoController.vcnPal16G8[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //IST_XHPT

      //================================================================================
      //JST ($0007,$18xx,$0070)
      //  概要
      //    JST  1024ドット65536色1プレーン＞スプライト＞テキスト
      //    拡張なし
      //  手順
      //    1番目のカラーが0でないとき
      //      1番目のカラー
      //    さもなくば(1番目のカラーが0のとき)
      //      スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //        スプライトカラー(0は黒)
      //      さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //        テキストカラー(0は黒)
      //  中間コード1
      //    (jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))
      //  中間コード2
      //    jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
      //  中間コード3
      //    (v0=jpc(v1=j1p(),v1))!=0?v0:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4)
      //  中間コード4
      //    (p=jpc(q=j1p(),q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード5
      //    (p=jpc(q=j1p(),q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード6
      //    (p=jpc(q=j1p(),q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
      JST {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                          GraphicScreen.graM4[ga])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                              GraphicScreen.graM4[ga + 1])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                              GraphicScreen.graM4[ga + 2])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                              GraphicScreen.graM4[ga + 3])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                              GraphicScreen.graM4[ga + 4])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                              GraphicScreen.graM4[ga + 5])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                              GraphicScreen.graM4[ga + 6])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                              GraphicScreen.graM4[ga + 7])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                            GraphicScreen.graM4[ga])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                          GraphicScreen.graM4[ga])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                              GraphicScreen.graM4[ga + 1])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                              GraphicScreen.graM4[ga + 2])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                              GraphicScreen.graM4[ga + 3])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                              GraphicScreen.graM4[ga + 4])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                              GraphicScreen.graM4[ga + 5])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                              GraphicScreen.graM4[ga + 6])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                              GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                              GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                              GraphicScreen.graM4[ga + 7])) >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                            GraphicScreen.graM4[ga])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //JST

      //================================================================================
      //XJST
      //  概要
      //    JST  1024ドット65536色1プレーン＞スプライト＞テキスト
      //    拡張あり
      XJST {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //JST_XWC
          case 0b00010001:  //JST_XWC
          case 0b00010010:  //JST_XWC
          case 0b00010011:  //JST_XWC
            JST_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //JST_XWP
          case 0b00010101:  //JST_XWP
          case 0b00010110:  //JST_XWP
          case 0b00010111:  //JST_XWP
            JST_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //JST_XHC
            JST.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //JST_XHCT
            JST_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //JST_XHPT
            JST_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //JST_A
          case 0b01000001:  //JST_A
          case 0b01000010:  //JST_A
          case 0b01000011:  //JST_A
          case 0b01000100:  //JST_A
          case 0b01000101:  //JST_A
          case 0b01000110:  //JST_A
          case 0b01000111:  //JST_A
          case 0b01001000:  //JST_A
          case 0b01001001:  //JST_A
          case 0b01001010:  //JST_A
          case 0b01001011:  //JST_A
          case 0b01001100:  //JST_A
          case 0b01001101:  //JST_A
          case 0b01001110:  //JST_A
          case 0b01001111:  //JST_A
          case 0b01010000:  //JST_A
          case 0b01010001:  //JST_A
          case 0b01010010:  //JST_A
          case 0b01010011:  //JST_A
          case 0b01010100:  //JST_A
          case 0b01010101:  //JST_A
          case 0b01010110:  //JST_A
          case 0b01010111:  //JST_A
          case 0b01011000:  //JST_A
          case 0b01011001:  //JST_A
          case 0b01011010:  //JST_A
          case 0b01011011:  //JST_A
          case 0b01011100:  //JST_A
          case 0b01011101:  //JST_A
          case 0b01011110:  //JST_A
          case 0b01011111:  //JST_A
            J_A.drawRaster (src, dst, rh);
            break;
          default:
            JST.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XJST);
          }  //switch
        }  //drawRaster
      },  //XJST

      //================================================================================
      //JST_XWC ($0007,$18xx,$1070)
      //  概要
      //    JST  1024ドット65536色1プレーン＞スプライト＞テキスト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
      //  中間コード3
      //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?jpc(v3,v3):(v5=jpc(v3,v3))!=0?v5:ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)
      //  中間コード4
      //    ls1(jpc(p=tod(q=j1p()),p))!=0?jpc(q,q):(p=jpc(q,q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード5
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpc(q,q):(p=jpc(q,q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード6
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpo(q,q):(p=jpc(q,q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
      JST_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //JST_XWC

      //================================================================================
      //JST_XWP ($0007,$18xx,$1470)
      //  概要
      //    JST  1024ドット65536色1プレーン＞スプライト＞テキスト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):jpc(tev(j1p()),tev(j1p())))
      //  中間コード2
      //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):jpc(tev(j1p()),tev(j1p()))
      //  中間コード3
      //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):ls1(v0)==0?(v8=jpc(v0,v0))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):jpc(v15=tev(v0),v15)
      //  中間コード4
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=jpc(p,p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):jpc(q=tev(p),q)
      //  中間コード5
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=jpc(p,p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):jpc(q=p&-2,q)
      //  中間コード6
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=jpc(p,p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):jpo(q=p&-2,q)
      JST_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //JST_XWP

      //================================================================================
      //JST_XHCT ($0007,$18xx,$1970)
      //  概要
      //    JST  1024ドット65536色1プレーン＞スプライト＞テキスト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
      //  中間コード3
      //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?mix(jpc(v3,v3),ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)):(v11=jpc(v3,v3))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14)
      //  中間コード4
      //    ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(p=jpc(q,q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード5
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(p=jpc(q,q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
      //  中間コード6
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(p=jpc(q,q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
      JST_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //JST_XHCT

      //================================================================================
      //JST_XHPT ($0007,$18xx,$1D70)
      //  概要
      //    JST  1024ドット65536色1プレーン＞スプライト＞テキスト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
      //          スプライトカラー(0は黒)
      //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
      //          テキストカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):mix(jpc(tev(j1p()),tev(j1p())),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
      //  中間コード2
      //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(jpc(tev(j1p()),tev(j1p())),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))
      //  中間コード3
      //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):ls1(v0)==0?(v8=jpc(v0,v0))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):mix(jpc(v16=tev(v0),v16),ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19))
      //  中間コード4
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=jpc(p,p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):mix(jpc(q=tev(p),q),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q))
      //  中間コード5
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=jpc(p,p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):mix(jpc(q=p&-2,q),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))
      //  中間コード6
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=jpc(p,p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):cto(mix(jpc(q=p&-2,q),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)))
      JST_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                  VideoController.vcnPal32TS[p] :
                                  VideoController.vcnPal32TS[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                      VideoController.vcnPal16TS[p] :
                                      VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                            VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                      VideoController.vcnPal32TS[p] :
                                      VideoController.vcnPal32TS[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                          VideoController.vcnPal16TS[p] :
                                          VideoController.vcnPal16TS[q])]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                    VideoController.vcnPal32TS[p] :
                                    VideoController.vcnPal32TS[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                        VideoController.vcnPal16TS[p] :
                                        VideoController.vcnPal16TS[q])]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //JST_XHPT

      //================================================================================
      //SE1T ($0000,$09xx,$0061)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    拡張なし
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        テキストカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp())
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:epc(e1p()):(v6=epc(e1p()))!=0?v6:tpc(txp())
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:epc(e1p()):(p=epc(e1p()))!=0?p:tpc(txp())
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:epc(e1p()):(p=epc(e1p()))!=0?p:tpc(txp())
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):epo(e1p()):(p=epc(e1p()))!=0?cto(p):tpo(txp())
      SE1T {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T

      //================================================================================
      //XSE1T
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    拡張あり
      XSE1T {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SE1T_XWC
          case 0b00010001:  //SE1T_XWC
          case 0b00010010:  //SE1T_XWC
          case 0b00010011:  //SE1T_XWC
            SE1T_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SE1T_XWP
          case 0b00010101:  //SE1T_XWP
          case 0b00010110:  //SE1T_XWP
          case 0b00010111:  //SE1T_XWP
            SE1T_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SE1T_XHC
            SE1T.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SE1T_XHCT
            SE1T_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SE1T_XHCG
            SE1T_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SE1T_XHCGT
            SE1T_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SE1T_XHPT
            SE1T_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SE1T_XHPG
            SE1T_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SE1T_XHPGT
            SE1T_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SE1T_A
          case 0b01000001:  //SE1T_A
          case 0b01000010:  //SE1T_A
          case 0b01000011:  //SE1T_A
          case 0b01000100:  //SE1T_A
          case 0b01000101:  //SE1T_A
          case 0b01000110:  //SE1T_A
          case 0b01000111:  //SE1T_A
          case 0b01001000:  //SE1T_A
          case 0b01001001:  //SE1T_A
          case 0b01001010:  //SE1T_A
          case 0b01001011:  //SE1T_A
          case 0b01001100:  //SE1T_A
          case 0b01001101:  //SE1T_A
          case 0b01001110:  //SE1T_A
          case 0b01001111:  //SE1T_A
          case 0b01010000:  //SE1T_A
          case 0b01010001:  //SE1T_A
          case 0b01010010:  //SE1T_A
          case 0b01010011:  //SE1T_A
          case 0b01010100:  //SE1T_A
          case 0b01010101:  //SE1T_A
          case 0b01010110:  //SE1T_A
          case 0b01010111:  //SE1T_A
          case 0b01011000:  //SE1T_A
          case 0b01011001:  //SE1T_A
          case 0b01011010:  //SE1T_A
          case 0b01011011:  //SE1T_A
          case 0b01011100:  //SE1T_A
          case 0b01011101:  //SE1T_A
          case 0b01011110:  //SE1T_A
          case 0b01011111:  //SE1T_A
            E1_A.drawRaster (src, dst, rh);
            break;
          default:
            SE1T.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSE1T);
          }  //switch
        }  //drawRaster
      },  //XSE1T

      //================================================================================
      //SE1T_XWC ($0000,$09xx,$1061)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls1(epc(tev(e1p())))!=0?epc(e1p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))))
      //  中間コード2
      //    ls1(epc(tev(e1p())))!=0?epc(e1p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp())
      //  中間コード3
      //    ls1(epc(tev(v3=e1p())))!=0?epc(v3):ls4(v6=spp())!=0||v6!=0&&txp()==0?(v8=spc(v6))!=0?v8:epc(v3):(v10=epc(v3))!=0?v10:tpc(txp())
      //  中間コード4
      //    ls1(epc(tev(p=e1p())))!=0?epc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp())
      //  中間コード5
      //    (epc((p=e1p())&-2)&1)!=0?epc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp())
      //  中間コード6
      //    (epc((p=e1p())&-2)&1)!=0?epo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp())
      SE1T_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q, r;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q, r;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XWC

      //================================================================================
      //SE1T_XWP ($0000,$09xx,$1461)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          グラフィックパレット0のカラー(0は黒)
      //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //        グラフィックパレット0のカラーが0でないとき
      //          グラフィックパレット0のカラー
      //        さもなくば(グラフィックパレット0のカラーが0のとき)
      //          テキストカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()<=1?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(0)):(epc(0)!=0?epc(0):tpc(txp()))):ls1(e1p())==0?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):epc(tev(e1p())))
      //  中間コード2
      //    e1p()<=1?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(0):epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())<=1?ls4(v2=spp())!=0||v2!=0&&txp()==0?(v4=spc(v2))!=0?v4:epc(0):(v6=epc(0))!=0?v6:tpc(txp()):ls1(v0)==0?ls4(v11=spp())!=0||v11!=0&&txp()==0?(v13=spc(v11))!=0?v13:epc(v0):(v15=epc(v0))!=0?v15:tpc(txp()):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())<=1?ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):epc(tev(p))
      //  中間コード5
      //    (p=e1p())<=1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):epc(p&-2)
      //  中間コード6
      //    (p=e1p())<=1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):epo(p&-2)
      SE1T_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q, r;
              XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q, r;
              XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    VideoController.vcnPal32G8[p & -2]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XWP

      //================================================================================
      //SE1T_XHCT ($0000,$09xx,$1961)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラーと
      //          テキストカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()))):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):epc(e1p())!=0?epc(e1p()):tpc(txp())
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:ls1(epc(tev(v7=e1p())))!=0?mix(epc(v7),0):epc(v7):ls1(epc(tev(v14=e1p())))!=0?mix(epc(v14),tpc(txp())):(v19=epc(v14))!=0?v19:tpc(txp())
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:ls1(epc(tev(p=e1p())))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e1p())))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(epc((p=e1p())&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e1p())&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp())
      SE1T_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[tp & 15])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XHCT

      //================================================================================
      //SE1T_XHCG ($0000,$09xx,$1A61)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //            テキストカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラーが0でないとき
      //            1番目のカラー
      //          さもなくば(1番目のカラーが0のとき)
      //            テキストカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())))):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp())
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:ls1(v5=epc(tev(v7=e1p())))!=0?mix(v5,epc(tod(e2q()))):ls1(v7)!=0?epc(tod(e2q())):epc(v7):ls1(v18=epc(tev(v20=e1p())))!=0?mix(v18,epc(tod(e2q()))):ls1(v20)!=0?(v26=epc(tod(e2q())))!=0?v26:tpc(txp()):(v31=epc(v20))!=0?v31:tpc(txp())
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?epc(tod(e2q())):epc(q):ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?epc(e2q()|1):epc(q):((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?epo(e2q()|1):epo(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
      SE1T_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            gx2nd += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XHCG

      //================================================================================
      //SE1T_XHCGT ($0000,$09xx,$1B61)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //          テキストカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //            テキストカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラーが0でないとき
      //            1番目のカラー
      //          さもなくば(1番目のカラーが0のとき)
      //            テキストカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())))):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp())
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:ls1(v5=epc(tev(v7=e1p())))!=0?mix(mix(v5,epc(tod(e2q()))),0):ls1(v7)!=0?epc(tod(e2q())):epc(v7):ls1(v19=epc(tev(v21=e1p())))!=0?mix(mix(v19,epc(tod(e2q()))),tpc(txp())):ls1(v21)!=0?(v30=epc(tod(e2q())))!=0?v30:tpc(txp()):(v35=epc(v21))!=0?v35:tpc(txp())
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),0):ls1(q)!=0?epc(tod(e2q())):epc(q):ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),tpc(txp())):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):(q&1)!=0?epc(e2q()|1):epc(q):((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),tpc(txp())):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):(q&1)!=0?epo(e2q()|1):epo(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),tpc(txp()))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
      SE1T_XHCGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            gx2nd += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[q] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp & 15])] :
                                    (q & 1) != 0 ?
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p = VideoController.vcnPal16G8[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XHCGT

      //================================================================================
      //SE1T_XHPT ($0000,$09xx,$1D61)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラーが0でないとき
      //          グラフィックパレット0のカラー
      //        さもなくば(グラフィックパレット0のカラーが0のとき)
      //          テキストカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと
      //          テキストカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))):(e1p()<=1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(epc(tev(e1p())),tpc(txp()))))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0):e1p()<=1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),tpc(txp()))
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())<=1?epc(0):ls1(v4)==0?epc(v4):mix(epc(tev(v4)),0):(v11=e1p())<=1?(v12=epc(0))!=0?v12:tpc(txp()):ls1(v11)==0?(v16=epc(v11))!=0?v16:tpc(txp()):mix(epc(tev(v11)),tpc(txp()))
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(tev(p)),tpc(txp()))
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(p&-2),tpc(txp()))
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0)):(p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(epc(p&-2),tpc(txp())))
      SE1T_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp & 15])]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[tp & 15])]);
              sx += 8;
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XHPT

      //================================================================================
      //SE1T_XHPG ($0000,$09xx,$1E61)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラーが0でないとき
      //          グラフィックパレット0のカラー
      //        さもなくば(グラフィックパレット0のカラーが0のとき)
      //          テキストカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(e1p()<=1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp()))))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):e1p()<=1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())<=1?epc(0):ls1(v4)==0?epc(v4):mix(epc(tev(v4)),epc(tod(e2q()))):(v14=e1p())<=1?(v15=epc(0))!=0?v15:tpc(txp()):ls1(v14)==0?(v19=epc(v14))!=0?v19:tpc(txp()):(v22=mix(epc(tev(v14)),epc(tod(e2q()))))!=0?v22:tpc(txp())
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(txp())
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(txp())
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(txp())
      SE1T_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            gx2nd += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (q = VideoController.vcnMix2 (
                                       VideoController.vcnPal16G8[p & -2],
                                       VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XHPG

      //================================================================================
      //SE1T_XHPGT ($0000,$09xx,$1F61)
      //  概要
      //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラーが0でないとき
      //          グラフィックパレット0のカラー
      //        さもなくば(グラフィックパレット0のカラーが0のとき)
      //          テキストカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //          テキストカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0))):(e1p()<=1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp()))))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):e1p()<=1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp()))
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())<=1?epc(0):ls1(v4)==0?epc(v4):mix(mix(epc(tev(v4)),epc(tod(e2q()))),0):(v15=e1p())<=1?(v16=epc(0))!=0?v16:tpc(txp()):ls1(v15)==0?(v20=epc(v15))!=0?v20:tpc(txp()):mix(mix(epc(tev(v15)),epc(tod(e2q()))),tpc(txp()))
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(txp()))
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp()))
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0)):(p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp())))
      SE1T_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            gx2nd += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp & 15])]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 24 & 15])]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 20 & 15])]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 16 & 15])]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 12 & 15])]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 8 & 15])]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp >>> 4 & 15])]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        VideoController.vcnPal16TS[tp & 15])]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE1T_XHPGT

      //================================================================================
      //SE2T ($0000,$09xx,$0063)
      //  概要
      //    SE2T  スプライト＞512ドット16色2プレーン＞テキスト
      //    拡張なし
      //  手順
      //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが0でないとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが0のとき)
      //          2番目のカラー(0は黒)
      //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //      1番目のパレットが0でないとき
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のカラーが0でないとき
      //          2番目のカラー
      //        さもなくば(2番目のカラーが0のとき)
      //          テキストカラー(0は黒)
      //  中間コード1
      //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):epc(e2p()))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))))
      //  中間コード2
      //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):epc(e2p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(e2p())!=0?epc(e2p()):tpc(txp())
      //  中間コード3
      //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?epc(v4):epc(e2p()):(v8=e1p())!=0?(v9=epc(v8))!=0?v9:tpc(txp()):(v12=epc(e2p()))!=0?v12:tpc(txp())
      //  中間コード4
      //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e2p()))!=0?p:tpc(txp())
      //  中間コード5
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e2p()))!=0?p:tpc(txp())
      //  中間コード6
      //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?epo(p):epo(e2p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e2p()))!=0?cto(p):tpo(txp())
      SE2T {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            gx2nd += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                             ts=1のとき
            int tt = ts + 8;                                             //tt=9
            ts += 16;                                                    //ts=17
            //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              //                                                           ........ ........ .1234567 ________  p0>>tt
              //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
              p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
              p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
              p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
              p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
              int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                        VideoController.VCN_TXP2[p2 >>> 24] |
                        VideoController.VCN_TXP1[p1 >>> 24] |
                        VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q;
              XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 20 & 15]);
              XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 16 & 15]);
              XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 12 & 15]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 8 & 15]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp >>> 4 & 15]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp & 15] :
                                    (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[tp & 15]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //SE2T

      //================================================================================
      //XSE2T
      //  概要
      //    SE2T  スプライト＞512ドット16色2プレーン＞テキスト
      //    拡張あり
      XSE2T {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SE2T_XWC
          case 0b00010001:  //SE2T_XWC
          case 0b00010010:  //SE2T_XWC
          case 0b00010011:  //SE2T_XWC
            SE2T_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SE2T_XWP
          case 0b00010101:  //SE2T_XWP
          case 0b00010110:  //SE2T_XWP
          case 0b00010111:  //SE2T_XWP
            SE2T_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SE2T_XHC
            SE2T.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SE2T_XHCT
            SE2T_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SE2T_XHCG
            SE2T_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SE2T_XHCGT
            SE2T_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SE2T_XHPT
            SE2T_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SE2T_XHPG
            SE2T_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SE2T_XHPGT
            SE2T_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SE2T_A
          case 0b01000001:  //SE2T_A
          case 0b01000010:  //SE2T_A
          case 0b01000011:  //SE2T_A
          case 0b01000100:  //SE2T_A
          case 0b01000101:  //SE2T_A
          case 0b01000110:  //SE2T_A
          case 0b01000111:  //SE2T_A
          case 0b01001000:  //SE2T_A
          case 0b01001001:  //SE2T_A
          case 0b01001010:  //SE2T_A
          case 0b01001011:  //SE2T_A
          case 0b01001100:  //SE2T_A
          case 0b01001101:  //SE2T_A
          case 0b01001110:  //SE2T_A
          case 0b01001111:  //SE2T_A
          case 0b01010000:  //SE2T_A
          case 0b01010001:  //SE2T_A
          case 0b01010010:  //SE2T_A
          case 0b01010011:  //SE2T_A
          case 0b01010100:  //SE2T_A
          case 0b01010101:  //SE2T_A
          case 0b01010110:  //SE2T_A
          case 0b01010111:  //SE2T_A
          case 0b01011000:  //SE2T_A
          case 0b01011001:  //SE2T_A
          case 0b01011010:  //SE2T_A
          case 0b01011011:  //SE2T_A
          case 0b01011100:  //SE2T_A
          case 0b01011101:  //SE2T_A
          case 0b01011110:  //SE2T_A
          case 0b01011111:  //SE2T_A
            E2_A.drawRaster (src, dst, rh);
            break;
          default:
            SE2T.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSE2T);
          }  //switch
        }  //drawRaster
      },  //XSE2T

      //================================================================================
      //SE2T_XWC ($0000,$09xx,$1063)
      //  概要
      //    SE2T  スプライト＞512ドット16色2プレーン＞テキスト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //          スプライトカラーが0でないとき
      //            スプライトカラー
      //          さもなくば(スプライトカラーが0のとき)
      //            1番目のカラー(0は黒)
      //        さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //          1番目のカラーが0でないとき
      //            1番目のカラー
      //          さもなくば(1番目のカラーが0のとき)
      //            テキストカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
      //          スプライトカラーが0でないとき
      //            スプライトカラー
      //          さもなくば(スプライトカラーが0のとき)
      //            2番目のカラー(0は黒)
      //        さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
      //          2番目のカラーが0でないとき
      //            2番目のカラー
      //          さもなくば(2番目のカラーが0のとき)
      //            テキストカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):tpc(txp())))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp()):ls1(epc(tev(e2p())))!=0?epc(e2p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(txp())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):ls4(v6=spp())!=0||v6!=0&&txp()==0?(v8=spc(v6))!=0?v8:epc(v0):(v10=epc(v0))!=0?v10:tpc(txp()):ls1(epc(tev(v16=e2p())))!=0?epc(v16):ls4(v19=spp())!=0||v19!=0&&txp()==0?(v21=spc(v19))!=0?v21:epc(v16):(v23=epc(v16))!=0?v23:tpc(txp())
      //  中間コード4
      //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e2p())))!=0?epc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp())
      //  中間コード5
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e2p())&-2)&1)!=0?epc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp())
      //  中間コード6
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e2p())&-2)&1)!=0?epo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp())
      SE2T_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
          int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
          int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
          int ta1 = 0x00020000 + ta0;
          int ta2 = 0x00040000 + ta0;
          int ta3 = 0x00060000 + ta0;
          int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx1st += half;
            gx2nd += half;
            tc = tc + (half >> 3) & CRTC.crtMask511;
            da += half;
          }
          if (ts == 0) {  //テキスト桁境界に合っているとき
            while (da < db) {
              int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                        VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                        VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                        VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
              tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
              int p, q, r;
              XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[tp >>> 24 & 15]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
STUDIO KAMADA
Copyright © 1999-2026 Makoto Kamada