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

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

      //================================================================================
      //E4S_XWC ($0000,$18xx,$104F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラーが0でないとき
      //            2番目のカラー
      //          さもなくば(2番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットが0のとき)
      //        3番目のパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            3番目のカラーが0でないとき
      //              3番目のカラー
      //            さもなくば(3番目のカラーが0のとき)
      //              スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            4番目のカラー(0は黒)
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            4番目のカラーが0でないとき
      //              4番目のカラー
      //            さもなくば(4番目のカラーが0のとき)
      //              スプライトカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):spc(spp()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):spc(spp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(epc(e3p())!=0?epc(e3p()):spc(spp()))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(epc(e4p())!=0?epc(e4p()):spc(spp()))))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):epc(e3p())!=0?epc(e3p()):spc(spp()):ls1(epc(tev(e4p())))!=0?epc(e4p()):epc(e4p())!=0?epc(e4p()):spc(spp())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:spc(spp()):(v8=e2p())!=0?ls1(epc(tev(v8)))!=0?epc(v8):(v13=epc(v8))!=0?v13:spc(spp()):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?epc(v16):(v21=epc(v16))!=0?v21:spc(spp()):ls1(epc(tev(v27=e4p())))!=0?epc(v27):(v29=epc(v27))!=0?v29:spc(spp())
      //  中間コード4
      //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:spc(spp()):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=epc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:spc(spp()):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):spo(spp())
      E4S_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.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XWC

      //================================================================================
      //E4S_XWP ($0000,$18xx,$144F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0のとき
      //      2番目のパレットを偶数化したパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
      //          スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //        3番目のパレットを偶数化したパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが0でないとき
      //            3番目のパレットを偶数化したパレットのカラー
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが0でないとき
      //            4番目のパレットを偶数化したパレットのカラー
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    1番目のパレットが1のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp())))):e1p()==1?(epc(0)!=0?epc(0):spc(spp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(spp())):epc(tev(e1p())))
      //  中間コード2
      //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp()):e1p()==1?epc(0)!=0?epc(0):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(spp()):epc(tev(e1p()))
      //  中間コード3
      //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:spc(spp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:spc(spp()):(v11=epc(tev(e4p())))!=0?v11:spc(spp()):v0==1?(v16=epc(0))!=0?v16:spc(spp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:spc(spp()):epc(tev(v0))
      //  中間コード4
      //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(tev(e4p())))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:spc(spp()):epc(tev(p))
      //  中間コード5
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()&-2))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):(p&1)==0?(q=epc(p))!=0?q:spc(spp()):epc(p&-2)
      //  中間コード6
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):spo(spp()):epo(p&-2)
      E4S_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 = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              p == 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  VideoController.vcnPal32G8[p & -2]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XWP

      //================================================================================
      //E4S_XHCT ($0000,$18xx,$194F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラーと
      //          スプライトカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のカラーと
      //            スプライトカラー(0は黒)
      //          を混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラーが0でないとき
      //            2番目のカラー
      //          さもなくば(2番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットが0のとき)
      //        3番目のパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のカラーと
      //              スプライトカラー(0は黒)
      //            を混ぜたカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            3番目のカラーが0でないとき
      //              3番目のカラー
      //            さもなくば(3番目のカラーが0のとき)
      //              スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            4番目のカラーと
      //              スプライトカラー(0は黒)
      //            を混ぜたカラー(0は黒)
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            4番目のカラーが0でないとき
      //              4番目のカラー
      //            さもなくば(4番目のカラーが0のとき)
      //              スプライトカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(spp())):(epc(e1p())!=0?epc(e1p()):spc(spp()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(spp())):(epc(e2p())!=0?epc(e2p()):spc(spp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(spp())):(epc(e3p())!=0?epc(e3p()):spc(spp()))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),spc(spp())):(epc(e4p())!=0?epc(e4p()):spc(spp()))))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(spp())):epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(spp())):epc(e2p())!=0?epc(e2p()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(spp())):epc(e3p())!=0?epc(e3p()):spc(spp()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),spc(spp())):epc(e4p())!=0?epc(e4p()):spc(spp())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),spc(spp())):(v8=epc(v0))!=0?v8:spc(spp()):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?mix(epc(v11),spc(spp())):(v19=epc(v11))!=0?v19:spc(spp()):(v22=e3p())!=0?ls1(epc(tev(v22)))!=0?mix(epc(v22),spc(spp())):(v30=epc(v22))!=0?v30:spc(spp()):ls1(epc(tev(v36=e4p())))!=0?mix(epc(v36),spc(spp())):(v41=epc(v36))!=0?v41:spc(spp())
      //  中間コード4
      //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp()):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp()):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(spp()))):(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(spp()))):(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(spp()))):(q=epc(p))!=0?cto(q):spo(spp()):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),spc(spp()))):(q=epc(p))!=0?cto(q):spo(spp())
      E4S_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, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XHCT

      //================================================================================
      //E4S_XHCG ($0000,$18xx,$1A4F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラーが0でないとき
      //            1番目のカラー
      //          さもなくば(1番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラーが0でないとき
      //            2番目のカラー
      //          さもなくば(2番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットが0のとき)
      //        3番目のパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            3番目のパレットが奇数のとき
      //              パレット1のカラーが0でないとき
      //                パレット1のカラー
      //              さもなくば(パレット1のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //            さもなくば(3番目のパレットが偶数のとき)
      //              3番目のカラーが0でないとき
      //                3番目のカラー
      //              さもなくば(3番目のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            4番目のパレットが奇数のとき
      //              パレット1のカラーが0でないとき
      //                パレット1のカラー
      //              さもなくば(パレット1のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //            さもなくば(4番目のパレットが偶数のとき)
      //              4番目のカラーが0でないとき
      //                4番目のカラー
      //              さもなくば(4番目のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):spc(spp())):(epc(e1p())!=0?epc(e1p()):spc(spp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):spc(spp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):spc(spp())):(epc(e3p())!=0?epc(e3p()):spc(spp())))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):spc(spp())):(epc(e4p())!=0?epc(e4p()):spc(spp())))))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):spc(spp()):epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):spc(spp()):epc(e3p())!=0?epc(e3p()):spc(spp()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):spc(spp()):epc(e4p())!=0?epc(e4p()):spc(spp())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:spc(spp()):(v14=epc(v0))!=0?v14:spc(spp()):(v17=e2p())!=0?ls1(v19=epc(tev(v17)))!=0?mix(v19,epc(tod(e2q()))):(v25=epc(v17))!=0?v25:spc(spp()):(v28=e3p())!=0?ls1(v30=epc(tev(v28)))!=0?mix(v30,epc(1)):ls1(v28)!=0?(v35=epc(1))!=0?v35:spc(spp()):(v38=epc(v28))!=0?v38:spc(spp()):ls1(v42=epc(tev(v44=e4p())))!=0?mix(v42,epc(1)):ls1(v44)!=0?(v48=epc(1))!=0?v48:spc(spp()):(v51=epc(v44))!=0?v51:spc(spp())
      //  中間コード4
      //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
      //  中間コード5
      //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
      //  中間コード6
      //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(spp()):(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?(p=epc(1))!=0?cto(p):spo(spp()):(q=epc(p))!=0?cto(q):spo(spp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):spo(spp()):(p=epc(q))!=0?cto(p):spo(spp())
      E4S_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 = 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 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (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])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (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 ?
                              (p = VideoController.vcnPal16G8[1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[q]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((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 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (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])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (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 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((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 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (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])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (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 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((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 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (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])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (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 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((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 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (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])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (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 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((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 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (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])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (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 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((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 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (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])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (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 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((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 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (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])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (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 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XHCG

      //================================================================================
      //E4S_XHCGT ($0000,$18xx,$1B4F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //          スプライトカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラーが0でないとき
      //            1番目のカラー
      //          さもなくば(1番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //            スプライトカラー(0は黒)
      //          を混ぜたカラー(0は黒)
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //          2番目のカラーが0でないとき
      //            2番目のカラー
      //          さもなくば(2番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットが0のとき)
      //        3番目のパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
      //              スプライトカラー(0は黒)
      //            を混ぜたカラー(0は黒)
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            3番目のパレットが奇数のとき
      //              パレット1のカラーが0でないとき
      //                パレット1のカラー
      //              さもなくば(パレット1のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //            さもなくば(3番目のパレットが偶数のとき)
      //              3番目のカラーが0でないとき
      //                3番目のカラー
      //              さもなくば(3番目のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
      //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
      //              スプライトカラー(0は黒)
      //            を混ぜたカラー(0は黒)
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //            4番目のパレットが奇数のとき
      //              パレット1のカラーが0でないとき
      //                パレット1のカラー
      //              さもなくば(パレット1のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //            さもなくば(4番目のパレットが偶数のとき)
      //              4番目のカラーが0でないとき
      //                4番目のカラー
      //              さもなくば(4番目のカラーが0のとき)
      //                スプライトカラー(0は黒)
      //  中間コード1
      //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(spp())):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):spc(spp())):(epc(e1p())!=0?epc(e1p()):spc(spp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(spp())):(epc(e2p())!=0?epc(e2p()):spc(spp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),spc(spp())):(ls1(e3p())!=0?(epc(1)!=0?epc(1):spc(spp())):(epc(e3p())!=0?epc(e3p()):spc(spp())))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),spc(spp())):(ls1(e4p())!=0?(epc(1)!=0?epc(1):spc(spp())):(epc(e4p())!=0?epc(e4p()):spc(spp())))))))
      //  中間コード2
      //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(spp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):spc(spp()):epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(spp())):epc(e2p())!=0?epc(e2p()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),spc(spp())):ls1(e3p())!=0?epc(1)!=0?epc(1):spc(spp()):epc(e3p())!=0?epc(e3p()):spc(spp()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),spc(spp())):ls1(e4p())!=0?epc(1)!=0?epc(1):spc(spp()):epc(e4p())!=0?epc(e4p()):spc(spp())
      //  中間コード3
      //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),spc(spp())):ls1(v0)!=0?(v12=epc(tod(e2q())))!=0?v12:spc(spp()):(v17=epc(v0))!=0?v17:spc(spp()):(v20=e2p())!=0?ls1(v22=epc(tev(v20)))!=0?mix(mix(v22,epc(tod(e2q()))),spc(spp())):(v31=epc(v20))!=0?v31:spc(spp()):(v34=e3p())!=0?ls1(v36=epc(tev(v34)))!=0?mix(mix(v36,epc(1)),spc(spp())):ls1(v34)!=0?(v44=epc(1))!=0?v44:spc(spp()):(v47=epc(v34))!=0?v47:spc(spp()):ls1(v51=epc(tev(v53=e4p())))!=0?mix(mix(v51,epc(1)),spc(spp())):ls1(v53)!=0?(v60=epc(1))!=0?v60:spc(spp()):(v63=epc(v53))!=0?v63:spc(spp())
      //  中間コード4
      //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),spc(spp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),spc(spp())):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),spc(spp())):ls1(p)!=0?(p=epc(1))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),spc(spp())):ls1(q)!=0?(p=epc(1))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
      //  中間コード5
      //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),spc(spp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),spc(spp())):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),spc(spp())):(p&1)!=0?(p=epc(1))!=0?p:spc(spp()):(q=epc(p))!=0?q:spc(spp()):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),spc(spp())):(q&1)!=0?(p=epc(1))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
      //  中間コード6
      //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),spc(spp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(spp()):(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),spc(spp()))):(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),spc(spp()))):(p&1)!=0?(p=epc(1))!=0?cto(p):spo(spp()):(q=epc(p))!=0?cto(q):spo(spp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),spc(spp()))):(q&1)!=0?(p=epc(1))!=0?cto(p):spo(spp()):(p=epc(q))!=0?cto(p):spo(spp())
      E4S_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 = 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]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (p & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (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]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (p & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[q]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XHCGT

      //================================================================================
      //E4S_XHPT ($0000,$18xx,$1D4F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが0のとき
      //      2番目のパレットを偶数化したパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
      //          スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //        3番目のパレットを偶数化したパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが0でないとき
      //            3番目のパレットを偶数化したパレットのカラー
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが0でないとき
      //            4番目のパレットを偶数化したパレットのカラー
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    1番目のパレットが1のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp())))):e1p()==1?(epc(0)!=0?epc(0):spc(spp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(spp())):mix(epc(tev(e1p())),spc(spp())))
      //  中間コード2
      //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp()):e1p()==1?epc(0)!=0?epc(0):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(spp()):mix(epc(tev(e1p())),spc(spp()))
      //  中間コード3
      //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:spc(spp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:spc(spp()):(v11=epc(tev(e4p())))!=0?v11:spc(spp()):v0==1?(v16=epc(0))!=0?v16:spc(spp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:spc(spp()):mix(epc(tev(v0)),spc(spp()))
      //  中間コード4
      //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(tev(e4p())))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:spc(spp()):mix(epc(tev(p)),spc(spp()))
      //  中間コード5
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()&-2))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):(p&1)==0?(q=epc(p))!=0?q:spc(spp()):mix(epc(p&-2),spc(spp()))
      //  中間コード6
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):spo(spp()):cto(mix(epc(p&-2),spc(spp())))
      E4S_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, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              p == 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XHPT

      //================================================================================
      //E4S_XHPG ($0000,$18xx,$1E4F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    1番目のパレットが0のとき
      //      2番目のパレットを偶数化したパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
      //          スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //        3番目のパレットを偶数化したパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが0でないとき
      //            3番目のパレットを偶数化したパレットのカラー
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが0でないとき
      //            4番目のパレットを偶数化したパレットのカラー
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    1番目のパレットが1のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp())))):e1p()==1?(epc(0)!=0?epc(0):spc(spp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(spp())):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):spc(spp())))
      //  中間コード2
      //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp()):e1p()==1?epc(0)!=0?epc(0):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(spp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):spc(spp())
      //  中間コード3
      //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:spc(spp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:spc(spp()):(v11=epc(tev(e4p())))!=0?v11:spc(spp()):v0==1?(v16=epc(0))!=0?v16:spc(spp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:spc(spp()):(v23=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v23:spc(spp())
      //  中間コード4
      //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(tev(e4p())))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:spc(spp()):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:spc(spp())
      //  中間コード5
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()&-2))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):(p&1)==0?(q=epc(p))!=0?q:spc(spp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:spc(spp())
      //  中間コード6
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):spo(spp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):spo(spp())
      E4S_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, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              p == 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnMix2 (
                                 VideoController.vcnPal16G8[p & -2],
                                 VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XHPG

      //================================================================================
      //E4S_XHPGT ($0000,$18xx,$1F4F)
      //  概要
      //    E4S  512ドット16色4プレーン＞スプライト
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが0のとき
      //      2番目のパレットを偶数化したパレットが0でないとき
      //        2番目のパレットを偶数化したパレットのカラーが0でないとき
      //          2番目のパレットを偶数化したパレットのカラー
      //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
      //          スプライトカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
      //        3番目のパレットを偶数化したパレットが0でないとき
      //          3番目のパレットを偶数化したパレットのカラーが0でないとき
      //            3番目のパレットを偶数化したパレットのカラー
      //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
      //          4番目のパレットを偶数化したパレットのカラーが0でないとき
      //            4番目のパレットを偶数化したパレットのカラー
      //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    1番目のパレットが1のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp())))):e1p()==1?(epc(0)!=0?epc(0):spc(spp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(spp())):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(spp())))
      //  中間コード2
      //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):spc(spp()):e1p()==1?epc(0)!=0?epc(0):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(spp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(spp()))
      //  中間コード3
      //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:spc(spp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:spc(spp()):(v11=epc(tev(e4p())))!=0?v11:spc(spp()):v0==1?(v16=epc(0))!=0?v16:spc(spp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:spc(spp()):mix(mix(epc(tev(v0)),epc(tod(e2q()))),spc(spp()))
      //  中間コード4
      //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(tev(e4p())))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:spc(spp()):mix(mix(epc(tev(p)),epc(tod(e2q()))),spc(spp()))
      //  中間コード5
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()&-2))!=0?p:spc(spp()):p==1?(p=epc(0))!=0?p:spc(spp()):(p&1)==0?(q=epc(p))!=0?q:spc(spp()):mix(mix(epc(p&-2),epc(e2q()|1)),spc(spp()))
      //  中間コード6
      //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):spo(spp()):cto(mix(mix(epc(p&-2),epc(e2q()|1)),spc(spp())))
      E4S_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, q;
            XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              p == 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
            XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
            XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
            XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
            XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
            XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
            XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
            XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //E4S_XHPGT

      //================================================================================
      //F1S ($0001,$18xx,$0043)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    拡張なし
      //  手順
      //    1番目のカラーが0でないとき
      //      1番目のカラー
      //    さもなくば(1番目のカラーが0のとき)
      //      スプライトカラー(0は黒)
      //  中間コード1
      //    (fpc(f1p())!=0?fpc(f1p()):spc(spp()))
      //  中間コード2
      //    fpc(f1p())!=0?fpc(f1p()):spc(spp())
      //  中間コード3
      //    (v0=fpc(f1p()))!=0?v0:spc(spp())
      //  中間コード4
      //    (p=fpc(f1p()))!=0?p:spc(spp())
      //  中間コード5
      //    (p=fpc(f1p()))!=0?p:spc(spp())
      //  中間コード6
      //    (p=fpc(f1p()))!=0?cto(p):spo(spp())
      F1S {
        @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.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                               GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S

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

      //================================================================================
      //F1S_XWC ($0001,$18xx,$1043)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(fpc(f1p())!=0?fpc(f1p()):spc(spp())))
      //  中間コード2
      //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(spp())
      //  中間コード3
      //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=fpc(v3))!=0?v5:spc(spp())
      //  中間コード4
      //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):spo(spp())
      F1S_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.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XWC

      //================================================================================
      //F1S_XWP ($0001,$18xx,$1443)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (f1p()<=1?(fpc(0)!=0?fpc(0):spc(spp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):spc(spp())):fpc(tev(f1p())))
      //  中間コード2
      //    f1p()<=1?fpc(0)!=0?fpc(0):spc(spp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):spc(spp()):fpc(tev(f1p()))
      //  中間コード3
      //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:spc(spp()):fpc(tev(v0))
      //  中間コード4
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=fpc(p))!=0?q:spc(spp()):fpc(tev(p))
      //  中間コード5
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):(p&1)==0?(q=fpc(p))!=0?q:spc(spp()):fpc(p&-2)
      //  中間コード6
      //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=fpc(p))!=0?cto(q):spo(spp()):fpo(p&-2)
      F1S_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.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              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.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  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.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  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.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  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.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  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.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  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.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  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.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XWP

      //================================================================================
      //F1S_XHCT ($0001,$18xx,$1943)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(spp())):(fpc(f1p())!=0?fpc(f1p()):spc(spp())))
      //  中間コード2
      //    ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(spp())):fpc(f1p())!=0?fpc(f1p()):spc(spp())
      //  中間コード3
      //    ls1(fpc(tev(v3=f1p())))!=0?mix(fpc(v3),spc(spp())):(v8=fpc(v3))!=0?v8:spc(spp())
      //  中間コード4
      //    ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),spc(spp()))):(q=fpc(p))!=0?cto(q):spo(spp())
      F1S_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, q;
            XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XHCT

      //================================================================================
      //F1S_XHCG ($0001,$18xx,$1A43)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のパレットが奇数のとき
      //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //          スプライトカラー(0は黒)
      //      さもなくば(1番目のパレットが偶数のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp())):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))))
      //  中間コード2
      //    ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp()):fpc(f1p())!=0?fpc(f1p()):spc(spp())
      //  中間コード3
      //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(v1,fpc(tod(f2q()))):ls1(v3)!=0?(v9=fpc(tod(f2q())))!=0?v9:spc(spp()):(v14=fpc(v3))!=0?v14:spc(spp())
      //  中間コード4
      //    ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:spc(spp()):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード5
      //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:spc(spp()):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード6
      //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):spo(spp()):(p=fpc(q))!=0?cto(p):spo(spp())
      F1S_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.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 ?
                              (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                               GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[q]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = (((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = (((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = (((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = (((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = (((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = (((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = (((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XHCG

      //================================================================================
      //F1S_XHCGT ($0001,$18xx,$1B43)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のパレットが奇数のとき
      //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //          スプライトカラー(0は黒)
      //      さもなくば(1番目のパレットが偶数のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),spc(spp())):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp())):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))))
      //  中間コード2
      //    ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),spc(spp())):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp()):fpc(f1p())!=0?fpc(f1p()):spc(spp())
      //  中間コード3
      //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(mix(v1,fpc(tod(f2q()))),spc(spp())):ls1(v3)!=0?(v12=fpc(tod(f2q())))!=0?v12:spc(spp()):(v17=fpc(v3))!=0?v17:spc(spp())
      //  中間コード4
      //    ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),spc(spp())):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:spc(spp()):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード5
      //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),spc(spp())):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:spc(spp()):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード6
      //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),spc(spp()))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):spo(spp()):(p=fpc(q))!=0?cto(p):spo(spp())
      F1S_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.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]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                               GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[q]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = (((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = (((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = (((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = (((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = (((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = (((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = (((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XHCGT

      //================================================================================
      //F1S_XHPT ($0001,$18xx,$1D43)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (f1p()<=1?(fpc(0)!=0?fpc(0):spc(spp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):spc(spp())):mix(fpc(tev(f1p())),spc(spp())))
      //  中間コード2
      //    f1p()<=1?fpc(0)!=0?fpc(0):spc(spp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):spc(spp()):mix(fpc(tev(f1p())),spc(spp()))
      //  中間コード3
      //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:spc(spp()):mix(fpc(tev(v0)),spc(spp()))
      //  中間コード4
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=fpc(p))!=0?q:spc(spp()):mix(fpc(tev(p)),spc(spp()))
      //  中間コード5
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):(p&1)==0?(q=fpc(p))!=0?q:spc(spp()):mix(fpc(p&-2),spc(spp()))
      //  中間コード6
      //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=fpc(p))!=0?cto(q):spo(spp()):cto(mix(fpc(p&-2),spc(spp())))
      F1S_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, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XHPT

      //================================================================================
      //F1S_XHPG ($0001,$18xx,$1E43)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (f1p()<=1?(fpc(0)!=0?fpc(0):spc(spp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):spc(spp())):(mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):spc(spp())))
      //  中間コード2
      //    f1p()<=1?fpc(0)!=0?fpc(0):spc(spp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):spc(spp()):mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):spc(spp())
      //  中間コード3
      //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:spc(spp()):(v8=mix(fpc(tev(v0)),fpc(tod(f2q()))))!=0?v8:spc(spp())
      //  中間コード4
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=fpc(p))!=0?q:spc(spp()):(q=mix(fpc(tev(p)),fpc(tod(f2q()))))!=0?q:spc(spp())
      //  中間コード5
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):(p&1)==0?(q=fpc(p))!=0?q:spc(spp()):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?q:spc(spp())
      //  中間コード6
      //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=fpc(p))!=0?cto(q):spo(spp()):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?cto(q):spo(spp())
      F1S_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, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnMix2 (
                                 VideoController.vcnPal16G8[p & -2],
                                 VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnMix2 (
                                     VideoController.vcnPal16G8[p & -2],
                                     VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XHPG

      //================================================================================
      //F1S_XHPGT ($0001,$18xx,$1F43)
      //  概要
      //    F1S  512ドット256色1プレーン＞スプライト
      //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (f1p()<=1?(fpc(0)!=0?fpc(0):spc(spp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):spc(spp())):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),spc(spp())))
      //  中間コード2
      //    f1p()<=1?fpc(0)!=0?fpc(0):spc(spp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):spc(spp()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),spc(spp()))
      //  中間コード3
      //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:spc(spp()):mix(mix(fpc(tev(v0)),fpc(tod(f2q()))),spc(spp()))
      //  中間コード4
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=fpc(p))!=0?q:spc(spp()):mix(mix(fpc(tev(p)),fpc(tod(f2q()))),spc(spp()))
      //  中間コード5
      //    (p=f1p())<=1?(p=fpc(0))!=0?p:spc(spp()):(p&1)==0?(q=fpc(p))!=0?q:spc(spp()):mix(mix(fpc(p&-2),fpc(f2q()|1)),spc(spp()))
      //  中間コード6
      //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=fpc(p))!=0?cto(q):spo(spp()):cto(mix(mix(fpc(p&-2),fpc(f2q()|1)),spc(spp())))
      F1S_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, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F1S_XHPGT

      //================================================================================
      //F2S ($0001,$18xx,$004F)
      //  概要
      //    F2S  512ドット256色2プレーン＞スプライト
      //    拡張なし
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のカラーが0でないとき
      //        2番目のカラー
      //      さもなくば(2番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (f1p()!=0?(fpc(f1p())!=0?fpc(f1p()):spc(spp())):(fpc(f2p())!=0?fpc(f2p()):spc(spp())))
      //  中間コード2
      //    f1p()!=0?fpc(f1p())!=0?fpc(f1p()):spc(spp()):fpc(f2p())!=0?fpc(f2p()):spc(spp())
      //  中間コード3
      //    (v0=f1p())!=0?(v1=fpc(v0))!=0?v1:spc(spp()):(v4=fpc(f2p()))!=0?v4:spc(spp())
      //  中間コード4
      //    (p=f1p())!=0?(q=fpc(p))!=0?q:spc(spp()):(p=fpc(f2p()))!=0?p:spc(spp())
      //  中間コード5
      //    (p=f1p())!=0?(q=fpc(p))!=0?q:spc(spp()):(p=fpc(f2p()))!=0?p:spc(spp())
      //  中間コード6
      //    (p=f1p())!=0?(q=fpc(p))!=0?cto(q):spo(spp()):(p=fpc(f2p()))!=0?cto(p):spo(spp())
      F2S {
        @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 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                               GraphicScreen.graM4[gy3rd | gx3rd & 511])]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F2S

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

      //================================================================================
      //F2S_XWC ($0001,$18xx,$104F)
      //  概要
      //    F2S  512ドット256色2プレーン＞スプライト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        2番目のカラーが0でないとき
      //          2番目のカラー
      //        さもなくば(2番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //  中間コード1
      //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(fpc(f2p())!=0?fpc(f2p()):spc(spp()))))
      //  中間コード2
      //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(spp()):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):spc(spp())
      //  中間コード3
      //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=fpc(v0))!=0?v5:spc(spp()):ls1(fpc(tev(v11=f2p())))!=0?fpc(v11):(v13=fpc(v11))!=0?v13:spc(spp())
      //  中間コード4
      //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=fpc(p))!=0?q:spc(spp()):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:spc(spp()):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):spo(spp()):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):spo(spp())
      F2S_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.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            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.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F2S_XWC

      //================================================================================
      //F2S_XWP ($0001,$18xx,$144F)
      //  概要
      //    F2S  512ドット256色2プレーン＞スプライト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが0のとき
      //      2番目のパレットを偶数化したパレットのカラーが0でないとき
      //        2番目のパレットを偶数化したパレットのカラー
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが1のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (f1p()==0?(fpc(tev(f2p()))!=0?fpc(tev(f2p())):spc(spp())):f1p()==1?(fpc(0)!=0?fpc(0):spc(spp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):spc(spp())):fpc(tev(f1p())))
      //  中間コード2
      //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):spc(spp()):f1p()==1?fpc(0)!=0?fpc(0):spc(spp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):spc(spp()):fpc(tev(f1p()))
      //  中間コード3
      //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:spc(spp()):v0==1?(v6=fpc(0))!=0?v6:spc(spp()):ls1(v0)==0?(v10=fpc(v0))!=0?v10:spc(spp()):fpc(tev(v0))
      //  中間コード4
      //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:spc(spp()):p==1?(p=fpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=fpc(p))!=0?q:spc(spp()):fpc(tev(p))
      //  中間コード5
      //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:spc(spp()):p==1?(p=fpc(0))!=0?p:spc(spp()):(p&1)==0?(q=fpc(p))!=0?q:spc(spp()):fpc(p&-2)
      //  中間コード6
      //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):spo(spp()):p==1?(p=fpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=fpc(p))!=0?cto(q):spo(spp()):fpo(p&-2)
      F2S_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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                               GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              p == 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  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.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  p == 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  VideoController.vcnPal32G8[p & -2]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F2S_XWP

      //================================================================================
      //F2S_XHCT ($0001,$18xx,$194F)
      //  概要
      //    F2S  512ドット256色2プレーン＞スプライト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のカラーと
      //          スプライトカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のカラーが0でないとき
      //          1番目のカラー
      //        さもなくば(1番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のカラーと
      //          スプライトカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        2番目のカラーが0でないとき
      //          2番目のカラー
      //        さもなくば(2番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //  中間コード1
      //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(spp())):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),spc(spp())):(fpc(f2p())!=0?fpc(f2p()):spc(spp()))))
      //  中間コード2
      //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(spp())):fpc(f1p())!=0?fpc(f1p()):spc(spp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),spc(spp())):fpc(f2p())!=0?fpc(f2p()):spc(spp())
      //  中間コード3
      //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?mix(fpc(v0),spc(spp())):(v8=fpc(v0))!=0?v8:spc(spp()):ls1(fpc(tev(v14=f2p())))!=0?mix(fpc(v14),spc(spp())):(v19=fpc(v14))!=0?v19:spc(spp())
      //  中間コード4
      //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp()):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp()):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),spc(spp()))):(q=fpc(p))!=0?cto(q):spo(spp()):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),spc(spp()))):(q=fpc(p))!=0?cto(q):spo(spp())
      F2S_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, q;
            XEiJ.pnlBM[da] = ((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],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            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.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            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.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            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.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            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.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            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.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            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.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            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.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (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],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F2S_XHCT

      //================================================================================
      //F2S_XHCG ($0001,$18xx,$1A4F)
      //  概要
      //    F2S  512ドット256色2プレーン＞スプライト
      //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラーが0でないとき
      //            1番目のカラー
      //          さもなくば(1番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        2番目のカラーが0でないとき
      //          2番目のカラー
      //        さもなくば(2番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //  中間コード1
      //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp())):(fpc(f1p())!=0?fpc(f1p()):spc(spp())))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):(fpc(f2p())!=0?fpc(f2p()):spc(spp()))))
      //  中間コード2
      //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp()):fpc(f1p())!=0?fpc(f1p()):spc(spp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())!=0?fpc(f2p()):spc(spp())
      //  中間コード3
      //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(v2,fpc(tod(f2q()))):ls1(v0)!=0?(v9=fpc(tod(f2q())))!=0?v9:spc(spp()):(v14=fpc(v0))!=0?v14:spc(spp()):ls1(v18=fpc(tev(v20=f2p())))!=0?mix(v18,fpc(tod(f2q()))):(v25=fpc(v20))!=0?v25:spc(spp())
      //  中間コード4
      //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?(p=fpc(tod(f2q())))!=0?p:spc(spp()):(q=fpc(p))!=0?q:spc(spp()):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード5
      //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?(p=fpc(f2q()|1))!=0?p:spc(spp()):(q=fpc(p))!=0?q:spc(spp()):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード6
      //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(q,fpc(f2q()|1))):(p&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):spo(spp()):(q=fpc(p))!=0?cto(q):spo(spp()):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(p=fpc(q))!=0?cto(p):spo(spp())
      F2S_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 = (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 ?
                              (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                               GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              ((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])] :
                              (p = VideoController.vcnPal16G8[q]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  ((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])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  ((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])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  ((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])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  ((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])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  ((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])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  ((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])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((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 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  ((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])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F2S_XHCG

      //================================================================================
      //F2S_XHCGT ($0001,$18xx,$1B4F)
      //  概要
      //    F2S  512ドット256色2プレーン＞スプライト
      //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが0でないとき
      //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //          スプライトカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        1番目のパレットが奇数のとき
      //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
      //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
      //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
      //            スプライトカラー(0は黒)
      //        さもなくば(1番目のパレットが偶数のとき)
      //          1番目のカラーが0でないとき
      //            1番目のカラー
      //          さもなくば(1番目のカラーが0のとき)
      //            スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが0のとき)
      //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
      //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
      //          スプライトカラー(0は黒)
      //        を混ぜたカラー(0は黒)
      //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //        2番目のカラーが0でないとき
      //          2番目のカラー
      //        さもなくば(2番目のカラーが0のとき)
      //          スプライトカラー(0は黒)
      //  中間コード1
      //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),spc(spp())):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp())):(fpc(f1p())!=0?fpc(f1p()):spc(spp())))):(ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),spc(spp())):(fpc(f2p())!=0?fpc(f2p()):spc(spp()))))
      //  中間コード2
      //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),spc(spp())):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(spp()):fpc(f1p())!=0?fpc(f1p()):spc(spp()):ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),spc(spp())):fpc(f2p())!=0?fpc(f2p()):spc(spp())
      //  中間コード3
      //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(mix(v2,fpc(tod(f2q()))),spc(spp())):ls1(v0)!=0?(v12=fpc(tod(f2q())))!=0?v12:spc(spp()):(v17=fpc(v0))!=0?v17:spc(spp()):ls1(v21=fpc(tev(v23=f2p())))!=0?mix(mix(v21,fpc(tod(f2q()))),spc(spp())):(v31=fpc(v23))!=0?v31:spc(spp())
      //  中間コード4
      //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(mix(q,fpc(tod(f2q()))),spc(spp())):ls1(p)!=0?(p=fpc(tod(f2q())))!=0?p:spc(spp()):(q=fpc(p))!=0?q:spc(spp()):ls1(p=fpc(tev(q=f2p())))!=0?mix(mix(p,fpc(tod(f2q()))),spc(spp())):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード5
      //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(mix(q,fpc(f2q()|1)),spc(spp())):(p&1)!=0?(p=fpc(f2q()|1))!=0?p:spc(spp()):(q=fpc(p))!=0?q:spc(spp()):((p=fpc((q=f2p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),spc(spp())):(p=fpc(q))!=0?p:spc(spp())
      //  中間コード6
      //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(mix(q,fpc(f2q()|1)),spc(spp()))):(p&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):spo(spp()):(q=fpc(p))!=0?cto(q):spo(spp()):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),spc(spp()))):(p=fpc(q))!=0?cto(p):spo(spp())
      F2S_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 = (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]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (p & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                               GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              ((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]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (p = VideoController.vcnPal16G8[q]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  ((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]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        q,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (p & 1) != 0 ?
                                  (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                   GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                  ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                         GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnMix2 (
                                        p,
                                        VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                    GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (p = VideoController.vcnPal16G8[q]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //F2S_XHCGT

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

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

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

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

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

      //================================================================================
      //GS_XWC ($0003,$18xx,$104F)
      //  概要
      //    GS  512ドット65536色1プレーン＞スプライト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(gpc(tod(g1p()),tod(g1p())))!=0?gpc(g1p(),g1p()):(gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):spc(spp())))
      //  中間コード2
      //    ls1(gpc(tod(g1p()),tod(g1p())))!=0?gpc(g1p(),g1p()):gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):spc(spp())
      //  中間コード3
      //    ls1(gpc(v2=tod(v3=g1p()),v2))!=0?gpc(v3,v3):(v5=gpc(v3,v3))!=0?v5:spc(spp())
      //  中間コード4
      //    ls1(gpc(p=tod(q=g1p()),p))!=0?gpc(q,q):(p=gpc(q,q))!=0?p:spc(spp())
      //  中間コード5
      //    (gpc(p=(q=g1p())|1,p)&1)!=0?gpc(q,q):(p=gpc(q,q))!=0?p:spc(spp())
      //  中間コード6
      //    (gpc(p=(q=g1p())|1,p)&1)!=0?gpo(q,q):(p=gpc(q,q))!=0?cto(p):spo(spp())
      GS_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //1番目のパレットのbit11-8のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //1番目のパレットのbit15-12のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]] :
                              (p = (VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //GS_XWC

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

      //================================================================================
      //GS_XHCT ($0003,$18xx,$194F)
      //  概要
      //    GS  512ドット65536色1プレーン＞スプライト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(gpc(tod(g1p()),tod(g1p())))!=0?mix(gpc(g1p(),g1p()),spc(spp())):(gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):spc(spp())))
      //  中間コード2
      //    ls1(gpc(tod(g1p()),tod(g1p())))!=0?mix(gpc(g1p(),g1p()),spc(spp())):gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):spc(spp())
      //  中間コード3
      //    ls1(gpc(v2=tod(v3=g1p()),v2))!=0?mix(gpc(v3,v3),spc(spp())):(v8=gpc(v3,v3))!=0?v8:spc(spp())
      //  中間コード4
      //    ls1(gpc(p=tod(q=g1p()),p))!=0?mix(gpc(q,q),spc(spp())):(p=gpc(q,q))!=0?p:spc(spp())
      //  中間コード5
      //    (gpc(p=(q=g1p())|1,p)&1)!=0?mix(gpc(q,q),spc(spp())):(p=gpc(q,q))!=0?p:spc(spp())
      //  中間コード6
      //    (gpc(p=(q=g1p())|1,p)&1)!=0?cto(mix(gpc(q,q),spc(spp()))):(p=gpc(q,q))!=0?cto(p):spo(spp())
      GS_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //1番目のパレットのbit11-8のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //1番目のパレットのbit15-12のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                              (p = (VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
            XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
            XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
            XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
            XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
            XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
            XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
            XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                                                           GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                                                           GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                           GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
            sx += 8;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //GS_XHCT

      //================================================================================
      //GS_XHPT ($0003,$18xx,$1D4F)
      //  概要
      //    GS  512ドット65536色1プレーン＞スプライト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (g1p()<=1?(gpc(0,0)!=0?gpc(0,0):spc(spp())):ls1(g1p())==0?(gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):spc(spp())):mix(gpc(tev(g1p()),tev(g1p())),spc(spp())))
      //  中間コード2
      //    g1p()<=1?gpc(0,0)!=0?gpc(0,0):spc(spp()):ls1(g1p())==0?gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):spc(spp()):mix(gpc(tev(g1p()),tev(g1p())),spc(spp()))
      //  中間コード3
      //    (v0=g1p())<=1?(v1=gpc(0,0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=gpc(v0,v0))!=0?v5:spc(spp()):mix(gpc(v10=tev(v0),v10),spc(spp()))
      //  中間コード4
      //    (p=g1p())<=1?(p=gpc(0,0))!=0?p:spc(spp()):ls1(p)==0?(q=gpc(p,p))!=0?q:spc(spp()):mix(gpc(q=tev(p),q),spc(spp()))
      //  中間コード5
      //    (p=g1p())<=1?(p=gpc(0,0))!=0?p:spc(spp()):(p&1)==0?(q=gpc(p,p))!=0?q:spc(spp()):mix(gpc(q=p&-2,q),spc(spp()))
      //  中間コード6
      //    (p=g1p())<=1?(p=gpc(0,0))!=0?cto(p):spo(spp()):(p&1)==0?(q=gpc(p,p))!=0?cto(q):spo(spp()):cto(mix(gpc(q=p&-2,q),spc(spp())))
      GS_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
          int gx1st = CRTC.crtR12GrXCurr[pn];
          int gy1st = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
          int gx2nd = CRTC.crtR12GrXCurr[pn];
          int gy2nd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 4 & 3;  //1番目のパレットのbit11-8のGVRAMページ番号
          int gx3rd = CRTC.crtR12GrXCurr[pn];
          int gy3rd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          pn = VideoController.vcnReg2Curr >> 6 & 3;  //1番目のパレットのbit15-12のGVRAMページ番号
          int gx4th = CRTC.crtR12GrXCurr[pn];
          int gy4th = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
          int 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[gy4th | gx4th & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) <= 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]])]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                        GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                        GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  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[gy4th | gx4th + 2 & 511] << 12 |
                                        GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                        GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                  (p = (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[gy4th | gx4th + 3 & 511] << 12 |
                                        GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                        GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                  (p = (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[gy4th | gx4th + 4 & 511] << 12 |
                                        GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                        GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                  (p = (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[gy4th | gx4th + 5 & 511] << 12 |
                                        GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                        GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                  (p = (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[gy4th | gx4th + 6 & 511] << 12 |
                                        GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                        GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                  (p = (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[gy4th | gx4th + 7 & 511] << 12 |
                                        GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                        GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                  (p = (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;
            gx1st += 8;
            gx2nd += 8;
            gx3rd += 8;
            gx4th += 8;
            da += 8;
          }  //while da<db
        }  //drawRaster
      },  //GS_XHPT

      //================================================================================
      //HS ($0004,$18xx,$0050)
      //  概要
      //    HS  1024ドット16色1プレーン＞スプライト
      //    拡張なし
      //  手順
      //    1番目のカラーが0でないとき
      //      1番目のカラー
      //    さもなくば(1番目のカラーが0のとき)
      //      スプライトカラー(0は黒)
      //  中間コード1
      //    (hpc(h1p())!=0?hpc(h1p()):spc(spp()))
      //  中間コード2
      //    hpc(h1p())!=0?hpc(h1p()):spc(spp())
      //  中間コード3
      //    (v0=hpc(h1p()))!=0?v0:spc(spp())
      //  中間コード4
      //    (p=hpc(h1p()))!=0?p:spc(spp())
      //  中間コード5
      //    (p=hpc(h1p()))!=0?p:spc(spp())
      //  中間コード6
      //    (p=hpc(h1p()))!=0?cto(p):spo(spp())
      HS {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 1]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 2]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 3]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 4]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 5]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 6]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 7]]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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;
                XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[ga]]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //HS

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

      //================================================================================
      //HS_XWC ($0004,$18xx,$1050)
      //  概要
      //    HS  1024ドット16色1プレーン＞スプライト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(hpc(tev(h1p())))!=0?hpc(h1p()):(hpc(h1p())!=0?hpc(h1p()):spc(spp())))
      //  中間コード2
      //    ls1(hpc(tev(h1p())))!=0?hpc(h1p()):hpc(h1p())!=0?hpc(h1p()):spc(spp())
      //  中間コード3
      //    ls1(hpc(tev(v3=h1p())))!=0?hpc(v3):(v5=hpc(v3))!=0?v5:spc(spp())
      //  中間コード4
      //    ls1(hpc(tev(p=h1p())))!=0?hpc(p):(q=hpc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (hpc((p=h1p())&-2)&1)!=0?hpc(p):(q=hpc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (hpc((p=h1p())&-2)&1)!=0?hpo(p):(q=hpc(p))!=0?cto(q):spo(spp())
      HS_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 1]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 2]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 3]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[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] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //HS_XWC

      //================================================================================
      //HS_XWP ($0004,$18xx,$1450)
      //  概要
      //    HS  1024ドット16色1プレーン＞スプライト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (h1p()<=1?(hpc(0)!=0?hpc(0):spc(spp())):ls1(h1p())==0?(hpc(h1p())!=0?hpc(h1p()):spc(spp())):hpc(tev(h1p())))
      //  中間コード2
      //    h1p()<=1?hpc(0)!=0?hpc(0):spc(spp()):ls1(h1p())==0?hpc(h1p())!=0?hpc(h1p()):spc(spp()):hpc(tev(h1p()))
      //  中間コード3
      //    (v0=h1p())<=1?(v1=hpc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=hpc(v0))!=0?v5:spc(spp()):hpc(tev(v0))
      //  中間コード4
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=hpc(p))!=0?q:spc(spp()):hpc(tev(p))
      //  中間コード5
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:spc(spp()):(p&1)==0?(q=hpc(p))!=0?q:spc(spp()):hpc(p&-2)
      //  中間コード6
      //    (p=h1p())<=1?(p=hpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=hpc(p))!=0?cto(q):spo(spp()):hpo(p&-2)
      HS_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    VideoController.vcnPal32G8[p & -2]);
              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]) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  VideoController.vcnPal32G8[p & -2]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //HS_XWP

      //================================================================================
      //HS_XHCT ($0004,$18xx,$1950)
      //  概要
      //    HS  1024ドット16色1プレーン＞スプライト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),spc(spp())):(hpc(h1p())!=0?hpc(h1p()):spc(spp())))
      //  中間コード2
      //    ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),spc(spp())):hpc(h1p())!=0?hpc(h1p()):spc(spp())
      //  中間コード3
      //    ls1(hpc(tev(v3=h1p())))!=0?mix(hpc(v3),spc(spp())):(v8=hpc(v3))!=0?v8:spc(spp())
      //  中間コード4
      //    ls1(hpc(tev(p=h1p())))!=0?mix(hpc(p),spc(spp())):(q=hpc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (hpc((p=h1p())&-2)&1)!=0?mix(hpc(p),spc(spp())):(q=hpc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (hpc((p=h1p())&-2)&1)!=0?cto(mix(hpc(p),spc(spp()))):(q=hpc(p))!=0?cto(q):spo(spp())
      HS_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 1]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 2]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 3]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[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] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //HS_XHCT

      //================================================================================
      //HS_XHPT ($0004,$18xx,$1D50)
      //  概要
      //    HS  1024ドット16色1プレーン＞スプライト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (h1p()<=1?(hpc(0)!=0?hpc(0):spc(spp())):ls1(h1p())==0?(hpc(h1p())!=0?hpc(h1p()):spc(spp())):mix(hpc(tev(h1p())),spc(spp())))
      //  中間コード2
      //    h1p()<=1?hpc(0)!=0?hpc(0):spc(spp()):ls1(h1p())==0?hpc(h1p())!=0?hpc(h1p()):spc(spp()):mix(hpc(tev(h1p())),spc(spp()))
      //  中間コード3
      //    (v0=h1p())<=1?(v1=hpc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=hpc(v0))!=0?v5:spc(spp()):mix(hpc(tev(v0)),spc(spp()))
      //  中間コード4
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=hpc(p))!=0?q:spc(spp()):mix(hpc(tev(p)),spc(spp()))
      //  中間コード5
      //    (p=h1p())<=1?(p=hpc(0))!=0?p:spc(spp()):(p&1)==0?(q=hpc(p))!=0?q:spc(spp()):mix(hpc(p&-2),spc(spp()))
      //  中間コード6
      //    (p=h1p())<=1?(p=hpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=hpc(p))!=0?cto(q):spo(spp()):cto(mix(hpc(p&-2),spc(spp())))
      HS_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[ga]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
              XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
              XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
              XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
              XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
              XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
              XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
              XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        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]) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //HS_XHPT

      //================================================================================
      //IS ($0005,$18xx,$0050)
      //  概要
      //    IS  1024ドット256色1プレーン＞スプライト
      //    拡張なし
      //  手順
      //    1番目のカラーが0でないとき
      //      1番目のカラー
      //    さもなくば(1番目のカラーが0のとき)
      //      スプライトカラー(0は黒)
      //  中間コード1
      //    (ipc(i1p())!=0?ipc(i1p()):spc(spp()))
      //  中間コード2
      //    ipc(i1p())!=0?ipc(i1p()):spc(spp())
      //  中間コード3
      //    (v0=ipc(i1p()))!=0?v0:spc(spp())
      //  中間コード4
      //    (p=ipc(i1p()))!=0?p:spc(spp())
      //  中間コード5
      //    (p=ipc(i1p()))!=0?p:spc(spp())
      //  中間コード6
      //    (p=ipc(i1p()))!=0?cto(p):spo(spp())
      IS {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p;
              XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                 GraphicScreen.graM4[ga])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                     GraphicScreen.graM4[ga + 1])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                     GraphicScreen.graM4[ga + 2])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                     GraphicScreen.graM4[ga + 3])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                     GraphicScreen.graM4[ga + 4])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                     GraphicScreen.graM4[ga + 5])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                     GraphicScreen.graM4[ga + 6])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                     GraphicScreen.graM4[ga + 7])]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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;
                XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                   GraphicScreen.graM4[ga])]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //IS

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

      //================================================================================
      //IS_XWC ($0005,$18xx,$1050)
      //  概要
      //    IS  1024ドット256色1プレーン＞スプライト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(ipc(tev(i1p())))!=0?ipc(i1p()):(ipc(i1p())!=0?ipc(i1p()):spc(spp())))
      //  中間コード2
      //    ls1(ipc(tev(i1p())))!=0?ipc(i1p()):ipc(i1p())!=0?ipc(i1p()):spc(spp())
      //  中間コード3
      //    ls1(ipc(tev(v3=i1p())))!=0?ipc(v3):(v5=ipc(v3))!=0?v5:spc(spp())
      //  中間コード4
      //    ls1(ipc(tev(p=i1p())))!=0?ipc(p):(q=ipc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (ipc((p=i1p())&-2)&1)!=0?ipc(p):(q=ipc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (ipc((p=i1p())&-2)&1)!=0?ipo(p):(q=ipc(p))!=0?cto(q):spo(spp())
      IS_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                  GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                      GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                      GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                      GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                      GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                      GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                      GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                      GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                    VideoController.vcnPal32G8[p] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[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] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                    GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                  VideoController.vcnPal32G8[p] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //IS_XWC

      //================================================================================
      //IS_XWP ($0005,$18xx,$1450)
      //  概要
      //    IS  1024ドット256色1プレーン＞スプライト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (i1p()<=1?(ipc(0)!=0?ipc(0):spc(spp())):ls1(i1p())==0?(ipc(i1p())!=0?ipc(i1p()):spc(spp())):ipc(tev(i1p())))
      //  中間コード2
      //    i1p()<=1?ipc(0)!=0?ipc(0):spc(spp()):ls1(i1p())==0?ipc(i1p())!=0?ipc(i1p()):spc(spp()):ipc(tev(i1p()))
      //  中間コード3
      //    (v0=i1p())<=1?(v1=ipc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=ipc(v0))!=0?v5:spc(spp()):ipc(tev(v0))
      //  中間コード4
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:spc(spp()):ls1(p)==0?(q=ipc(p))!=0?q:spc(spp()):ipc(tev(p))
      //  中間コード5
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:spc(spp()):(p&1)==0?(q=ipc(p))!=0?q:spc(spp()):ipc(p&-2)
      //  中間コード6
      //    (p=i1p())<=1?(p=ipc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=ipc(p))!=0?cto(q):spo(spp()):ipo(p&-2)
      IS_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                          GraphicScreen.graM4[ga + 1])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                          GraphicScreen.graM4[ga + 2])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                          GraphicScreen.graM4[ga + 3])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                          GraphicScreen.graM4[ga + 4])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                          GraphicScreen.graM4[ga + 5])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                          GraphicScreen.graM4[ga + 6])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    VideoController.vcnPal32G8[p & -2]);
              XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                          GraphicScreen.graM4[ga + 7])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    VideoController.vcnPal32G8[p & -2]);
              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 + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  VideoController.vcnPal32G8[p & -2]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //IS_XWP

      //================================================================================
      //IS_XHCT ($0005,$18xx,$1950)
      //  概要
      //    IS  1024ドット256色1プレーン＞スプライト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),spc(spp())):(ipc(i1p())!=0?ipc(i1p()):spc(spp())))
      //  中間コード2
      //    ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),spc(spp())):ipc(i1p())!=0?ipc(i1p()):spc(spp())
      //  中間コード3
      //    ls1(ipc(tev(v3=i1p())))!=0?mix(ipc(v3),spc(spp())):(v8=ipc(v3))!=0?v8:spc(spp())
      //  中間コード4
      //    ls1(ipc(tev(p=i1p())))!=0?mix(ipc(p),spc(spp())):(q=ipc(p))!=0?q:spc(spp())
      //  中間コード5
      //    (ipc((p=i1p())&-2)&1)!=0?mix(ipc(p),spc(spp())):(q=ipc(p))!=0?q:spc(spp())
      //  中間コード6
      //    (ipc((p=i1p())&-2)&1)!=0?cto(mix(ipc(p),spc(spp()))):(q=ipc(p))!=0?cto(q):spo(spp())
      IS_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                  GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                      GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                      GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                      GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                      GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                      GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                      GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                      GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[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] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                    GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //IS_XHCT

      //================================================================================
      //IS_XHPT ($0005,$18xx,$1D50)
      //  概要
      //    IS  1024ドット256色1プレーン＞スプライト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (i1p()<=1?(ipc(0)!=0?ipc(0):spc(spp())):ls1(i1p())==0?(ipc(i1p())!=0?ipc(i1p()):spc(spp())):mix(ipc(tev(i1p())),spc(spp())))
      //  中間コード2
      //    i1p()<=1?ipc(0)!=0?ipc(0):spc(spp()):ls1(i1p())==0?ipc(i1p())!=0?ipc(i1p()):spc(spp()):mix(ipc(tev(i1p())),spc(spp()))
      //  中間コード3
      //    (v0=i1p())<=1?(v1=ipc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=ipc(v0))!=0?v5:spc(spp()):mix(ipc(tev(v0)),spc(spp()))
      //  中間コード4
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:spc(spp()):ls1(p)==0?(q=ipc(p))!=0?q:spc(spp()):mix(ipc(tev(p)),spc(spp()))
      //  中間コード5
      //    (p=i1p())<=1?(p=ipc(0))!=0?p:spc(spp()):(p&1)==0?(q=ipc(p))!=0?q:spc(spp()):mix(ipc(p&-2),spc(spp()))
      //  中間コード6
      //    (p=i1p())<=1?(p=ipc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=ipc(p))!=0?cto(q):spo(spp()):cto(mix(ipc(p&-2),spc(spp())))
      IS_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
              XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                          GraphicScreen.graM4[ga + 1])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
              XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                          GraphicScreen.graM4[ga + 2])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
              XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                          GraphicScreen.graM4[ga + 3])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
              XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                          GraphicScreen.graM4[ga + 4])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
              XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                          GraphicScreen.graM4[ga + 5])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
              XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                          GraphicScreen.graM4[ga + 6])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
              XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                          GraphicScreen.graM4[ga + 7])) <= 1 ?
                                    (p = VideoController.vcnPal16G8[0]) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    (p & 1) == 0 ?
                                    (q = VideoController.vcnPal16G8[p]) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        VideoController.vcnPal16G8[p & -2],
                                        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 + 1048576] << 4 |
                                        GraphicScreen.graM4[ga])) <= 1 ?
                                  (p = VideoController.vcnPal16G8[0]) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //IS_XHPT

      //================================================================================
      //JS ($0007,$18xx,$0050)
      //  概要
      //    JS  1024ドット65536色1プレーン＞スプライト
      //    拡張なし
      //  手順
      //    1番目のカラーが0でないとき
      //      1番目のカラー
      //    さもなくば(1番目のカラーが0のとき)
      //      スプライトカラー(0は黒)
      //  中間コード1
      //    (jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp()))
      //  中間コード2
      //    jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp())
      //  中間コード3
      //    (v0=jpc(v1=j1p(),v1))!=0?v0:spc(spp())
      //  中間コード4
      //    (p=jpc(q=j1p(),q))!=0?p:spc(spp())
      //  中間コード5
      //    (p=jpc(q=j1p(),q))!=0?p:spc(spp())
      //  中間コード6
      //    (p=jpc(q=j1p(),q))!=0?cto(p):spo(spp())
      JS {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                        GraphicScreen.graM4[ga])) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                            GraphicScreen.graM4[ga + 1])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                            GraphicScreen.graM4[ga + 2])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                            GraphicScreen.graM4[ga + 3])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                            GraphicScreen.graM4[ga + 4])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                            GraphicScreen.graM4[ga + 5])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                            GraphicScreen.graM4[ga + 6])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                            GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                            GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                            GraphicScreen.graM4[ga + 7])) >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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 = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                          GraphicScreen.graM4[ga])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //JS

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

      //================================================================================
      //JS_XWC ($0007,$18xx,$1050)
      //  概要
      //    JS  1024ドット65536色1プレーン＞スプライト
      //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp())))
      //  中間コード2
      //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp())
      //  中間コード3
      //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?jpc(v3,v3):(v5=jpc(v3,v3))!=0?v5:spc(spp())
      //  中間コード4
      //    ls1(jpc(p=tod(q=j1p()),p))!=0?jpc(q,q):(p=jpc(q,q))!=0?p:spc(spp())
      //  中間コード5
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpc(q,q):(p=jpc(q,q))!=0?p:spc(spp())
      //  中間コード6
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpo(q,q):(p=jpc(q,q))!=0?cto(p):spo(spp())
      JS_XWC {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                             GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                             GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                             GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                             GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                             GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                             GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                             GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //JS_XWC

      //================================================================================
      //JS_XWP ($0007,$18xx,$1450)
      //  概要
      //    JS  1024ドット65536色1プレーン＞スプライト
      //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラー(0は黒)
      //  中間コード1
      //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):spc(spp())):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp())):jpc(tev(j1p()),tev(j1p())))
      //  中間コード2
      //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):spc(spp()):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp()):jpc(tev(j1p()),tev(j1p()))
      //  中間コード3
      //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=jpc(v0,v0))!=0?v5:spc(spp()):jpc(v9=tev(v0),v9)
      //  中間コード4
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:spc(spp()):ls1(p)==0?(q=jpc(p,p))!=0?q:spc(spp()):jpc(q=tev(p),q)
      //  中間コード5
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:spc(spp()):(p&1)==0?(q=jpc(p,p))!=0?q:spc(spp()):jpc(q=p&-2,q)
      //  中間コード6
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):spo(spp()):(p&1)==0?(q=jpc(p,p))!=0?cto(q):spo(spp()):jpo(q=p&-2,q)
      JS_XWP {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int 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.vcnPal8G16H[(q = p & -2) >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
              XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                          GraphicScreen.graM4[ga + 1])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
              XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                          GraphicScreen.graM4[ga + 2])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
              XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                          GraphicScreen.graM4[ga + 3])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
              XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                          GraphicScreen.graM4[ga + 4])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
              XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                          GraphicScreen.graM4[ga + 5])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
              XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                          GraphicScreen.graM4[ga + 6])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
              XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                          GraphicScreen.graM4[ga + 7])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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.vcnPal8G16H[(q = p & -2) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255]]);
              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.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //JS_XWP

      //================================================================================
      //JS_XHCT ($0007,$18xx,$1950)
      //  概要
      //    JS  1024ドット65536色1プレーン＞スプライト
      //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
      //      1番目のカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //  中間コード1
      //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),spc(spp())):(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp())))
      //  中間コード2
      //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),spc(spp())):jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp())
      //  中間コード3
      //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?mix(jpc(v3,v3),spc(spp())):(v8=jpc(v3,v3))!=0?v8:spc(spp())
      //  中間コード4
      //    ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),spc(spp())):(p=jpc(q,q))!=0?p:spc(spp())
      //  中間コード5
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),spc(spp())):(p=jpc(q,q))!=0?p:spc(spp())
      //  中間コード6
      //    (jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),spc(spp()))):(p=jpc(q,q))!=0?cto(p):spo(spp())
      JS_XHCT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int p, q;
              XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
              XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                             GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
              XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                             GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
              XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                             GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
              XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                             GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
              XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                             GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
              XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                             GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
              XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                             GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                             GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                             GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                      VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                    VideoController.vcnPalTbl[
                                      VideoController.vcnMix2 (
                                        (VideoController.vcnPal8G16H[q >> 8] |
                                         VideoController.vcnPal8G16L[q & 255]),
                                        VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                    (p = (VideoController.vcnPal8G16H[q >> 8] |
                                          VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[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] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                           GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                           GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                           GraphicScreen.graM4[ga])) | 1) >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[q >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
                sx++;
                ga++;
                da++;
              }  //for k
            }  //if da<db
          }  //while da<db
        }  //drawRaster
      },  //JS_XHCT

      //================================================================================
      //JS_XHPT ($0007,$18xx,$1D50)
      //  概要
      //    JS  1024ドット65536色1プレーン＞スプライト
      //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
      //  手順
      //    1番目のパレットが1以下のとき
      //      グラフィックパレット0のカラーが0でないとき
      //        グラフィックパレット0のカラー
      //      さもなくば(グラフィックパレット0のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    1番目のパレットが2以上の偶数のとき
      //      1番目のカラーが0でないとき
      //        1番目のカラー
      //      さもなくば(1番目のカラーが0のとき)
      //        スプライトカラー(0は黒)
      //    さもなくば(1番目のパレットが3以上の奇数のとき)
      //      1番目のパレットを偶数化したパレットのカラーと
      //        スプライトカラー(0は黒)
      //      を混ぜたカラー(0は黒)
      //  中間コード1
      //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):spc(spp())):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp())):mix(jpc(tev(j1p()),tev(j1p())),spc(spp())))
      //  中間コード2
      //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):spc(spp()):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(spp()):mix(jpc(tev(j1p()),tev(j1p())),spc(spp()))
      //  中間コード3
      //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=jpc(v0,v0))!=0?v5:spc(spp()):mix(jpc(v10=tev(v0),v10),spc(spp()))
      //  中間コード4
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:spc(spp()):ls1(p)==0?(q=jpc(p,p))!=0?q:spc(spp()):mix(jpc(q=tev(p),q),spc(spp()))
      //  中間コード5
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:spc(spp()):(p&1)==0?(q=jpc(p,p))!=0?q:spc(spp()):mix(jpc(q=p&-2,q),spc(spp()))
      //  中間コード6
      //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):spo(spp()):(p&1)==0?(q=jpc(p,p))!=0?cto(q):spo(spp()):cto(mix(jpc(q=p&-2,q),spc(spp())))
      JS_XHPT {
        @Override public void drawRaster (int src, int dst, boolean rh) {
          SpriteScreen.sprStep3 ();
          int sx = 16;  //スプライトx座標
          int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
          int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
          int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
          int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
          int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
          int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
          if (rh) {
            int half = XEiJ.pnlScreenWidth >> 4 << 3;
            sx += half;
            gx += half;
            da += half;
          }
          int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
          while (da < db) {
            int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
            gx += dw;  //次回の1024ドットx座標
            int dc = da + dw;  //今回のARGB出力インデックスの終了位置
            while (da < dc) {
              int 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]])]);
              XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                          GraphicScreen.graM4[ga + 1])) <= 1 ?
                                    (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                          VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                    VideoController.vcnPalTbl[p] :
                                    VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                    (p & 1) == 0 ?
                                    (q = (VideoController.vcnPal8G16H[p >> 8] |
                                          VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                    VideoController.vcnPalTbl[q] :

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