xeij/DrawingMode.java (48/48)- Source code ソースコード - XEiJ - STUDIO KAMADA
xeij/DrawingMode.java (48/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

          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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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
      },  //TSG_XHCT

      //================================================================================
      //TSG_XHPT ($0003,$12xx,$1D6F)
      //  概要
      //    TSG  テキスト＞スプライト＞512ドット65536色1プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0))):(spc(spp())!=0?spc(spp()):(g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0))))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0):spc(spp())!=0?spc(spp()):g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0)
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=g1p())<=1?gpc(0,0):ls1(v2)==0?gpc(v2,v2):mix(gpc(v8=tev(v2),v8),0):(v9=spc(spp()))!=0?v9:(v11=g1p())<=1?gpc(0,0):ls1(v11)==0?gpc(v11,v11):mix(gpc(v17=tev(v11),v17),0)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=g1p())<=1?gpc(0,0):ls1(p)==0?gpc(p,p):mix(gpc(q=tev(p),q),0):(p=spc(spp()))!=0?p:(p=g1p())<=1?gpc(0,0):ls1(p)==0?gpc(p,p):mix(gpc(q=tev(p),q),0)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=g1p())<=1?gpc(0,0):(p&1)==0?gpc(p,p):mix(gpc(q=p&-2,q),0):(p=spc(spp()))!=0?p:(p=g1p())<=1?gpc(0,0):(p&1)==0?gpc(p,p):mix(gpc(q=p&-2,q),0)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(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=spc(spp()))!=0?cto(p):(p=g1p())<=1?gpo(0,0):(p&1)==0?gpo(p,p):cto(mix(gpc(q=p&-2,q),0))
      TSG_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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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
      },  //TSG_XHPT

      //================================================================================
      //TSH ($0004,$12xx,$0070)
      //  概要
      //    TSH  テキスト＞スプライト＞1024ドット16色1プレーン
      //    拡張なし
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):hpc(h1p())):(spc(spp())!=0?spc(spp()):hpc(h1p())))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):hpc(h1p()):spc(spp())!=0?spc(spp()):hpc(h1p())
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:hpc(h1p()):(v4=spc(spp()))!=0?v4:hpc(h1p())
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:hpc(h1p()):(p=spc(spp()))!=0?p:hpc(h1p())
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:hpc(h1p()):(p=spc(spp()))!=0?p:hpc(h1p())
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):hpo(h1p()):(p=spc(spp()))!=0?cto(p):hpo(h1p())
      TSH {
        @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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[ga]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[ga]]);
                XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 1]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 1]]);
                XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 2]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 2]]);
                XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 3]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 3]]);
                XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 4]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 4]]);
                XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 5]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 5]]);
                XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 6]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 6]]);
                XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 7]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[ga]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[ga]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[ga]]);
                XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 1]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 1]]);
                XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 2]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 2]]);
                XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 3]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 3]]);
                XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 4]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 4]]);
                XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 5]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 5]]);
                XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 6]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 6]]);
                XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 7]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[GraphicScreen.graM4[ga]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSH

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

      //================================================================================
      //TSH_XWC ($0004,$12xx,$1070)
      //  概要
      //    TSH  テキスト＞スプライト＞1024ドット16色1プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (ls1(hpc(tev(h1p())))!=0?hpc(h1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):hpc(h1p())):(spc(spp())!=0?spc(spp()):hpc(h1p()))))
      //  中間コード2
      //    ls1(hpc(tev(h1p())))!=0?hpc(h1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):hpc(h1p()):spc(spp())!=0?spc(spp()):hpc(h1p())
      //  中間コード3
      //    ls1(hpc(tev(v3=h1p())))!=0?hpc(v3):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:hpc(v3):(v8=spc(spp()))!=0?v8:hpc(v3)
      //  中間コード4
      //    ls1(hpc(tev(p=h1p())))!=0?hpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:hpc(p):(q=spc(spp()))!=0?q:hpc(p)
      //  中間コード5
      //    (hpc((p=h1p())&-2)&1)!=0?hpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:hpc(p):(q=spc(spp()))!=0?q:hpc(p)
      //  中間コード6
      //    (hpc((p=h1p())&-2)&1)!=0?hpo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):hpo(p):(q=spc(spp()))!=0?cto(q):hpo(p)
      TSH_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 = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 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 = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 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 = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 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 = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 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 = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 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 = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 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 = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 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 = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 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 = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 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 = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 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 = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 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 = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 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 = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSH_XWC

      //================================================================================
      //TSH_XWP ($0004,$12xx,$1470)
      //  概要
      //    TSH  テキスト＞スプライト＞1024ドット16色1プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          グラフィックパレット0のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (h1p()<=1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):hpc(0)):(spc(spp())!=0?spc(spp()):hpc(0))):ls1(h1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):hpc(h1p())):(spc(spp())!=0?spc(spp()):hpc(h1p()))):hpc(tev(h1p())))
      //  中間コード2
      //    h1p()<=1?txp()!=0?tpc(txp())!=0?tpc(txp()):hpc(0):spc(spp())!=0?spc(spp()):hpc(0):ls1(h1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):hpc(h1p()):spc(spp())!=0?spc(spp()):hpc(h1p()):hpc(tev(h1p()))
      //  中間コード3
      //    (v0=h1p())<=1?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:hpc(0):(v4=spc(spp()))!=0?v4:hpc(0):ls1(v0)==0?(v8=txp())!=0?(v9=tpc(v8))!=0?v9:hpc(v0):(v11=spc(spp()))!=0?v11:hpc(v0):hpc(tev(v0))
      //  中間コード4
      //    (p=h1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:hpc(0):(p=spc(spp()))!=0?p:hpc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:hpc(p):(q=spc(spp()))!=0?q:hpc(p):hpc(tev(p))
      //  中間コード5
      //    (p=h1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:hpc(0):(p=spc(spp()))!=0?p:hpc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:hpc(p):(q=spc(spp()))!=0?q:hpc(p):hpc(p&-2)
      //  中間コード6
      //    (p=h1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):hpo(0):(p=spc(spp()))!=0?cto(p):hpo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):hpo(p):(q=spc(spp()))!=0?cto(q):hpo(p):hpo(p&-2)
      TSH_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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[0] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                      (p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                      (p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                      (p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                      (p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                      (p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                      (p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                      (p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[0] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                      (p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                      (p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                      (p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                      (p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                      (p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                      (p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[p] :
                                      VideoController.vcnPal32G8[p & -2]);
                XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                      (p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSH_XWP

      //================================================================================
      //TSH_XHCT ($0004,$12xx,$1970)
      //  概要
      //    TSH  テキスト＞スプライト＞1024ドット16色1プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p()))):(spc(spp())!=0?spc(spp()):(ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p()))))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p()):spc(spp())!=0?spc(spp()):ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p())
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(hpc(tev(v5=h1p())))!=0?mix(hpc(v5),0):hpc(v5):(v9=spc(spp()))!=0?v9:ls1(hpc(tev(v14=h1p())))!=0?mix(hpc(v14),0):hpc(v14)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(hpc(tev(p=h1p())))!=0?mix(hpc(p),0):hpc(p):(p=spc(spp()))!=0?p:ls1(hpc(tev(p=h1p())))!=0?mix(hpc(p),0):hpc(p)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(hpc((p=h1p())&-2)&1)!=0?mix(hpc(p),0):hpc(p):(p=spc(spp()))!=0?p:(hpc((p=h1p())&-2)&1)!=0?mix(hpc(p),0):hpc(p)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(hpc((p=h1p())&-2)&1)!=0?cto(mix(hpc(p),0)):hpo(p):(p=spc(spp()))!=0?cto(p):(hpc((p=h1p())&-2)&1)!=0?cto(mix(hpc(p),0)):hpo(p)
      TSH_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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSH_XHCT

      //================================================================================
      //TSH_XHPT ($0004,$12xx,$1D70)
      //  概要
      //    TSH  テキスト＞スプライト＞1024ドット16色1プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0))):(spc(spp())!=0?spc(spp()):(h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0))))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0):spc(spp())!=0?spc(spp()):h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0)
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=h1p())<=1?hpc(0):ls1(v2)==0?hpc(v2):mix(hpc(tev(v2)),0):(v9=spc(spp()))!=0?v9:(v11=h1p())<=1?hpc(0):ls1(v11)==0?hpc(v11):mix(hpc(tev(v11)),0)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=h1p())<=1?hpc(0):ls1(p)==0?hpc(p):mix(hpc(tev(p)),0):(p=spc(spp()))!=0?p:(p=h1p())<=1?hpc(0):ls1(p)==0?hpc(p):mix(hpc(tev(p)),0)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=h1p())<=1?hpc(0):(p&1)==0?hpc(p):mix(hpc(p&-2),0):(p=spc(spp()))!=0?p:(p=h1p())<=1?hpc(0):(p&1)==0?hpc(p):mix(hpc(p&-2),0)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=h1p())<=1?hpo(0):(p&1)==0?hpo(p):cto(mix(hpc(p&-2),0)):(p=spc(spp()))!=0?cto(p):(p=h1p())<=1?hpo(0):(p&1)==0?hpo(p):cto(mix(hpc(p&-2),0))
      TSH_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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSH_XHPT

      //================================================================================
      //TSI ($0005,$12xx,$0070)
      //  概要
      //    TSI  テキスト＞スプライト＞1024ドット256色1プレーン
      //    拡張なし
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):ipc(i1p())):(spc(spp())!=0?spc(spp()):ipc(i1p())))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):ipc(i1p()):spc(spp())!=0?spc(spp()):ipc(i1p())
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ipc(i1p()):(v4=spc(spp()))!=0?v4:ipc(i1p())
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:ipc(i1p()):(p=spc(spp()))!=0?p:ipc(i1p())
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:ipc(i1p()):(p=spc(spp()))!=0?p:ipc(i1p())
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):ipo(i1p()):(p=spc(spp()))!=0?cto(p):ipo(i1p())
      TSI {
        @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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                              GraphicScreen.graM4[ga])] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                              GraphicScreen.graM4[ga])]);
                XEiJ.pnlBM[da + 1] = ((p = 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                  GraphicScreen.graM4[ga + 1])]);
                XEiJ.pnlBM[da + 2] = ((p = 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                  GraphicScreen.graM4[ga + 2])]);
                XEiJ.pnlBM[da + 3] = ((p = 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                  GraphicScreen.graM4[ga + 3])]);
                XEiJ.pnlBM[da + 4] = ((p = 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                  GraphicScreen.graM4[ga + 4])]);
                XEiJ.pnlBM[da + 5] = ((p = 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                  GraphicScreen.graM4[ga + 5])]);
                XEiJ.pnlBM[da + 6] = ((p = 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                  GraphicScreen.graM4[ga + 6])]);
                XEiJ.pnlBM[da + 7] = ((p = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                GraphicScreen.graM4[ga])] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                              GraphicScreen.graM4[ga])] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                              GraphicScreen.graM4[ga])]);
                XEiJ.pnlBM[da + 1] = ((p = 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                  GraphicScreen.graM4[ga + 1])]);
                XEiJ.pnlBM[da + 2] = ((p = 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                  GraphicScreen.graM4[ga + 2])]);
                XEiJ.pnlBM[da + 3] = ((p = 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                  GraphicScreen.graM4[ga + 3])]);
                XEiJ.pnlBM[da + 4] = ((p = 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                  GraphicScreen.graM4[ga + 4])]);
                XEiJ.pnlBM[da + 5] = ((p = 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                  GraphicScreen.graM4[ga + 5])]);
                XEiJ.pnlBM[da + 6] = ((p = 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                  GraphicScreen.graM4[ga + 6])]);
                XEiJ.pnlBM[da + 7] = ((p = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                GraphicScreen.graM4[ga])] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSI

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

      //================================================================================
      //TSI_XWC ($0005,$12xx,$1070)
      //  概要
      //    TSI  テキスト＞スプライト＞1024ドット256色1プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (ls1(ipc(tev(i1p())))!=0?ipc(i1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):ipc(i1p())):(spc(spp())!=0?spc(spp()):ipc(i1p()))))
      //  中間コード2
      //    ls1(ipc(tev(i1p())))!=0?ipc(i1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):ipc(i1p()):spc(spp())!=0?spc(spp()):ipc(i1p())
      //  中間コード3
      //    ls1(ipc(tev(v3=i1p())))!=0?ipc(v3):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:ipc(v3):(v8=spc(spp()))!=0?v8:ipc(v3)
      //  中間コード4
      //    ls1(ipc(tev(p=i1p())))!=0?ipc(p):(q=txp())!=0?(r=tpc(q))!=0?r:ipc(p):(q=spc(spp()))!=0?q:ipc(p)
      //  中間コード5
      //    (ipc((p=i1p())&-2)&1)!=0?ipc(p):(q=txp())!=0?(r=tpc(q))!=0?r:ipc(p):(q=spc(spp()))!=0?q:ipc(p)
      //  中間コード6
      //    (ipc((p=i1p())&-2)&1)!=0?ipo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):ipo(p):(q=spc(spp()))!=0?cto(q):ipo(p)
      TSI_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 = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 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 = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 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 = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 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 = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 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 = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 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 = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 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 = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 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 = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 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 = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 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 = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 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 = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 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 = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 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 = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSI_XWC

      //================================================================================
      //TSI_XWP ($0005,$12xx,$1470)
      //  概要
      //    TSI  テキスト＞スプライト＞1024ドット256色1プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          グラフィックパレット0のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (i1p()<=1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):ipc(0)):(spc(spp())!=0?spc(spp()):ipc(0))):ls1(i1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):ipc(i1p())):(spc(spp())!=0?spc(spp()):ipc(i1p()))):ipc(tev(i1p())))
      //  中間コード2
      //    i1p()<=1?txp()!=0?tpc(txp())!=0?tpc(txp()):ipc(0):spc(spp())!=0?spc(spp()):ipc(0):ls1(i1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):ipc(i1p()):spc(spp())!=0?spc(spp()):ipc(i1p()):ipc(tev(i1p()))
      //  中間コード3
      //    (v0=i1p())<=1?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:ipc(0):(v4=spc(spp()))!=0?v4:ipc(0):ls1(v0)==0?(v8=txp())!=0?(v9=tpc(v8))!=0?v9:ipc(v0):(v11=spc(spp()))!=0?v11:ipc(v0):ipc(tev(v0))
      //  中間コード4
      //    (p=i1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:ipc(0):(p=spc(spp()))!=0?p:ipc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:ipc(p):(q=spc(spp()))!=0?q:ipc(p):ipc(tev(p))
      //  中間コード5
      //    (p=i1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:ipc(0):(p=spc(spp()))!=0?p:ipc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:ipc(p):(q=spc(spp()))!=0?q:ipc(p):ipc(p&-2)
      //  中間コード6
      //    (p=i1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):ipo(0):(p=spc(spp()))!=0?cto(p):ipo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):ipo(p):(q=spc(spp()))!=0?cto(q):ipo(p):ipo(p&-2)
      TSI_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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[0] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 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 = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 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 = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 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 = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 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 = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 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 = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 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 = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[0] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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 = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 24 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 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 = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 20 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 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 = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 16 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 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 = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 12 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 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 = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 8 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 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 = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp >>> 4 & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 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 = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPal32G8[0] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPal32G8[0] :
                                      (p & 1) == 0 ?
                                      (q = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPal32G8[p] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32G8[0] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32G8[0] :
                                    (p & 1) == 0 ?
                                    (q = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSI_XWP

      //================================================================================
      //TSI_XHCT ($0005,$12xx,$1970)
      //  概要
      //    TSI  テキスト＞スプライト＞1024ドット256色1プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p()))):(spc(spp())!=0?spc(spp()):(ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p()))))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p()):spc(spp())!=0?spc(spp()):ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p())
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(ipc(tev(v5=i1p())))!=0?mix(ipc(v5),0):ipc(v5):(v9=spc(spp()))!=0?v9:ls1(ipc(tev(v14=i1p())))!=0?mix(ipc(v14),0):ipc(v14)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(ipc(tev(p=i1p())))!=0?mix(ipc(p),0):ipc(p):(p=spc(spp()))!=0?p:ls1(ipc(tev(p=i1p())))!=0?mix(ipc(p),0):ipc(p)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(ipc((p=i1p())&-2)&1)!=0?mix(ipc(p),0):ipc(p):(p=spc(spp()))!=0?p:(ipc((p=i1p())&-2)&1)!=0?mix(ipc(p),0):ipc(p)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(ipc((p=i1p())&-2)&1)!=0?cto(mix(ipc(p),0)):ipo(p):(p=spc(spp()))!=0?cto(p):(ipc((p=i1p())&-2)&1)!=0?cto(mix(ipc(p),0)):ipo(p)
      TSI_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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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
      },  //TSI_XHCT

      //================================================================================
      //TSI_XHPT ($0005,$12xx,$1D70)
      //  概要
      //    TSI  テキスト＞スプライト＞1024ドット256色1プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0))):(spc(spp())!=0?spc(spp()):(i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0))))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0):spc(spp())!=0?spc(spp()):i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0)
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=i1p())<=1?ipc(0):ls1(v2)==0?ipc(v2):mix(ipc(tev(v2)),0):(v9=spc(spp()))!=0?v9:(v11=i1p())<=1?ipc(0):ls1(v11)==0?ipc(v11):mix(ipc(tev(v11)),0)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=i1p())<=1?ipc(0):ls1(p)==0?ipc(p):mix(ipc(tev(p)),0):(p=spc(spp()))!=0?p:(p=i1p())<=1?ipc(0):ls1(p)==0?ipc(p):mix(ipc(tev(p)),0)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=i1p())<=1?ipc(0):(p&1)==0?ipc(p):mix(ipc(p&-2),0):(p=spc(spp()))!=0?p:(p=i1p())<=1?ipc(0):(p&1)==0?ipc(p):mix(ipc(p&-2),0)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=i1p())<=1?ipo(0):(p&1)==0?ipo(p):cto(mix(ipc(p&-2),0)):(p=spc(spp()))!=0?cto(p):(p=i1p())<=1?ipo(0):(p&1)==0?ipo(p):cto(mix(ipc(p&-2),0))
      TSI_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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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 = 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[SpriteScreen.sprBuffer[sx]]) != 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
                //                                                           ........ ........ .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 = 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[SpriteScreen.sprBuffer[sx]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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 = 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[SpriteScreen.sprBuffer[sx + 7]]) != 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) {
                //                                                           ........ ........ .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 = 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[SpriteScreen.sprBuffer[sx]]) != 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
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //TSI_XHPT

      //================================================================================
      //TSJ ($0007,$12xx,$0070)
      //  概要
      //    TSJ  テキスト＞スプライト＞1024ドット65536色1プレーン
      //    拡張なし
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):jpc(j1p(),j1p())):(spc(spp())!=0?spc(spp()):jpc(j1p(),j1p())))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):jpc(j1p(),j1p()):spc(spp())!=0?spc(spp()):jpc(j1p(),j1p())
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:jpc(v3=j1p(),v3):(v4=spc(spp()))!=0?v4:jpc(v7=j1p(),v7)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:jpc(p=j1p(),p):(p=spc(spp()))!=0?p:jpc(p=j1p(),p)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:jpc(p=j1p(),p):(p=spc(spp()))!=0?p:jpc(p=j1p(),p)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):jpo(p=j1p(),p):(p=spc(spp()))!=0?cto(p):jpo(p=j1p(),p)
      TSJ {
        @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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                          GraphicScreen.graM4[ga + 1])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                          GraphicScreen.graM4[ga + 1])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                          GraphicScreen.graM4[ga + 2])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                          GraphicScreen.graM4[ga + 2])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                          GraphicScreen.graM4[ga + 3])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                          GraphicScreen.graM4[ga + 3])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                          GraphicScreen.graM4[ga + 4])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                          GraphicScreen.graM4[ga + 4])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                          GraphicScreen.graM4[ga + 5])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                          GraphicScreen.graM4[ga + 5])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                          GraphicScreen.graM4[ga + 6])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                          GraphicScreen.graM4[ga + 6])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                          GraphicScreen.graM4[ga + 7])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                          GraphicScreen.graM4[ga + 7])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                        GraphicScreen.graM4[ga])) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                        GraphicScreen.graM4[ga])) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]]);
                  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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                          GraphicScreen.graM4[ga + 1])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                          GraphicScreen.graM4[ga + 1])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                          GraphicScreen.graM4[ga + 2])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                          GraphicScreen.graM4[ga + 2])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                          GraphicScreen.graM4[ga + 3])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                          GraphicScreen.graM4[ga + 3])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                          GraphicScreen.graM4[ga + 4])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                          GraphicScreen.graM4[ga + 4])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                          GraphicScreen.graM4[ga + 5])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                          GraphicScreen.graM4[ga + 5])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                          GraphicScreen.graM4[ga + 6])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                          GraphicScreen.graM4[ga + 6])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                          GraphicScreen.graM4[ga + 7])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                          GraphicScreen.graM4[ga + 7])) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]]);
                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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                        GraphicScreen.graM4[ga])) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                        GraphicScreen.graM4[ga])) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //TSJ

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

      //================================================================================
      //TSJ_XWC ($0007,$12xx,$1070)
      //  概要
      //    TSJ  テキスト＞スプライト＞1024ドット65536色1プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):jpc(j1p(),j1p())):(spc(spp())!=0?spc(spp()):jpc(j1p(),j1p()))))
      //  中間コード2
      //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):jpc(j1p(),j1p()):spc(spp())!=0?spc(spp()):jpc(j1p(),j1p())
      //  中間コード3
      //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?jpc(v3,v3):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:jpc(v3,v3):(v8=spc(spp()))!=0?v8:jpc(v3,v3)
      //  中間コード4
      //    ls1(jpc(p=tod(q=j1p()),p))!=0?jpc(q,q):(p=txp())!=0?(r=tpc(p))!=0?r:jpc(q,q):(p=spc(spp()))!=0?p:jpc(q,q)
      //  中間コード5
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpc(q,q):(p=txp())!=0?(r=tpc(p))!=0?r:jpc(q,q):(p=spc(spp()))!=0?p:jpc(q,q)
      //  中間コード6
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpo(q,q):(p=txp())!=0?(r=tpc(p))!=0?cto(r):jpo(q,q):(p=spc(spp()))!=0?cto(p):jpo(q,q)
      TSJ_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.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q, r;
                  XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q, r;
                XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q, r;
                  XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //TSJ_XWC

      //================================================================================
      //TSJ_XWP ($0007,$12xx,$1470)
      //  概要
      //    TSJ  テキスト＞スプライト＞1024ドット65536色1プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          グラフィックパレット0のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      テキストパレットが0でないとき
      //        テキストカラーが0でないとき
      //          テキストカラー
      //        さもなくば(テキストカラーが0のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(テキストパレットが0のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (j1p()<=1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):jpc(0,0)):(spc(spp())!=0?spc(spp()):jpc(0,0))):ls1(j1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):jpc(j1p(),j1p())):(spc(spp())!=0?spc(spp()):jpc(j1p(),j1p()))):jpc(tev(j1p()),tev(j1p())))
      //  中間コード2
      //    j1p()<=1?txp()!=0?tpc(txp())!=0?tpc(txp()):jpc(0,0):spc(spp())!=0?spc(spp()):jpc(0,0):ls1(j1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):jpc(j1p(),j1p()):spc(spp())!=0?spc(spp()):jpc(j1p(),j1p()):jpc(tev(j1p()),tev(j1p()))
      //  中間コード3
      //    (v0=j1p())<=1?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:jpc(0,0):(v4=spc(spp()))!=0?v4:jpc(0,0):ls1(v0)==0?(v8=txp())!=0?(v9=tpc(v8))!=0?v9:jpc(v0,v0):(v11=spc(spp()))!=0?v11:jpc(v0,v0):jpc(v15=tev(v0),v15)
      //  中間コード4
      //    (p=j1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:jpc(0,0):(p=spc(spp()))!=0?p:jpc(0,0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:jpc(p,p):(q=spc(spp()))!=0?q:jpc(p,p):jpc(q=tev(p),q)
      //  中間コード5
      //    (p=j1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:jpc(0,0):(p=spc(spp()))!=0?p:jpc(0,0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:jpc(p,p):(q=spc(spp()))!=0?q:jpc(p,p):jpc(q=p&-2,q)
      //  中間コード6
      //    (p=j1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):jpo(0,0):(p=spc(spp()))!=0?cto(p):jpo(0,0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):jpo(p,p):(q=spc(spp()))!=0?cto(q):jpo(p,p):jpo(q=p&-2,q)
      TSJ_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 + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  (q = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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;
                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 + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255]] :
                                    (p & 1) == 0 ?
                                    (q = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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++;
                  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 + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  (q = tp >>> 28) != 0 ?
                                  (r = VideoController.vcnPal16TS[q]) != 0 ?
                                  VideoController.vcnPalTbl[r] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 1]]) != 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[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 2]]) != 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[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 3]]) != 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[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 4]]) != 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[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 5]]) != 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[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 1 ?
                                      (p = 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = 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[SpriteScreen.sprBuffer[sx + 6]]) != 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[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 1 ?
                                      (p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255]] :
                                      (p & 1) == 0 ?
                                      (q = tp & 15) != 0 ?
                                      (r = VideoController.vcnPal16TS[q]) != 0 ?
                                      VideoController.vcnPalTbl[r] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]] :
                                      (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 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;
                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 + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 1 ?
                                    (p = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255]] :
                                    (p & 1) == 0 ?
                                    (q = tp >>> 28) != 0 ?
                                    (r = VideoController.vcnPal16TS[q]) != 0 ?
                                    VideoController.vcnPalTbl[r] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]] :
                                    (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 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++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //TSJ_XWP

      //================================================================================
      //TSJ_XHCT ($0007,$12xx,$1970)
      //  概要
      //    TSJ  テキスト＞スプライト＞1024ドット65536色1プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p()))):(spc(spp())!=0?spc(spp()):(ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p()))))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p()):spc(spp())!=0?spc(spp()):ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p())
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(jpc(v4=tod(v5=j1p()),v4))!=0?mix(jpc(v5,v5),0):jpc(v5,v5):(v9=spc(spp()))!=0?v9:ls1(jpc(v13=tod(v14=j1p()),v13))!=0?mix(jpc(v14,v14),0):jpc(v14,v14)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),0):jpc(q,q):(p=spc(spp()))!=0?p:ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),0):jpc(q,q)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),0):jpc(q,q):(p=spc(spp()))!=0?p:(jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),0):jpc(q,q)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),0)):jpo(q,q):(p=spc(spp()))!=0?cto(p):(jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),0)):jpo(q,q)
      TSJ_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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                          VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                          VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                          VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        0)] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        0)] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
          } else {  //テキスト桁境界に合っていないとき
            //                                                               ts=1のとき
            int tt = ts + 8;                                               //tt=9
            ts += 16;                                                      //ts=17
            //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
            int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
            int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
            int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
            int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            while (da < db) {
              int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
              gx += dw;  //次回の1024ドットx座標
              int dc = da + dw;  //今回のARGB出力インデックスの終了位置
              while (da < dc) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                int p, q;
                XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                               GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                               GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                               GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                               GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                               GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                               GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]] :
                                      (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                               GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                               GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                               GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                        VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnMix2 (
                                          (VideoController.vcnPal8G16H[q >> 8] |
                                           VideoController.vcnPal8G16L[q & 255]),
                                          0)] :
                                      VideoController.vcnPalTbl[
                                        VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255]]);
                sx += 8;
                ga += 8;
                da += 8;
              }  //while da<dc
              if (da < db) {
                //                                                           ........ ........ .1234567 ________  p0>>tt
                //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
                p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
                p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
                p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
                p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
                int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                          VideoController.VCN_TXP2[p2 >>> 24] |
                          VideoController.VCN_TXP1[p1 >>> 24] |
                          VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
                tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
                for (int k = 0; k < 8; k++) {
                  if ((gx & 511) == 0) {  //gxが512の倍数のとき
                    ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                  }
                  gx++;
                  int p, q;
                  XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        0)] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                             GraphicScreen.graM4[ga])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        0)] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
                  sx++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      },  //TSJ_XHCT

      //================================================================================
      //TSJ_XHPT ($0007,$12xx,$1D70)
      //  概要
      //    TSJ  テキスト＞スプライト＞1024ドット65536色1プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    テキストパレットが0でないとき
      //      テキストカラーが0でないとき
      //        テキストカラー
      //      さもなくば(テキストカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //    さもなくば(テキストパレットが0のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のパレットが1以下のとき
      //          グラフィックパレット0のカラー(0は黒)
      //        1番目のパレットが2以上の偶数のとき
      //          1番目のカラー(0は黒)
      //        さもなくば(1番目のパレットが3以上の奇数のとき)
      //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0))):(spc(spp())!=0?spc(spp()):(j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0))))
      //  中間コード2
      //    txp()!=0?tpc(txp())!=0?tpc(txp()):j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0):spc(spp())!=0?spc(spp()):j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0)
      //  中間コード3
      //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=j1p())<=1?jpc(0,0):ls1(v2)==0?jpc(v2,v2):mix(jpc(v8=tev(v2),v8),0):(v9=spc(spp()))!=0?v9:(v11=j1p())<=1?jpc(0,0):ls1(v11)==0?jpc(v11,v11):mix(jpc(v17=tev(v11),v17),0)
      //  中間コード4
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=j1p())<=1?jpc(0,0):ls1(p)==0?jpc(p,p):mix(jpc(q=tev(p),q),0):(p=spc(spp()))!=0?p:(p=j1p())<=1?jpc(0,0):ls1(p)==0?jpc(p,p):mix(jpc(q=tev(p),q),0)
      //  中間コード5
      //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=j1p())<=1?jpc(0,0):(p&1)==0?jpc(p,p):mix(jpc(q=p&-2,q),0):(p=spc(spp()))!=0?p:(p=j1p())<=1?jpc(0,0):(p&1)==0?jpc(p,p):mix(jpc(q=p&-2,q),0)
      //  中間コード6
      //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=j1p())<=1?jpo(0,0):(p&1)==0?jpo(p,p):cto(mix(jpc(q=p&-2,q),0)):(p=spc(spp()))!=0?cto(p):(p=j1p())<=1?jpo(0,0):(p&1)==0?jpo(p,p):cto(mix(jpc(q=p&-2,q),0))
      TSJ_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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 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[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 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 = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 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 = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 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 = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 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 = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 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 = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 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 = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 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 = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 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[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 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;
                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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 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[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 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++;
                  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 = tp >>> 28) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 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[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 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 = tp >>> 24 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 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[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                            GraphicScreen.graM4[ga + 1])) <= 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 = tp >>> 20 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 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[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                            GraphicScreen.graM4[ga + 2])) <= 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 = tp >>> 16 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 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[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                            GraphicScreen.graM4[ga + 3])) <= 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 = tp >>> 12 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 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[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                            GraphicScreen.graM4[ga + 4])) <= 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 = tp >>> 8 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 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[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                            GraphicScreen.graM4[ga + 5])) <= 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 = tp >>> 4 & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 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[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                            GraphicScreen.graM4[ga + 6])) <= 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 = tp & 15) != 0 ?
                                      (q = VideoController.vcnPal16TS[p]) != 0 ?
                                      VideoController.vcnPalTbl[q] :
                                      (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 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[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                      VideoController.vcnPalTbl[p] :
                                      (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                            GraphicScreen.graM4[ga + 7])) <= 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;
                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 = tp >>> 28) != 0 ?
                                    (q = VideoController.vcnPal16TS[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 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[SpriteScreen.sprBuffer[sx]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                          GraphicScreen.graM4[ga])) <= 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++;
                  tp <<= 4;
                  ga++;
                  da++;
                }  //for k
              }  //if da<db
            }  //while da<db
            ts -= 16;                                                      //ts=1
          }  //if ts==0
        }  //drawRaster
      };  //TSJ_XHPT

      public abstract void drawRaster (int src, int dst, boolean rh);

    }  //enum DrawingMode

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