xeij/DrawingMode.java (30/48)- Source code ソースコード - XEiJ - STUDIO KAMADA
xeij/DrawingMode.java (30/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.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                          GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                    VideoController.vcnPal32G8[q] :
                                    (p = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                          GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                          GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                    VideoController.vcnPal32G8[q] :
                                    (p = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                          GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                    VideoController.vcnPal32G8[q]);
              XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                          GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                    VideoController.vcnPal32G8[q] :
                                    (p = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                          GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                    ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                    (p & 1) != 0 ?
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                    VideoController.vcnPal32G8[p] :
                                    ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                    VideoController.vcnPal32G8[q]);
              sx += 8;
              gx1st += 8;
              gx2nd += 8;
              gx3rd += 8;
              gx4th += 8;
              da += 8;
            }  //while da<db
          }  //if ts==0
        }  //drawRaster
      },  //STF2_XHCG

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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