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

                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
              XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                          GraphicScreen.graM4[ga + 2])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
              XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                          GraphicScreen.graM4[ga + 3])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
              XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                          GraphicScreen.graM4[ga + 4])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
              XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                          GraphicScreen.graM4[ga + 5])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
              XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                          GraphicScreen.graM4[ga + 6])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
              XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                          GraphicScreen.graM4[ga + 7])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
              sx += 8;
              ga += 8;
              da += 8;
            }  //while da<dc
            if (da < db) {
              for (int k = 0; k < 8; k++) {
                if ((gx & 511) == 0) {  //gxが512の倍数のとき
                  ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
                }
                gx++;
                int p, q;
                XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //JS_XHPT

      //================================================================================
      //SE1 ($0000,$06xx,$0041)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    拡張なし
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):epc(e1p()))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):epc(e1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:epc(e1p())
      //  中間コード4
      //    (p=spc(spp()))!=0?p:epc(e1p())
      //  中間コード5
      //    (p=spc(spp()))!=0?p:epc(e1p())
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):epo(e1p())
      SE1 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]);
            sx += 8;
            gx1st += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1

      //================================================================================
      //XSE1
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    拡張あり
      XSE1 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SE1_XWC
          case 0b00010001:  //SE1_XWC
          case 0b00010010:  //SE1_XWC
          case 0b00010011:  //SE1_XWC
            SE1_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SE1_XWP
          case 0b00010101:  //SE1_XWP
          case 0b00010110:  //SE1_XWP
          case 0b00010111:  //SE1_XWP
            SE1_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SE1_XHC
            SE1.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SE1_XHCT
            SE1_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SE1_XHCG
            SE1_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SE1_XHCGT
            SE1_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SE1_XHPT
            SE1_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SE1_XHPG
            SE1_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SE1_XHPGT
            SE1_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SE1_A
          case 0b01000001:  //SE1_A
          case 0b01000010:  //SE1_A
          case 0b01000011:  //SE1_A
          case 0b01000100:  //SE1_A
          case 0b01000101:  //SE1_A
          case 0b01000110:  //SE1_A
          case 0b01000111:  //SE1_A
          case 0b01001000:  //SE1_A
          case 0b01001001:  //SE1_A
          case 0b01001010:  //SE1_A
          case 0b01001011:  //SE1_A
          case 0b01001100:  //SE1_A
          case 0b01001101:  //SE1_A
          case 0b01001110:  //SE1_A
          case 0b01001111:  //SE1_A
          case 0b01010000:  //SE1_A
          case 0b01010001:  //SE1_A
          case 0b01010010:  //SE1_A
          case 0b01010011:  //SE1_A
          case 0b01010100:  //SE1_A
          case 0b01010101:  //SE1_A
          case 0b01010110:  //SE1_A
          case 0b01010111:  //SE1_A
          case 0b01011000:  //SE1_A
          case 0b01011001:  //SE1_A
          case 0b01011010:  //SE1_A
          case 0b01011011:  //SE1_A
          case 0b01011100:  //SE1_A
          case 0b01011101:  //SE1_A
          case 0b01011110:  //SE1_A
          case 0b01011111:  //SE1_A
            E1_A.drawRaster (src, dst, rh);
            break;
          default:
            SE1.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSE1);
          }  //switch
        }  //drawRaster
      },  //XSE1

      //================================================================================
      //SE1_XWC ($0000,$06xx,$1041)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (ls1(epc(tev(e1p())))!=0?epc(e1p()):(spc(spp())!=0?spc(spp()):epc(e1p())))
      //  中間コード2
      //    ls1(epc(tev(e1p())))!=0?epc(e1p()):spc(spp())!=0?spc(spp()):epc(e1p())
      //  中間コード3
      //    ls1(epc(tev(v3=e1p())))!=0?epc(v3):(v5=spc(spp()))!=0?v5:epc(v3)
      //  中間コード4
      //    ls1(epc(tev(p=e1p())))!=0?epc(p):(q=spc(spp()))!=0?q:epc(p)
      //  中間コード5
      //    (epc((p=e1p())&-2)&1)!=0?epc(p):(q=spc(spp()))!=0?q:epc(p)
      //  中間コード6
      //    (epc((p=e1p())&-2)&1)!=0?epo(p):(q=spc(spp()))!=0?cto(q):epo(p)
      SE1_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                              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[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                  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[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                  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[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                  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[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                  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[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                  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[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                  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[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XWC

      //================================================================================
      //SE1_XWP ($0000,$06xx,$1441)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()<=1?(spc(spp())!=0?spc(spp()):epc(0)):ls1(e1p())==0?(spc(spp())!=0?spc(spp()):epc(e1p())):epc(tev(e1p())))
      //  中間コード2
      //    e1p()<=1?spc(spp())!=0?spc(spp()):epc(0):ls1(e1p())==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())<=1?(v1=spc(spp()))!=0?v1:epc(0):ls1(v0)==0?(v5=spc(spp()))!=0?v5:epc(v0):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())<=1?(p=spc(spp()))!=0?p:epc(0):ls1(p)==0?(q=spc(spp()))!=0?q:epc(p):epc(tev(p))
      //  中間コード5
      //    (p=e1p())<=1?(p=spc(spp()))!=0?p:epc(0):(p&1)==0?(q=spc(spp()))!=0?q:epc(p):epc(p&-2)
      //  中間コード6
      //    (p=e1p())<=1?(p=spc(spp()))!=0?cto(p):epo(0):(p&1)==0?(q=spc(spp()))!=0?cto(q):epo(p):epo(p&-2)
      SE1_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 2 & 511]) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 3 & 511]) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 4 & 511]) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 5 & 511]) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 6 & 511]) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 7 & 511]) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XWP

      //================================================================================
      //SE1_XHCT ($0000,$06xx,$1941)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:ls1(epc(tev(v5=e1p())))!=0?mix(epc(v5),0):epc(v5)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:ls1(epc(tev(p=e1p())))!=0?mix(epc(p),0):epc(p)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(epc((p=e1p())&-2)&1)!=0?mix(epc(p),0):epc(p)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
      SE1_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XHCT

      //================================================================================
      //SE1_XHCG ($0000,$06xx,$1A41)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:ls1(v3=epc(tev(v5=e1p())))!=0?mix(v3,epc(tod(e2q()))):ls1(v5)!=0?epc(tod(e2q())):epc(v5)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?epc(tod(e2q())):epc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?epc(e2q()|1):epc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?epo(e2q()|1):epo(q)
      SE1_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XHCG

      //================================================================================
      //SE1_XHCGT ($0000,$06xx,$1B41)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:ls1(v3=epc(tev(v5=e1p())))!=0?mix(mix(v3,epc(tod(e2q()))),0):ls1(v5)!=0?epc(tod(e2q())):epc(v5)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),0):ls1(q)!=0?epc(tod(e2q())):epc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):(q&1)!=0?epc(e2q()|1):epc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):(q&1)!=0?epo(e2q()|1):epo(q)
      SE1_XHCGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                  VideoController.vcnPal32G8[q]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XHCGT

      //================================================================================
      //SE1_XHPT ($0000,$06xx,$1D41)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0))
      SE1_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            sx += 8;
            gx1st += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XHPT

      //================================================================================
      //SE1_XHPG ($0000,$06xx,$1E41)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q())))
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q())))
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1))
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1)))
      SE1_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XHPG

      //================================================================================
      //SE1_XHPGT ($0000,$06xx,$1F41)
      //  概要
      //    SE1  スプライト＞512ドット16色1プレーン
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0))
      SE1_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                  0)]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                      0)]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE1_XHPGT

      //================================================================================
      //SE2 ($0000,$06xx,$0043)
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    拡張なし
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):epc(e2p())))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):epc(e2p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())!=0?epc(v2):epc(e2p())
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())!=0?epo(p):epo(e2p())
      SE2 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE2

      //================================================================================
      //XSE2
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    拡張あり
      XSE2 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SE2_XWC
          case 0b00010001:  //SE2_XWC
          case 0b00010010:  //SE2_XWC
          case 0b00010011:  //SE2_XWC
            SE2_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SE2_XWP
          case 0b00010101:  //SE2_XWP
          case 0b00010110:  //SE2_XWP
          case 0b00010111:  //SE2_XWP
            SE2_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SE2_XHC
            SE2.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SE2_XHCT
            SE2_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SE2_XHCG
            SE2_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SE2_XHCGT
            SE2_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SE2_XHPT
            SE2_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SE2_XHPG
            SE2_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SE2_XHPGT
            SE2_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SE2_A
          case 0b01000001:  //SE2_A
          case 0b01000010:  //SE2_A
          case 0b01000011:  //SE2_A
          case 0b01000100:  //SE2_A
          case 0b01000101:  //SE2_A
          case 0b01000110:  //SE2_A
          case 0b01000111:  //SE2_A
          case 0b01001000:  //SE2_A
          case 0b01001001:  //SE2_A
          case 0b01001010:  //SE2_A
          case 0b01001011:  //SE2_A
          case 0b01001100:  //SE2_A
          case 0b01001101:  //SE2_A
          case 0b01001110:  //SE2_A
          case 0b01001111:  //SE2_A
          case 0b01010000:  //SE2_A
          case 0b01010001:  //SE2_A
          case 0b01010010:  //SE2_A
          case 0b01010011:  //SE2_A
          case 0b01010100:  //SE2_A
          case 0b01010101:  //SE2_A
          case 0b01010110:  //SE2_A
          case 0b01010111:  //SE2_A
          case 0b01011000:  //SE2_A
          case 0b01011001:  //SE2_A
          case 0b01011010:  //SE2_A
          case 0b01011011:  //SE2_A
          case 0b01011100:  //SE2_A
          case 0b01011101:  //SE2_A
          case 0b01011110:  //SE2_A
          case 0b01011111:  //SE2_A
            E2_A.drawRaster (src, dst, rh);
            break;
          default:
            SE2.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSE2);
          }  //switch
        }  //drawRaster
      },  //XSE2

      //================================================================================
      //SE2_XWC ($0000,$06xx,$1043)
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(spc(spp())!=0?spc(spp()):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(spc(spp())!=0?spc(spp()):epc(e2p()))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):spc(spp())!=0?spc(spp()):epc(e1p()):ls1(epc(tev(e2p())))!=0?epc(e2p()):spc(spp())!=0?spc(spp()):epc(e2p())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=spc(spp()))!=0?v5:epc(v0):ls1(epc(tev(v11=e2p())))!=0?epc(v11):(v13=spc(spp()))!=0?v13:epc(v11)
      //  中間コード4
      //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):ls1(epc(tev(p=e2p())))!=0?epc(p):(q=spc(spp()))!=0?q:epc(p)
      //  中間コード5
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):(epc((p=e2p())&-2)&1)!=0?epc(p):(q=spc(spp()))!=0?q:epc(p)
      //  中間コード6
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spc(spp()))!=0?cto(q):epo(p):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=spc(spp()))!=0?cto(q):epo(p)
      SE2_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE2_XWC

      //================================================================================
      //SE2_XWP ($0000,$06xx,$1443)
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //    1番目のパレットが1のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?(spc(spp())!=0?spc(spp()):epc(tev(e2p()))):e1p()==1?(spc(spp())!=0?spc(spp()):epc(0)):ls1(e1p())==0?(spc(spp())!=0?spc(spp()):epc(e1p())):epc(tev(e1p())))
      //  中間コード2
      //    e1p()==0?spc(spp())!=0?spc(spp()):epc(tev(e2p())):e1p()==1?spc(spp())!=0?spc(spp()):epc(0):ls1(e1p())==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())==0?(v1=spc(spp()))!=0?v1:epc(tev(e2p())):v0==1?(v6=spc(spp()))!=0?v6:epc(0):ls1(v0)==0?(v10=spc(spp()))!=0?v10:epc(v0):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())==0?(p=spc(spp()))!=0?p:epc(tev(e2p())):p==1?(p=spc(spp()))!=0?p:epc(0):ls1(p)==0?(q=spc(spp()))!=0?q:epc(p):epc(tev(p))
      //  中間コード5
      //    (p=e1p())==0?(p=spc(spp()))!=0?p:epc(e2p()&-2):p==1?(p=spc(spp()))!=0?p:epc(0):(p&1)==0?(q=spc(spp()))!=0?q:epc(p):epc(p&-2)
      //  中間コード6
      //    (p=e1p())==0?(p=spc(spp()))!=0?cto(p):epo(e2p()&-2):p==1?(p=spc(spp()))!=0?cto(p):epo(0):(p&1)==0?(q=spc(spp()))!=0?cto(q):epo(p):epo(p&-2)
      SE2_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                              p == 1 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE2_XWP

      //================================================================================
      //SE2_XHCT ($0000,$06xx,$1943)
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):ls1(epc(tev(v12=e2p())))!=0?mix(epc(v12),0):epc(v12)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),0):epc(p)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),0):epc(p)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
      SE2_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE2_XHCT

      //================================================================================
      //SE2_XHCG ($0000,$06xx,$1A43)
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v16=epc(tev(v18=e2p())))!=0?mix(v16,epc(tod(e2q()))):epc(v18)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):epc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):epc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):epo(q)
      SE2_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                  VideoController.vcnPal32G8[q]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE2_XHCG

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

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

      //================================================================================
      //SE2_XHPG ($0000,$06xx,$1E43)
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p())))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p())))
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2p())))
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p())))
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1))
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1)))
      SE2_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE2_XHPG

      //================================================================================
      //SE2_XHPGT ($0000,$06xx,$1F43)
      //  概要
      //    SE2  スプライト＞512ドット16色2プレーン
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0)))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0)
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2p()))),0)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2p()))),0)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2p()|1)),0)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2p()|1)),0))
      SE2_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                  0)]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                      0)]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE2_XHPGT

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

      //================================================================================
      //XSE3
      //  概要
      //    SE3  スプライト＞512ドット16色3プレーン
      //    拡張あり
      XSE3 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SE3_XWC
          case 0b00010001:  //SE3_XWC
          case 0b00010010:  //SE3_XWC
          case 0b00010011:  //SE3_XWC
            SE3_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SE3_XWP
          case 0b00010101:  //SE3_XWP
          case 0b00010110:  //SE3_XWP
          case 0b00010111:  //SE3_XWP
            SE3_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SE3_XHC
            SE3.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SE3_XHCT
            SE3_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SE3_XHCG
            SE3_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SE3_XHCGT
            SE3_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SE3_XHPT
            SE3_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SE3_XHPG
            SE3_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SE3_XHPGT
            SE3_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SE3_A
          case 0b01000001:  //SE3_A
          case 0b01000010:  //SE3_A
          case 0b01000011:  //SE3_A
          case 0b01000100:  //SE3_A
          case 0b01000101:  //SE3_A
          case 0b01000110:  //SE3_A
          case 0b01000111:  //SE3_A
          case 0b01001000:  //SE3_A
          case 0b01001001:  //SE3_A
          case 0b01001010:  //SE3_A
          case 0b01001011:  //SE3_A
          case 0b01001100:  //SE3_A
          case 0b01001101:  //SE3_A
          case 0b01001110:  //SE3_A
          case 0b01001111:  //SE3_A
          case 0b01010000:  //SE3_A
          case 0b01010001:  //SE3_A
          case 0b01010010:  //SE3_A
          case 0b01010011:  //SE3_A
          case 0b01010100:  //SE3_A
          case 0b01010101:  //SE3_A
          case 0b01010110:  //SE3_A
          case 0b01010111:  //SE3_A
          case 0b01011000:  //SE3_A
          case 0b01011001:  //SE3_A
          case 0b01011010:  //SE3_A
          case 0b01011011:  //SE3_A
          case 0b01011100:  //SE3_A
          case 0b01011101:  //SE3_A
          case 0b01011110:  //SE3_A
          case 0b01011111:  //SE3_A
            E3_A.drawRaster (src, dst, rh);
            break;
          default:
            SE3.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSE3);
          }  //switch
        }  //drawRaster
      },  //XSE3

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

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

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

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

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

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

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

      //================================================================================
      //SE3_XHPGT ($0000,$06xx,$1F47)
      //  概要
      //    SE3  スプライト＞512ドット16色3プレーン
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //          3番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):epc(tev(e3p()))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):epc(tev(e3p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):epc(tev(e3p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):epc(tev(e3p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):epc(e3p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):epo(e3p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0))
      SE3_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                  0)]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                      0)]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE3_XHPGT

      //================================================================================
      //SE4 ($0000,$06xx,$004F)
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    拡張なし
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットが0でないとき
      //          2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットが0のとき)
      //          3番目のパレットが0でないとき
      //            3番目のカラー(0は黒)
      //          さもなくば(3番目のパレットが0のとき)
      //            4番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):(e3p()!=0?epc(e3p()):epc(e4p())))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):e3p()!=0?epc(e3p()):epc(e4p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):(v6=e3p())!=0?epc(v6):epc(e4p())
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p())
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p())
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):(p=e3p())!=0?epo(p):epo(e4p())
      SE4 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE4

      //================================================================================
      //XSE4
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    拡張あり
      XSE4 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SE4_XWC
          case 0b00010001:  //SE4_XWC
          case 0b00010010:  //SE4_XWC
          case 0b00010011:  //SE4_XWC
            SE4_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SE4_XWP
          case 0b00010101:  //SE4_XWP
          case 0b00010110:  //SE4_XWP
          case 0b00010111:  //SE4_XWP
            SE4_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SE4_XHC
            SE4.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SE4_XHCT
            SE4_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SE4_XHCG
            SE4_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SE4_XHCGT
            SE4_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SE4_XHPT
            SE4_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SE4_XHPG
            SE4_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SE4_XHPGT
            SE4_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SE4_A
          case 0b01000001:  //SE4_A
          case 0b01000010:  //SE4_A
          case 0b01000011:  //SE4_A
          case 0b01000100:  //SE4_A
          case 0b01000101:  //SE4_A
          case 0b01000110:  //SE4_A
          case 0b01000111:  //SE4_A
          case 0b01001000:  //SE4_A
          case 0b01001001:  //SE4_A
          case 0b01001010:  //SE4_A
          case 0b01001011:  //SE4_A
          case 0b01001100:  //SE4_A
          case 0b01001101:  //SE4_A
          case 0b01001110:  //SE4_A
          case 0b01001111:  //SE4_A
          case 0b01010000:  //SE4_A
          case 0b01010001:  //SE4_A
          case 0b01010010:  //SE4_A
          case 0b01010011:  //SE4_A
          case 0b01010100:  //SE4_A
          case 0b01010101:  //SE4_A
          case 0b01010110:  //SE4_A
          case 0b01010111:  //SE4_A
          case 0b01011000:  //SE4_A
          case 0b01011001:  //SE4_A
          case 0b01011010:  //SE4_A
          case 0b01011011:  //SE4_A
          case 0b01011100:  //SE4_A
          case 0b01011101:  //SE4_A
          case 0b01011110:  //SE4_A
          case 0b01011111:  //SE4_A
            E4_A.drawRaster (src, dst, rh);
            break;
          default:
            SE4.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSE4);
          }  //switch
        }  //drawRaster
      },  //XSE4

      //================================================================================
      //SE4_XWC ($0000,$06xx,$104F)
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          スプライトカラーが0でないとき
      //            スプライトカラー
      //          さもなくば(スプライトカラーが0のとき)
      //            2番目のカラー(0は黒)
      //      さもなくば(2番目のパレットが0のとき)
      //        3番目のパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            スプライトカラーが0でないとき
      //              スプライトカラー
      //            さもなくば(スプライトカラーが0のとき)
      //              3番目のカラー(0は黒)
      //        さもなくば(3番目のパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            4番目のカラー(0は黒)
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            スプライトカラーが0でないとき
      //              スプライトカラー
      //            さもなくば(スプライトカラーが0のとき)
      //              4番目のカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(spc(spp())!=0?spc(spp()):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(spc(spp())!=0?spc(spp()):epc(e2p()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(spc(spp())!=0?spc(spp()):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(spc(spp())!=0?spc(spp()):epc(e4p()))))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):spc(spp())!=0?spc(spp()):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):spc(spp())!=0?spc(spp()):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):spc(spp())!=0?spc(spp()):epc(e3p()):ls1(epc(tev(e4p())))!=0?epc(e4p()):spc(spp())!=0?spc(spp()):epc(e4p())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=spc(spp()))!=0?v5:epc(v0):(v8=e2p())!=0?ls1(epc(tev(v8)))!=0?epc(v8):(v13=spc(spp()))!=0?v13:epc(v8):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?epc(v16):(v21=spc(spp()))!=0?v21:epc(v16):ls1(epc(tev(v27=e4p())))!=0?epc(v27):(v29=spc(spp()))!=0?v29:epc(v27)
      //  中間コード4
      //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=spc(spp()))!=0?q:epc(p)
      //  中間コード5
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spc(spp()))!=0?q:epc(p):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=spc(spp()))!=0?q:epc(p)
      //  中間コード6
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spc(spp()))!=0?cto(q):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spc(spp()))!=0?cto(q):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spc(spp()))!=0?cto(q):epo(p):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=spc(spp()))!=0?cto(q):epo(p)
      SE4_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE4_XWC

      //================================================================================
      //SE4_XWP ($0000,$06xx,$144F)
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        2番目のパレットを偶数化したパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //          3番目のパレットを偶数化したパレットが0でないとき
      //            3番目のパレットを偶数化したパレットのカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
      //            4番目のパレットを偶数化したパレットのカラー(0は黒)
      //    1番目のパレットが1のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?(spc(spp())!=0?spc(spp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p()))))):e1p()==1?(spc(spp())!=0?spc(spp()):epc(0)):ls1(e1p())==0?(spc(spp())!=0?spc(spp()):epc(e1p())):epc(tev(e1p())))
      //  中間コード2
      //    e1p()==0?spc(spp())!=0?spc(spp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?spc(spp())!=0?spc(spp()):epc(0):ls1(e1p())==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())==0?(v1=spc(spp()))!=0?v1:(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v0==1?(v12=spc(spp()))!=0?v12:epc(0):ls1(v0)==0?(v16=spc(spp()))!=0?v16:epc(v0):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())==0?(p=spc(spp()))!=0?p:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?(p=spc(spp()))!=0?p:epc(0):ls1(p)==0?(q=spc(spp()))!=0?q:epc(p):epc(tev(p))
      //  中間コード5
      //    (p=e1p())==0?(p=spc(spp()))!=0?p:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?(p=spc(spp()))!=0?p:epc(0):(p&1)==0?(q=spc(spp()))!=0?q:epc(p):epc(p&-2)
      //  中間コード6
      //    (p=e1p())==0?(p=spc(spp()))!=0?cto(p):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?(p=spc(spp()))!=0?cto(p):epo(0):(p&1)==0?(q=spc(spp()))!=0?cto(q):epo(p):epo(p&-2)
      SE4_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                              p == 1 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE4_XWP

      //================================================================================
      //SE4_XHCT ($0000,$06xx,$194F)
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
      //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットが0のとき)
      //          3番目のパレットが0でないとき
      //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //              3番目のカラーとカラー0を混ぜたカラー(0は黒)
      //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //              3番目のカラー(0は黒)
      //          さもなくば(3番目のパレットが0のとき)
      //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
      //              4番目のカラーとカラー0を混ぜたカラー(0は黒)
      //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //              4番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()))))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),0):epc(v16):ls1(epc(tev(v26=e4p())))!=0?mix(epc(v26),0):epc(v26)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
      SE4_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE4_XHCT

      //================================================================================
      //SE4_XHCG ($0000,$06xx,$1A4F)
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットが0のとき)
      //          3番目のパレットが0でないとき
      //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
      //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //              3番目のパレットが奇数のとき
      //                パレット1のカラー(0は黒)
      //              さもなくば(3番目のパレットが偶数のとき)
      //                3番目のカラー(0は黒)
      //          さもなくば(3番目のパレットが0のとき)
      //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
      //              4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
      //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //              4番目のパレットが奇数のとき
      //                パレット1のカラー(0は黒)
      //              さもなくば(4番目のパレットが偶数のとき)
      //                4番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p())))))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):(v24=e3p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(1)):ls1(v24)!=0?epc(1):epc(v24):ls1(v34=epc(tev(v36=e4p())))!=0?mix(v34,epc(1)):ls1(v36)!=0?epc(1):epc(v36)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q)
      SE4_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[1] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[1] :
                                  VideoController.vcnPal32G8[q]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE4_XHCG

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

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

      //================================================================================
      //SE4_XHPG ($0000,$06xx,$1E4F)
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //          3番目のパレットを偶数化したパレットが0でないとき
      //            3番目のパレットを偶数化したパレットのカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
      //            4番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q())))
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q())))
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1))
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1)))
      SE4_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE4_XHPG

      //================================================================================
      //SE4_XHPGT ($0000,$06xx,$1F4F)
      //  概要
      //    SE4  スプライト＞512ドット16色4プレーン
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0のとき
      //        2番目のパレットを偶数化したパレットが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //          3番目のパレットを偶数化したパレットが0でないとき
      //            3番目のパレットを偶数化したパレットのカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
      //            4番目のパレットを偶数化したパレットのカラー(0は黒)
      //      1番目のパレットが1のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0))
      SE4_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                  0)]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                  p == 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                      0)]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SE4_XHPGT

      //================================================================================
      //SF1 ($0001,$06xx,$0043)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    拡張なし
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):fpc(f1p()))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):fpc(f1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:fpc(f1p())
      //  中間コード4
      //    (p=spc(spp()))!=0?p:fpc(f1p())
      //  中間コード5
      //    (p=spc(spp()))!=0?p:fpc(f1p())
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):fpo(f1p())
      SF1 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st & 511])]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1

      //================================================================================
      //XSF1
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    拡張あり
      XSF1 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SF1_XWC
          case 0b00010001:  //SF1_XWC
          case 0b00010010:  //SF1_XWC
          case 0b00010011:  //SF1_XWC
            SF1_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SF1_XWP
          case 0b00010101:  //SF1_XWP
          case 0b00010110:  //SF1_XWP
          case 0b00010111:  //SF1_XWP
            SF1_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SF1_XHC
            SF1.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SF1_XHCT
            SF1_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SF1_XHCG
            SF1_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SF1_XHCGT
            SF1_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SF1_XHPT
            SF1_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SF1_XHPG
            SF1_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SF1_XHPGT
            SF1_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SF1_A
          case 0b01000001:  //SF1_A
          case 0b01000010:  //SF1_A
          case 0b01000011:  //SF1_A
          case 0b01000100:  //SF1_A
          case 0b01000101:  //SF1_A
          case 0b01000110:  //SF1_A
          case 0b01000111:  //SF1_A
          case 0b01001000:  //SF1_A
          case 0b01001001:  //SF1_A
          case 0b01001010:  //SF1_A
          case 0b01001011:  //SF1_A
          case 0b01001100:  //SF1_A
          case 0b01001101:  //SF1_A
          case 0b01001110:  //SF1_A
          case 0b01001111:  //SF1_A
          case 0b01010000:  //SF1_A
          case 0b01010001:  //SF1_A
          case 0b01010010:  //SF1_A
          case 0b01010011:  //SF1_A
          case 0b01010100:  //SF1_A
          case 0b01010101:  //SF1_A
          case 0b01010110:  //SF1_A
          case 0b01010111:  //SF1_A
          case 0b01011000:  //SF1_A
          case 0b01011001:  //SF1_A
          case 0b01011010:  //SF1_A
          case 0b01011011:  //SF1_A
          case 0b01011100:  //SF1_A
          case 0b01011101:  //SF1_A
          case 0b01011110:  //SF1_A
          case 0b01011111:  //SF1_A
            F1_A.drawRaster (src, dst, rh);
            break;
          default:
            SF1.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSF1);
          }  //switch
        }  //drawRaster
      },  //XSF1

      //================================================================================
      //SF1_XWC ($0001,$06xx,$1043)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(spc(spp())!=0?spc(spp()):fpc(f1p())))
      //  中間コード2
      //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):spc(spp())!=0?spc(spp()):fpc(f1p())
      //  中間コード3
      //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=spc(spp()))!=0?v5:fpc(v3)
      //  中間コード4
      //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=spc(spp()))!=0?q:fpc(p)
      //  中間コード5
      //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=spc(spp()))!=0?q:fpc(p)
      //  中間コード6
      //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=spc(spp()))!=0?cto(q):fpo(p)
      SF1_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                              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[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                  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[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                  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[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                  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[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                  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[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                  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[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                  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[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XWC

      //================================================================================
      //SF1_XWP ($0001,$06xx,$1443)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (f1p()<=1?(spc(spp())!=0?spc(spp()):fpc(0)):ls1(f1p())==0?(spc(spp())!=0?spc(spp()):fpc(f1p())):fpc(tev(f1p())))
      //  中間コード2
      //    f1p()<=1?spc(spp())!=0?spc(spp()):fpc(0):ls1(f1p())==0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(tev(f1p()))
      //  中間コード3
      //    (v0=f1p())<=1?(v1=spc(spp()))!=0?v1:fpc(0):ls1(v0)==0?(v5=spc(spp()))!=0?v5:fpc(v0):fpc(tev(v0))
      //  中間コード4
      //    (p=f1p())<=1?(p=spc(spp()))!=0?p:fpc(0):ls1(p)==0?(q=spc(spp()))!=0?q:fpc(p):fpc(tev(p))
      //  中間コード5
      //    (p=f1p())<=1?(p=spc(spp()))!=0?p:fpc(0):(p&1)==0?(q=spc(spp()))!=0?q:fpc(p):fpc(p&-2)
      //  中間コード6
      //    (p=f1p())<=1?(p=spc(spp()))!=0?cto(p):fpo(0):(p&1)==0?(q=spc(spp()))!=0?cto(q):fpo(p):fpo(p&-2)
      SF1_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XWP

      //================================================================================
      //SF1_XHCT ($0001,$06xx,$1943)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:ls1(fpc(tev(v5=f1p())))!=0?mix(fpc(v5),0):fpc(v5)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),0):fpc(p)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),0):fpc(p)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p)
      SF1_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XHCT

      //================================================================================
      //SF1_XHCG ($0001,$06xx,$1A43)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(v3,fpc(tod(f2q()))):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?fpc(tod(f2q())):fpc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?fpc(f2q()|1):fpc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?fpo(f2q()|1):fpo(q)
      SF1_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XHCG

      //================================================================================
      //SF1_XHCGT ($0001,$06xx,$1B43)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(mix(v3,fpc(tod(f2q()))),0):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),0):ls1(q)!=0?fpc(tod(f2q())):fpc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),0):(q&1)!=0?fpc(f2q()|1):fpc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),0)):(q&1)!=0?fpo(f2q()|1):fpo(q)
      SF1_XHCGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                      0)] :
                                  (q & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                  VideoController.vcnPal32G8[q]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XHCGT

      //================================================================================
      //SF1_XHPT ($0001,$06xx,$1D43)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0)))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0)
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=f1p())<=1?fpc(0):ls1(v2)==0?fpc(v2):mix(fpc(tev(v2)),0)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),0)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),0)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),0))
      SF1_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      0)]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XHPT

      //================================================================================
      //SF1_XHPG ($0001,$06xx,$1E43)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2q())))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2q())))
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=f1p())<=1?fpc(0):ls1(v2)==0?fpc(v2):mix(fpc(tev(v2)),fpc(tod(f2q())))
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),fpc(tod(f2q())))
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),fpc(f2q()|1))
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),fpc(f2q()|1)))
      SF1_XHPG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XHPG

      //================================================================================
      //SF1_XHPGT ($0001,$06xx,$1F43)
      //  概要
      //    SF1  スプライト＞512ドット256色1プレーン
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが1以下のとき
      //        グラフィックパレット0のカラー(0は黒)
      //      1番目のパレットが2以上の偶数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが3以上の奇数のとき)
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0)))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0)
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=f1p())<=1?fpc(0):ls1(v2)==0?fpc(v2):mix(mix(fpc(tev(v2)),fpc(tod(f2q()))),0)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(mix(fpc(tev(p)),fpc(tod(f2q()))),0)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(mix(fpc(p&-2),fpc(f2q()|1)),0)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(mix(fpc(p&-2),fpc(f2q()|1)),0))
      SF1_XHPGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                  0)]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                      0)]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                      0)]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF1_XHPGT

      //================================================================================
      //SF2 ($0001,$06xx,$004F)
      //  概要
      //    SF2  スプライト＞512ドット256色2プレーン
      //    拡張なし
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(f1p()!=0?fpc(f1p()):fpc(f2p())))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):f1p()!=0?fpc(f1p()):fpc(f2p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=f1p())!=0?fpc(v2):fpc(f2p())
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?fpc(p):fpc(f2p())
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?fpc(p):fpc(f2p())
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=f1p())!=0?fpo(p):fpo(f2p())
      SF2 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd & 511])]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF2

      //================================================================================
      //XSF2
      //  概要
      //    SF2  スプライト＞512ドット256色2プレーン
      //    拡張あり
      XSF2 {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
            //   .A.XHPGT
          case 0b00010000:  //SF2_XWC
          case 0b00010001:  //SF2_XWC
          case 0b00010010:  //SF2_XWC
          case 0b00010011:  //SF2_XWC
            SF2_XWC.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00010100:  //SF2_XWP
          case 0b00010101:  //SF2_XWP
          case 0b00010110:  //SF2_XWP
          case 0b00010111:  //SF2_XWP
            SF2_XWP.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011000:  //SF2_XHC
            SF2.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011001:  //SF2_XHCT
            SF2_XHCT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011010:  //SF2_XHCG
            SF2_XHCG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011011:  //SF2_XHCGT
            SF2_XHCGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011101:  //SF2_XHPT
            SF2_XHPT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011110:  //SF2_XHPG
            SF2_XHPG.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b00011111:  //SF2_XHPGT
            SF2_XHPGT.drawRaster (src, dst, rh);
            break;
            //   .A.XHPGT
          case 0b01000000:  //SF2_A
          case 0b01000001:  //SF2_A
          case 0b01000010:  //SF2_A
          case 0b01000011:  //SF2_A
          case 0b01000100:  //SF2_A
          case 0b01000101:  //SF2_A
          case 0b01000110:  //SF2_A
          case 0b01000111:  //SF2_A
          case 0b01001000:  //SF2_A
          case 0b01001001:  //SF2_A
          case 0b01001010:  //SF2_A
          case 0b01001011:  //SF2_A
          case 0b01001100:  //SF2_A
          case 0b01001101:  //SF2_A
          case 0b01001110:  //SF2_A
          case 0b01001111:  //SF2_A
          case 0b01010000:  //SF2_A
          case 0b01010001:  //SF2_A
          case 0b01010010:  //SF2_A
          case 0b01010011:  //SF2_A
          case 0b01010100:  //SF2_A
          case 0b01010101:  //SF2_A
          case 0b01010110:  //SF2_A
          case 0b01010111:  //SF2_A
          case 0b01011000:  //SF2_A
          case 0b01011001:  //SF2_A
          case 0b01011010:  //SF2_A
          case 0b01011011:  //SF2_A
          case 0b01011100:  //SF2_A
          case 0b01011101:  //SF2_A
          case 0b01011110:  //SF2_A
          case 0b01011111:  //SF2_A
            F2_A.drawRaster (src, dst, rh);
            break;
          default:
            SF2.drawRaster (src, dst, rh);
            VideoController.vcnReportUnimplemented (XSF2);
          }  //switch
        }  //drawRaster
      },  //XSF2

      //================================================================================
      //SF2_XWC ($0001,$06xx,$104F)
      //  概要
      //    SF2  スプライト＞512ドット256色2プレーン
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        スプライトカラーが0でないとき
      //          スプライトカラー
      //        さもなくば(スプライトカラーが0のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(spc(spp())!=0?spc(spp()):fpc(f1p()))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(spc(spp())!=0?spc(spp()):fpc(f2p()))))
      //  中間コード2
      //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):spc(spp())!=0?spc(spp()):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):spc(spp())!=0?spc(spp()):fpc(f2p())
      //  中間コード3
      //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=spc(spp()))!=0?v5:fpc(v0):ls1(fpc(tev(v11=f2p())))!=0?fpc(v11):(v13=spc(spp()))!=0?v13:fpc(v11)
      //  中間コード4
      //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=spc(spp()))!=0?q:fpc(p):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=spc(spp()))!=0?q:fpc(p)
      //  中間コード5
      //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=spc(spp()))!=0?q:fpc(p):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=spc(spp()))!=0?q:fpc(p)
      //  中間コード6
      //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=spc(spp()))!=0?cto(q):fpo(p):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=spc(spp()))!=0?cto(q):fpo(p)
      SF2_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF2_XWC

      //================================================================================
      //SF2_XWP ($0001,$06xx,$144F)
      //  概要
      //    SF2  スプライト＞512ドット256色2プレーン
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        2番目のパレットを偶数化したパレットのカラー(0は黒)
      //    1番目のパレットが1のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        グラフィックパレット0のカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      スプライトカラーが0でないとき
      //        スプライトカラー
      //      さもなくば(スプライトカラーが0のとき)
      //        1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (f1p()==0?(spc(spp())!=0?spc(spp()):fpc(tev(f2p()))):f1p()==1?(spc(spp())!=0?spc(spp()):fpc(0)):ls1(f1p())==0?(spc(spp())!=0?spc(spp()):fpc(f1p())):fpc(tev(f1p())))
      //  中間コード2
      //    f1p()==0?spc(spp())!=0?spc(spp()):fpc(tev(f2p())):f1p()==1?spc(spp())!=0?spc(spp()):fpc(0):ls1(f1p())==0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(tev(f1p()))
      //  中間コード3
      //    (v0=f1p())==0?(v1=spc(spp()))!=0?v1:fpc(tev(f2p())):v0==1?(v6=spc(spp()))!=0?v6:fpc(0):ls1(v0)==0?(v10=spc(spp()))!=0?v10:fpc(v0):fpc(tev(v0))
      //  中間コード4
      //    (p=f1p())==0?(p=spc(spp()))!=0?p:fpc(tev(f2p())):p==1?(p=spc(spp()))!=0?p:fpc(0):ls1(p)==0?(q=spc(spp()))!=0?q:fpc(p):fpc(tev(p))
      //  中間コード5
      //    (p=f1p())==0?(p=spc(spp()))!=0?p:fpc(f2p()&-2):p==1?(p=spc(spp()))!=0?p:fpc(0):(p&1)==0?(q=spc(spp()))!=0?q:fpc(p):fpc(p&-2)
      //  中間コード6
      //    (p=f1p())==0?(p=spc(spp()))!=0?cto(p):fpo(f2p()&-2):p==1?(p=spc(spp()))!=0?cto(p):fpo(0):(p&1)==0?(q=spc(spp()))!=0?cto(q):fpo(p):fpo(p&-2)
      SF2_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                              p == 1 ?
                              (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (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[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32G8[0] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32G8[p] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF2_XWP

      //================================================================================
      //SF2_XHCT ($0001,$06xx,$194F)
      //  概要
      //    SF2  スプライト＞512ドット256色2プレーン
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のカラーとカラー0を混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=f1p())!=0?ls1(fpc(tev(v2)))!=0?mix(fpc(v2),0):fpc(v2):ls1(fpc(tev(v12=f2p())))!=0?mix(fpc(v12),0):fpc(v12)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),0):fpc(p):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),0):fpc(p)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),0):fpc(p):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),0):fpc(p)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p)
      SF2_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      0)] :
                                  VideoController.vcnPal32G8[p]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF2_XHCT

      //================================================================================
      //SF2_XHCG ($0001,$06xx,$1A4F)
      //  概要
      //    SF2  スプライト＞512ドット256色2プレーン
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=f1p())!=0?ls1(v4=fpc(tev(v2)))!=0?mix(v4,fpc(tod(f2q()))):ls1(v2)!=0?fpc(tod(f2q())):fpc(v2):ls1(v16=fpc(tev(v18=f2p())))!=0?mix(v16,fpc(tod(f2q()))):fpc(v18)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?fpc(tod(f2q())):fpc(p):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):fpc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?fpc(f2q()|1):fpc(p):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):fpc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(q,fpc(f2q()|1))):(p&1)!=0?fpo(f2q()|1):fpo(p):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):fpo(q)
      SF2_XHCG {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                  VideoController.vcnPal32G8[q]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //SF2_XHCG

      //================================================================================
      //SF2_XHCGT ($0001,$06xx,$1B4F)
      //  概要
      //    SF2  スプライト＞512ドット256色2プレーン
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    スプライトカラーが0でないとき
      //      スプライトカラー
      //    さもなくば(スプライトカラーが0のとき)
      //      1番目のパレットが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          1番目のパレットが奇数のとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
      //          さもなくば(1番目のパレットが偶数のとき)
      //            1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットが0のとき)
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラー(0は黒)
      //  中間コード1
      //    (spc(spp())!=0?spc(spp()):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))):(ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),0):fpc(f2p()))))
      //  中間コード2
      //    spc(spp())!=0?spc(spp()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),0):fpc(f2p())
      //  中間コード3
      //    (v0=spc(spp()))!=0?v0:(v2=f1p())!=0?ls1(v4=fpc(tev(v2)))!=0?mix(mix(v4,fpc(tod(f2q()))),0):ls1(v2)!=0?fpc(tod(f2q())):fpc(v2):ls1(v17=fpc(tev(v19=f2p())))!=0?mix(mix(v17,fpc(tod(f2q()))),0):fpc(v19)
      //  中間コード4
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(mix(q,fpc(tod(f2q()))),0):ls1(p)!=0?fpc(tod(f2q())):fpc(p):ls1(p=fpc(tev(q=f2p())))!=0?mix(mix(p,fpc(tod(f2q()))),0):fpc(q)
      //  中間コード5
      //    (p=spc(spp()))!=0?p:(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(mix(q,fpc(f2q()|1)),0):(p&1)!=0?fpc(f2q()|1):fpc(p):((p=fpc((q=f2p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),0):fpc(q)
      //  中間コード6
      //    (p=spc(spp()))!=0?cto(p):(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(mix(q,fpc(f2q()|1)),0)):(p&1)!=0?fpo(f2q()|1):fpo(p):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),0)):fpo(q)
      SF2_XHCGT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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;
            da += half;
          }
          while (da < db) {
            int p, q;
            XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                      0)] :
                                  (p & 1) != 0 ?
                                  VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                  VideoController.vcnPal32G8[p] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                      0)] :
                                  VideoController.vcnPal32G8[q]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (

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