xeij/DrawingMode.java (11/48)- Source code ソースコード - XEiJ - STUDIO KAMADA
xeij/DrawingMode.java (11/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[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                    VideoController.vcnPal32TS[0]);
                  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] :
                                  VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                      VideoController.vcnPal32TS[0]);
                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] :
                                    VideoController.vcnPal32TS[0]);
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //Jt

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

      //================================================================================
      //Jt_XWP ($0007,$09xx,$1410)
      //  概要
      //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        テキストパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        テキストパレット0のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):tpc(0)):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)):jpc(tev(j1p()),tev(j1p())))
      //  中間コード2
      //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):tpc(0):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0):jpc(tev(j1p()),tev(j1p()))
      //  中間コード3
      //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:tpc(0):ls1(v0)==0?(v4=jpc(v0,v0))!=0?v4:tpc(0):jpc(v7=tev(v0),v7)
      //  中間コード4
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):ls1(p)==0?(q=jpc(p,p))!=0?q:tpc(0):jpc(q=tev(p),q)
      //  中間コード5
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):(p&1)==0?(q=jpc(p,p))!=0?q:tpc(0):jpc(q=p&-2,q)
      //  中間コード6
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):tpo(0):(p&1)==0?(q=jpc(p,p))!=0?cto(q):tpo(0):jpo(q=p&-2,q)
      Jt_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                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] :
                                    VideoController.vcnPal32TS[0] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[0] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  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] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                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] :
                                    VideoController.vcnPal32TS[0] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[0] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //Jt_XWP

      //================================================================================
      //Jt_XHCT ($0007,$09xx,$1910)
      //  概要
      //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        テキストパレット0のカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        テキストパレット0のカラー(0は黒)
      //  中間コード1
      //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),tpc(0)):(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)))
      //  中間コード2
      //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),tpc(0)):jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)
      //  中間コード3
      //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?mix(jpc(v3,v3),tpc(0)):(v7=jpc(v3,v3))!=0?v7:tpc(0)
      //  中間コード4
      //    ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),tpc(0)):(p=jpc(q,q))!=0?p:tpc(0)
      //  中間コード5
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),tpc(0)):(p=jpc(q,q))!=0?p:tpc(0)
      //  中間コード6
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),tpc(0))):(p=jpc(q,q))!=0?cto(p):tpo(0)
      Jt_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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]),
                                      VideoController.vcnPal16TS[0])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                        VideoController.vcnPal16TS[0])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[0]);
                  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]),
                                      VideoController.vcnPal16TS[0])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                          VideoController.vcnPal16TS[0])] :
                                      (p = (VideoController.vcnPal8G16H[q >> 8] |
                                            VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32TS[0]);
                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]),
                                        VideoController.vcnPal16TS[0])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[0]);
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //Jt_XHCT

      //================================================================================
      //Jt_XHPT ($0007,$09xx,$1D10)
      //  概要
      //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        テキストパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        テキストパレット0のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        テキストパレット0のカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):tpc(0)):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)):mix(jpc(tev(j1p()),tev(j1p())),tpc(0)))
      //  中間コード2
      //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):tpc(0):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0):mix(jpc(tev(j1p()),tev(j1p())),tpc(0))
      //  中間コード3
      //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:tpc(0):ls1(v0)==0?(v4=jpc(v0,v0))!=0?v4:tpc(0):mix(jpc(v8=tev(v0),v8),tpc(0))
      //  中間コード4
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):ls1(p)==0?(q=jpc(p,p))!=0?q:tpc(0):mix(jpc(q=tev(p),q),tpc(0))
      //  中間コード5
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):(p&1)==0?(q=jpc(p,p))!=0?q:tpc(0):mix(jpc(q=p&-2,q),tpc(0))
      //  中間コード6
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):tpo(0):(p&1)==0?(q=jpc(p,p))!=0?cto(q):tpo(0):cto(mix(jpc(q=p&-2,q),tpc(0)))
      Jt_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                    VideoController.vcnPal32TS[0] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[0] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[0])]);
                  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] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                      VideoController.vcnPal32TS[0] :
                                      (p & 1) == 0 ?
                                      (q = (VideoController.vcnPal8G16H[p >> 8] |
                                            VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32TS[0] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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] :
                                    VideoController.vcnPal32TS[0] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[0] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[0])]);
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //Jt_XHPT

      //================================================================================
      //Jt_A ($0007,$09xx,$4010)
      //  概要
      //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
      //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
      //  手順
      //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    mix(jpc(j1p(),j1p()),tpc(0))
      //  中間コード2
      //    mix(jpc(j1p(),j1p()),tpc(0))
      //  中間コード3
      //    mix(jpc(v2=j1p(),v2),tpc(0))
      //  中間コード4
      //    mix(jpc(p=j1p(),p),tpc(0))
      //  中間コード5
      //    mix(jpc(p=j1p(),p),tpc(0))
      //  中間コード6
      //    cto(mix(jpc(p=j1p(),p),tpc(0)))
      Jt_A {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
                XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                             GraphicScreen.graM4[ga + 1])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                             GraphicScreen.graM4[ga + 2])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                             GraphicScreen.graM4[ga + 3])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                             GraphicScreen.graM4[ga + 4])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                             GraphicScreen.graM4[ga + 5])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                             GraphicScreen.graM4[ga + 6])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                             GraphicScreen.graM4[ga + 7])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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;
                  XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) >> 8] |
                                         VideoController.vcnPal8G16L[p & 255]),
                                        VideoController.vcnPal16TS[0])]);
                  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;
                XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                             GraphicScreen.graM4[ga + 1])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                             GraphicScreen.graM4[ga + 2])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                             GraphicScreen.graM4[ga + 3])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                             GraphicScreen.graM4[ga + 4])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                             GraphicScreen.graM4[ga + 5])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                             GraphicScreen.graM4[ga + 6])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                             GraphicScreen.graM4[ga + 7])) >> 8] |
                                           VideoController.vcnPal8G16L[p & 255]),
                                          VideoController.vcnPal16TS[0])]);
                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;
                  XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) >> 8] |
                                         VideoController.vcnPal8G16L[p & 255]),
                                        VideoController.vcnPal16TS[0])]);
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //Jt_A

      //================================================================================
      //TE1 ($0000,$06xx,$0021)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    拡張なし
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):epc(e1p()))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):epc(e1p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:epc(e1p())
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:epc(e1p())
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:epc(e1p())
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):epo(e1p())
      TE1 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]);
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1

      //================================================================================
      //XTE1
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    拡張あり
      XTE1 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //TE1_XWC
          case 0b00010001:  //TE1_XWC
          case 0b00010010:  //TE1_XWC
          case 0b00010011:  //TE1_XWC
            TE1_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //TE1_XWP
          case 0b00010101:  //TE1_XWP
          case 0b00010110:  //TE1_XWP
          case 0b00010111:  //TE1_XWP
            TE1_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //TE1_XHC
            TE1.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //TE1_XHCT
            TE1_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //TE1_XHCG
            TE1_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //TE1_XHCGT
            TE1_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //TE1_XHPT
            TE1_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //TE1_XHPG
            TE1_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //TE1_XHPGT
            TE1_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //TE1_A
          case 0b01000001:  //TE1_A
          case 0b01000010:  //TE1_A
          case 0b01000011:  //TE1_A
          case 0b01000100:  //TE1_A
          case 0b01000101:  //TE1_A
          case 0b01000110:  //TE1_A
          case 0b01000111:  //TE1_A
          case 0b01001000:  //TE1_A
          case 0b01001001:  //TE1_A
          case 0b01001010:  //TE1_A
          case 0b01001011:  //TE1_A
          case 0b01001100:  //TE1_A
          case 0b01001101:  //TE1_A
          case 0b01001110:  //TE1_A
          case 0b01001111:  //TE1_A
          case 0b01010000:  //TE1_A
          case 0b01010001:  //TE1_A
          case 0b01010010:  //TE1_A
          case 0b01010011:  //TE1_A
          case 0b01010100:  //TE1_A
          case 0b01010101:  //TE1_A
          case 0b01010110:  //TE1_A
          case 0b01010111:  //TE1_A
          case 0b01011000:  //TE1_A
          case 0b01011001:  //TE1_A
          case 0b01011010:  //TE1_A
          case 0b01011011:  //TE1_A
          case 0b01011100:  //TE1_A
          case 0b01011101:  //TE1_A
          case 0b01011110:  //TE1_A
          case 0b01011111:  //TE1_A
            E1_A.drawRaster (src, dst, rh);
            break;
          default:
            TE1.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XTE1);
          }  //switch
        }  //drawRaster
      },  //XTE1

      //================================================================================
      //TE1_XWC ($0000,$06xx,$1021)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (ls1(epc(tev(e1p())))!=0?epc(e1p()):(tpc(txp())!=0?tpc(txp()):epc(e1p())))
      //  中間コード2
      //    ls1(epc(tev(e1p())))!=0?epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p())
      //  中間コード3
      //    ls1(epc(tev(v3=e1p())))!=0?epc(v3):(v5=tpc(txp()))!=0?v5:epc(v3)
      //  中間コード4
      //    ls1(epc(tev(p=e1p())))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
      //  中間コード5
      //    (epc((p=e1p())&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
      //  中間コード6
      //    (epc((p=e1p())&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p)
      TE1_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              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] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XWC

      //================================================================================
      //TE1_XWP ($0000,$06xx,$1421)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()<=1?(tpc(txp())!=0?tpc(txp()):epc(0)):ls1(e1p())==0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):epc(tev(e1p())))
      //  中間コード2
      //    e1p()<=1?tpc(txp())!=0?tpc(txp()):epc(0):ls1(e1p())==0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())<=1?(v1=tpc(txp()))!=0?v1:epc(0):ls1(v0)==0?(v5=tpc(txp()))!=0?v5:epc(v0):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())<=1?(p=tpc(txp()))!=0?p:epc(0):ls1(p)==0?(q=tpc(txp()))!=0?q:epc(p):epc(tev(p))
      //  中間コード5
      //    (p=e1p())<=1?(p=tpc(txp()))!=0?p:epc(0):(p&1)==0?(q=tpc(txp()))!=0?q:epc(p):epc(p&-2)
      //  中間コード6
      //    (p=e1p())<=1?(p=tpc(txp()))!=0?cto(p):epo(0):(p&1)==0?(q=tpc(txp()))!=0?cto(q):epo(p):epo(p&-2)
      TE1_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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 = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              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 = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XWP

      //================================================================================
      //TE1_XHCT ($0000,$06xx,$1921)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:ls1(epc(tev(v5=e1p())))!=0?mix(epc(v5),0):epc(v5)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:ls1(epc(tev(p=e1p())))!=0?mix(epc(p),0):epc(p)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(epc((p=e1p())&-2)&1)!=0?mix(epc(p),0):epc(p)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
      TE1_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XHCT

      //================================================================================
      //TE1_XHCG ($0000,$06xx,$1A21)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:ls1(v3=epc(tev(v5=e1p())))!=0?mix(v3,epc(tod(e2q()))):ls1(v5)!=0?epc(tod(e2q())):epc(v5)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?epc(tod(e2q())):epc(q)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?epc(e2q()|1):epc(q)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?epo(e2q()|1):epo(q)
      TE1_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((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]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((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]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XHCG

      //================================================================================
      //TE1_XHCGT ($0000,$06xx,$1B21)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:ls1(v3=epc(tev(v5=e1p())))!=0?mix(mix(v3,epc(tod(e2q()))),0):ls1(v5)!=0?epc(tod(e2q())):epc(v5)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),0):ls1(q)!=0?epc(tod(e2q())):epc(q)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):(q&1)!=0?epc(e2q()|1):epc(q)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):(q&1)!=0?epo(e2q()|1):epo(q)
      TE1_XHCGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((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]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((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]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((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]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XHCGT

      //================================================================================
      //TE1_XHPT ($0000,$06xx,$1D21)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0))
      TE1_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (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)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (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)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              gx1st += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XHPT

      //================================================================================
      //TE1_XHPG ($0000,$06xx,$1E21)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q())))
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q())))
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1))
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1)))
      TE1_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (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])]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (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])]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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])]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XHPG

      //================================================================================
      //TE1_XHPGT ($0000,$06xx,$1F21)
      //  概要
      //    TE1  テキスト＞512ドット16色1プレーン
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0))
      TE1_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (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)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (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)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (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)]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE1_XHPGT

      //================================================================================
      //TE2 ($0000,$06xx,$0023)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    拡張なし
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):epc(e2p())))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):epc(e2p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?epc(v2):epc(e2p())
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?epo(p):epo(e2p())
      TE2 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2

      //================================================================================
      //XTE2
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    拡張あり
      XTE2 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //TE2_XWC
          case 0b00010001:  //TE2_XWC
          case 0b00010010:  //TE2_XWC
          case 0b00010011:  //TE2_XWC
            TE2_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //TE2_XWP
          case 0b00010101:  //TE2_XWP
          case 0b00010110:  //TE2_XWP
          case 0b00010111:  //TE2_XWP
            TE2_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //TE2_XHC
            TE2.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //TE2_XHCT
            TE2_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //TE2_XHCG
            TE2_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //TE2_XHCGT
            TE2_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //TE2_XHPT
            TE2_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //TE2_XHPG
            TE2_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //TE2_XHPGT
            TE2_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //TE2_A
          case 0b01000001:  //TE2_A
          case 0b01000010:  //TE2_A
          case 0b01000011:  //TE2_A
          case 0b01000100:  //TE2_A
          case 0b01000101:  //TE2_A
          case 0b01000110:  //TE2_A
          case 0b01000111:  //TE2_A
          case 0b01001000:  //TE2_A
          case 0b01001001:  //TE2_A
          case 0b01001010:  //TE2_A
          case 0b01001011:  //TE2_A
          case 0b01001100:  //TE2_A
          case 0b01001101:  //TE2_A
          case 0b01001110:  //TE2_A
          case 0b01001111:  //TE2_A
          case 0b01010000:  //TE2_A
          case 0b01010001:  //TE2_A
          case 0b01010010:  //TE2_A
          case 0b01010011:  //TE2_A
          case 0b01010100:  //TE2_A
          case 0b01010101:  //TE2_A
          case 0b01010110:  //TE2_A
          case 0b01010111:  //TE2_A
          case 0b01011000:  //TE2_A
          case 0b01011001:  //TE2_A
          case 0b01011010:  //TE2_A
          case 0b01011011:  //TE2_A
          case 0b01011100:  //TE2_A
          case 0b01011101:  //TE2_A
          case 0b01011110:  //TE2_A
          case 0b01011111:  //TE2_A
            E2_A.drawRaster (src, dst, rh);
            break;
          default:
            TE2.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XTE2);
          }  //switch
        }  //drawRaster
      },  //XTE2

      //================================================================================
      //TE2_XWC ($0000,$06xx,$1023)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(tpc(txp())!=0?tpc(txp()):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(tpc(txp())!=0?tpc(txp()):epc(e2p()))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p()):ls1(epc(tev(e2p())))!=0?epc(e2p()):tpc(txp())!=0?tpc(txp()):epc(e2p())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=tpc(txp()))!=0?v5:epc(v0):ls1(epc(tev(v11=e2p())))!=0?epc(v11):(v13=tpc(txp()))!=0?v13:epc(v11)
      //  中間コード4
      //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):ls1(epc(tev(p=e2p())))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
      //  中間コード5
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(epc((p=e2p())&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
      //  中間コード6
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p)
      TE2_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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 = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              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 = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XWC

      //================================================================================
      //TE2_XWP ($0000,$06xx,$1423)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //    1番目のパレットが1のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?(tpc(txp())!=0?tpc(txp()):epc(tev(e2p()))):e1p()==1?(tpc(txp())!=0?tpc(txp()):epc(0)):ls1(e1p())==0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):epc(tev(e1p())))
      //  中間コード2
      //    e1p()==0?tpc(txp())!=0?tpc(txp()):epc(tev(e2p())):e1p()==1?tpc(txp())!=0?tpc(txp()):epc(0):ls1(e1p())==0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())==0?(v1=tpc(txp()))!=0?v1:epc(tev(e2p())):v0==1?(v6=tpc(txp()))!=0?v6:epc(0):ls1(v0)==0?(v10=tpc(txp()))!=0?v10:epc(v0):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())==0?(p=tpc(txp()))!=0?p:epc(tev(e2p())):p==1?(p=tpc(txp()))!=0?p:epc(0):ls1(p)==0?(q=tpc(txp()))!=0?q:epc(p):epc(tev(p))
      //  中間コード5
      //    (p=e1p())==0?(p=tpc(txp()))!=0?p:epc(e2p()&-2):p==1?(p=tpc(txp()))!=0?p:epc(0):(p&1)==0?(q=tpc(txp()))!=0?q:epc(p):epc(p&-2)
      //  中間コード6
      //    (p=e1p())==0?(p=tpc(txp()))!=0?cto(p):epo(e2p()&-2):p==1?(p=tpc(txp()))!=0?cto(p):epo(0):(p&1)==0?(q=tpc(txp()))!=0?cto(q):epo(p):epo(p&-2)
      TE2_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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 = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              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 = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XWP

      //================================================================================
      //TE2_XHCT ($0000,$06xx,$1923)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):ls1(epc(tev(v12=e2p())))!=0?mix(epc(v12),0):epc(v12)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),0):epc(p)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),0):epc(p)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
      TE2_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XHCT

      //================================================================================
      //TE2_XHCG ($0000,$06xx,$1A23)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v16=epc(tev(v18=e2p())))!=0?mix(v16,epc(tod(e2q()))):epc(v18)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):epc(q)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):epc(q)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):epo(q)
      TE2_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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 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;
            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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    VideoController.vcnPal32G8[q]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XHCG

      //================================================================================
      //TE2_XHCGT ($0000,$06xx,$1B23)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(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(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?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(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v17=epc(tev(v19=e2p())))!=0?mix(mix(v17,epc(tod(e2q()))),0):epc(v19)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),0):epc(q)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):epc(q)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):epo(q)
      TE2_XHCGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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 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;
            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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[q]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XHCGT

      //================================================================================
      //TE2_XHPT ($0000,$06xx,$1D23)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0))
      TE2_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XHPT

      //================================================================================
      //TE2_XHPG ($0000,$06xx,$1E23)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p())))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p())))
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2p())))
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p())))
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1))
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1)))
      TE2_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XHPG

      //================================================================================
      //TE2_XHPGT ($0000,$06xx,$1F23)
      //  概要
      //    TE2  テキスト＞512ドット16色2プレーン
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0)))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0)
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2p()))),0)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2p()))),0)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2p()|1)),0)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2p()|1)),0))
      TE2_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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;
            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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                    0)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                        0)]);
              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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                    0)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                        0)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          VideoController.vcnPal16G8[p & -2],
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                        0)]);
              gx1st += 8;
              gx2nd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE2_XHPGT

      //================================================================================
      //TE3 ($0000,$06xx,$0027)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    拡張なし
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットが0でないとき
      //          2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットが0のとき)
      //          3番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):epc(e3p()))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):epc(e3p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):epc(e3p())
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p())
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p())
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):epo(e3p())
      TE3 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE3

      //================================================================================
      //XTE3
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    拡張あり
      XTE3 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //TE3_XWC
          case 0b00010001:  //TE3_XWC
          case 0b00010010:  //TE3_XWC
          case 0b00010011:  //TE3_XWC
            TE3_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //TE3_XWP
          case 0b00010101:  //TE3_XWP
          case 0b00010110:  //TE3_XWP
          case 0b00010111:  //TE3_XWP
            TE3_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //TE3_XHC
            TE3.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //TE3_XHCT
            TE3_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //TE3_XHCG
            TE3_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //TE3_XHCGT
            TE3_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //TE3_XHPT
            TE3_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //TE3_XHPG
            TE3_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //TE3_XHPGT
            TE3_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //TE3_A
          case 0b01000001:  //TE3_A
          case 0b01000010:  //TE3_A
          case 0b01000011:  //TE3_A
          case 0b01000100:  //TE3_A
          case 0b01000101:  //TE3_A
          case 0b01000110:  //TE3_A
          case 0b01000111:  //TE3_A
          case 0b01001000:  //TE3_A
          case 0b01001001:  //TE3_A
          case 0b01001010:  //TE3_A
          case 0b01001011:  //TE3_A
          case 0b01001100:  //TE3_A
          case 0b01001101:  //TE3_A
          case 0b01001110:  //TE3_A
          case 0b01001111:  //TE3_A
          case 0b01010000:  //TE3_A
          case 0b01010001:  //TE3_A
          case 0b01010010:  //TE3_A
          case 0b01010011:  //TE3_A
          case 0b01010100:  //TE3_A
          case 0b01010101:  //TE3_A
          case 0b01010110:  //TE3_A
          case 0b01010111:  //TE3_A
          case 0b01011000:  //TE3_A
          case 0b01011001:  //TE3_A
          case 0b01011010:  //TE3_A
          case 0b01011011:  //TE3_A
          case 0b01011100:  //TE3_A
          case 0b01011101:  //TE3_A
          case 0b01011110:  //TE3_A
          case 0b01011111:  //TE3_A
            E3_A.drawRaster (src, dst, rh);
            break;
          default:
            TE3.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XTE3);
          }  //switch
        }  //drawRaster
      },  //XTE3

      //================================================================================
      //TE3_XWC ($0000,$06xx,$1027)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          テキストカラーが0でないとき
      //            テキストカラー
      //          さもなくば(テキストカラーが0のとき)
      //            2番目のカラー(0は黒)
      //      さもなくば(2番目のパレットが0のとき)
      //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          3番目のカラー(0は黒)
      //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          テキストカラーが0でないとき
      //            テキストカラー
      //          さもなくば(テキストカラーが0のとき)
      //            3番目のカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(tpc(txp())!=0?tpc(txp()):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(tpc(txp())!=0?tpc(txp()):epc(e2p()))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(tpc(txp())!=0?tpc(txp()):epc(e3p())))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):tpc(txp())!=0?tpc(txp()):epc(e2p()):ls1(epc(tev(e3p())))!=0?epc(e3p()):tpc(txp())!=0?tpc(txp()):epc(e3p())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=tpc(txp()))!=0?v5:epc(v0):(v8=e2p())!=0?ls1(epc(tev(v8)))!=0?epc(v8):(v13=tpc(txp()))!=0?v13:epc(v8):ls1(epc(tev(v19=e3p())))!=0?epc(v19):(v21=tpc(txp()))!=0?v21:epc(v19)
      //  中間コード4
      //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):ls1(epc(tev(p=e3p())))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
      //  中間コード5
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(epc((p=e3p())&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
      //  中間コード6
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p)
      TE3_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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 = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 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 = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE3_XWC

      //================================================================================
      //TE3_XWP ($0000,$06xx,$1427)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        2番目のパレットを偶数化したパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //          3番目のパレットを偶数化したパレットのカラー(0は黒)
      //    1番目のパレットが1のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?(tpc(txp())!=0?tpc(txp()):((tev(e2p()))!=0?epc(tev(e2p())):epc(tev(e3p())))):e1p()==1?(tpc(txp())!=0?tpc(txp()):epc(0)):ls1(e1p())==0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):epc(tev(e1p())))
      //  中間コード2
      //    e1p()==0?tpc(txp())!=0?tpc(txp()):tev(e2p())!=0?epc(tev(e2p())):epc(tev(e3p())):e1p()==1?tpc(txp())!=0?tpc(txp()):epc(0):ls1(e1p())==0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())==0?(v1=tpc(txp()))!=0?v1:(v3=tev(e2p()))!=0?epc(v3):epc(tev(e3p())):v0==1?(v9=tpc(txp()))!=0?v9:epc(0):ls1(v0)==0?(v13=tpc(txp()))!=0?v13:epc(v0):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())==0?(p=tpc(txp()))!=0?p:(p=tev(e2p()))!=0?epc(p):epc(tev(e3p())):p==1?(p=tpc(txp()))!=0?p:epc(0):ls1(p)==0?(q=tpc(txp()))!=0?q:epc(p):epc(tev(p))
      //  中間コード5
      //    (p=e1p())==0?(p=tpc(txp()))!=0?p:(p=e2p()&-2)!=0?epc(p):epc(e3p()&-2):p==1?(p=tpc(txp()))!=0?p:epc(0):(p&1)==0?(q=tpc(txp()))!=0?q:epc(p):epc(p&-2)
      //  中間コード6
      //    (p=e1p())==0?(p=tpc(txp()))!=0?cto(p):(p=e2p()&-2)!=0?epo(p):epo(e3p()&-2):p==1?(p=tpc(txp()))!=0?cto(p):epo(0):(p&1)==0?(q=tpc(txp()))!=0?cto(q):epo(p):epo(p&-2)
      TE3_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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 = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 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 = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                    p == 1 ?
                                    (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[p & -2]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE3_XWP

      //================================================================================
      //TE3_XHCT ($0000,$06xx,$1927)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
      //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットが0のとき)
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のカラーとカラー0を混ぜたカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            3番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):ls1(epc(tev(v19=e3p())))!=0?mix(epc(v19),0):epc(v19)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),0):epc(p)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),0):epc(p)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
      TE3_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        0)] :
                                    VideoController.vcnPal32G8[p]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE3_XHCT

      //================================================================================
      //TE3_XHCG ($0000,$06xx,$1A27)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットが0のとき)
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            3番目のパレットが奇数のとき
      //              パレット1のカラー(0は黒)
      //            さもなくば(3番目のパレットが偶数のとき)
      //              3番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):ls1(v25=epc(tev(v27=e3p())))!=0?mix(v25,epc(1)):ls1(v27)!=0?epc(1):epc(v27)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q)
      TE3_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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 gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1])] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE3_XHCG

      //================================================================================
      //TE3_XHCGT ($0000,$06xx,$1B27)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットが0のとき)
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            3番目のパレットが奇数のとき
      //              パレット1のカラー(0は黒)
      //            さもなくば(3番目のパレットが偶数のとき)
      //              3番目のカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p())
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):ls1(v27=epc(tev(v29=e3p())))!=0?mix(mix(v27,epc(1)),0):ls1(v29)!=0?epc(1):epc(v29)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q)
      TE3_XHCGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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 gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 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 = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          q,
                                          VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                        0)] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnMix2 (
                                          p,
                                          VideoController.vcnPal16G8[1]),
                                        0)] :
                                    (q & 1) != 0 ?
                                    VideoController.vcnPal32G8[1] :
                                    VideoController.vcnPal32G8[q]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE3_XHCGT

      //================================================================================
      //TE3_XHPT ($0000,$06xx,$1D27)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //          3番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):epc(tev(e3p()))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):epc(tev(e3p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):epc(tev(e3p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0)
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):epc(tev(e3p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0)
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):epc(e3p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0)
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):epo(e3p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0))
      TE3_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                    p == 1 ?
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        0)]);
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //TE3_XHPT

      //================================================================================
      //TE3_XHPG ($0000,$06xx,$1E27)
      //  概要
      //    TE3  テキスト＞512ドット16色3プレーン
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    テキストカラーが0でないとき
      //      テキストカラー
      //    さもなくば(テキストカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //          3番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    (tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):epc(tev(e3p()))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))))
      //  中間コード2
      //    tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):epc(tev(e3p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))
      //  中間コード3
      //    (v0=tpc(txp()))!=0?v0:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):epc(tev(e3p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q())))
      //  中間コード4
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):epc(tev(e3p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q())))
      //  中間コード5
      //    (p=tpc(txp()))!=0?p:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):epc(e3p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1))
      //  中間コード6
      //    (p=tpc(txp()))!=0?cto(p):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):epo(e3p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1)))
      TE3_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          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 gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((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;
            gx1st += half;
            gx2nd += half;
            gx3rd += 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;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                                p == 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])]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                    p == 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])]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                    p == 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])]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                    (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                    p == 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])]);

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